Did you try an AI?
For instance, here is what Hy4 Flash (free version) suggested by reading your messages:
Short answer
It’s not the network, the browsers, or the external SSD. On that machine xdg-open never returns, and Zola calls it synchronously on the server’s single-threaded async runtime, before axum::serve() starts accepting connections. The TCP listener is already bound, so browsers connect fine — but nothing ever reads their requests. Hence a blank tab that spins forever in every browser.
Closing the browser is what unblocks xdg-open, which lets Zola finally reach axum::serve(); that’s why opening the URL again then works. XDG_CURRENT_DESKTOP=GNOME works because it switches xdg-open to the gio open path, which hands the URL off over D-Bus and returns immediately.
The exact code path (Zola v0.23.6, src/cmd/serve.rs)
thread::spawn(move || {
let rt = tokio::runtime::Builder::new_current_thread() // line 634: ONE thread
...
rt.block_on(async {
let listener = tokio::net::TcpListener::bind(&bind_address).await // 649: socket now LISTENing
.expect("Could not bind to address");
...
if open && let Err(err) = open::that(&constructed_base_url) { // 660: blocking call
log::error!("Failed to open URL in your browser: {err}");
}
axum::serve(listener, app).await // 664: only now do we accept
});
});
And open (0.23.6 locks open 5.4.4) does wait for the launcher:
pub fn that(path: impl AsRef<OsStr>) -> io::Result<()> {
...
match cmd.status_without_output() { ... } // = Command::status() → waits for xdg-open to exit
}
The crate’s own docs warn about exactly this: “Sometimes, depending on the platform and system configuration, launchers can block. If you want to be sure they don’t, use that_in_background() or that_detached.”
Why it happens on i3 + LibreWolf
xdg-open 1.2.1 (Manjaro) dispatches on XDG_CURRENT_DESKTOP. With i3 it lands in DE=generic, and the generic URL path ends in either:
open_generic_xdg_x_scheme_handler → env "$command" "$@" (waits for the desktop-file Exec), or
open_envvar → $browser "$url" with no & — it waits for the browser to exit before exit_success.
LibreWolf launched fresh (no already-running instance) stays in the foreground, so xdg-open waits for the whole browsing session. With XDG_CURRENT_DESKTOP=GNOME, xdg-open takes open_gnome → gio open, which uses GIO/D-Bus activation and returns straight away. That is exactly the workaround they found.
Why every symptom fits
| Observation |
Explanation |
| Spinner, blank page, empty browser console |
The request was never read; no response headers ever come back |
| No “connection refused” |
TcpListener::bind already did listen(); the kernel completes the handshake and queues the connection |
| Three different browsers all hang |
The accept loop hasn’t started at all — it’s not browser-specific |
| Closing the browser fixes it |
xdg-open exits → open::that returns → axum::serve starts → the next tab load works |
| Other computer is fine |
Its xdg-open takes a non-blocking path (GNOME/KDE/gio open, or the browser was already running) |
| Same external SSD, same files |
Irrelevant — the difference is the launcher configuration |
2-minute confirmation
zola serve # no --open; open http://127.0.0.1:1111 manually → should load instantly
pgrep -a xdg-open # while the tab spins: xdg-open is alive as a child of zola
pstree -p "$(pgrep -f 'zola serve')" # or: ps -o pid,ppid,stat,cmd --forest
time xdg-open http://127.0.0.1:1111 # prompt returns only when the browser is closed
Also: start LibreWolf first, then zola serve --open — it should work, because librewolf URL hands off to the existing instance and exits immediately.
Fix for the user / upstream
Workarounds: zola serve without --open (cleanest), their XDG_CURRENT_DESKTOP=GNOME trick, or pre-starting the browser.
The real fix is a 3-line Zola patch — never call the opener on the runtime thread:
if open {
// open::that() waits for xdg-open, which can run the browser in the foreground.
let _ = open::that_in_background(constructed_base_url.clone());
}
axum::serve(listener, app).await.expect("Could not start web server");
(that_in_background exists in open 5.4.4; that_detached would also work.) Since the listener is already bound, opening the browser before axum::serve is polled is safe — connections just queue.
I can’t verify which xdg-open branch fires on their box (BROWSER vs. xdg-mime default), but both wait for the browser, so the conclusion is the same.