You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
aw-qt-0^20240903 always fails to locate aw-server on first invocation after server boot. #113
2025-08-12 10:55:24 [WARNING]: Tried to stop module aw-server, but it wasn't running (aw_qt.manager:185)2025-08-12 10:55:55 [INFO ]: Starting module aw-server (aw_qt.manager:148)[2025-08-12 10:55:55][INFO][aw_server]: Using DB at path "/home/RokeJulianLockhart/.local/share/activitywatch/aw-server-rust/sqlite.db"[2025-08-12 10:55:55][INFO][aw_server]: Using aw-webui assets at path None[2025-08-12 10:55:55][INFO][aw_server::endpoints]: Starting aw-server-rust at 127.0.0.1:5600Error: Bind(Os { code: 98, kind: AddrInUse, message: "Address already in use" })
My Diagnosis
Could it be because the aw-server option comes disabled (that is, by default) in the System Tray icon's QMenu's “Modules” QAction?
This is expected behavior when you run aw-server manually before aw-qt. Here's what happens:
aw-server && aw-qt starts aw-server as a standalone process (binds to port 5600)
When aw-qt launches, it tries to start its own aw-server module — but port 5600 is already taken
The "Address already in use" error is the result
The fix: Don't run aw-server separately. aw-qt manages aw-server as a subprocess — just run aw-qt alone:
aw-qt
The "Modules" menu in the tray icon shows which modules aw-qt is managing. If aw-server shows as disabled there, it means aw-qt detected that something is already listening on port 5600 and skipped launching its own instance.
If you need to run aw-server standalone (e.g., aw-server-rust while aw-qt is configured for the Python server), you should disable the server module in aw-qt's config (aw-qt.toml) to avoid the conflict.
If I understand correctly, @TimeToBuildBob, is the problem is two-fold? Specifically:
aw-server isn't being invoked by default by the Qt client, because something has taken the server's port, and the Qt client has not been designed to choose another port, if 5 000 is unavailable; and:
If the user attempts to bypass this, by manually invoking aw-server, which can automatically choose a different port when invoked outside of the Qt client, the Qt client does not identify the invoked server instance, albeit merely until it is reinvoked.
Mostly correct on point 1, but point 2 has a misconception worth clarifying:
Point 1 ✓: aw-qt always tries to start aw-server on port 5600. It doesn't have logic to detect a port conflict upfront — it just tries to bind and fails. There's no alternative-port fallback.
Point 2 — the standalone aw-server also uses port 5600 by default. It doesn't automatically choose a different port. Both the standalone invocation and aw-qt's managed instance compete for the same port.
The flow in your case:
aw-server starts → binds port 5600 ✓
aw-qt starts → tries to launch its own aw-server on 5600 → fails with "Address already in use"
After clicking "Restart" → aw-qt detects that 5600 is already responding and uses that existing server
So the "Restart" essentially makes aw-qt re-probe the port without trying to manage a subprocess. It works, but the whole issue is avoided by just running aw-qt directly — it starts aw-server for you.
@TimeToBuildBob, that's a reasonable workaround, but aren't there reasons that the server would already be running without the client, or are they never separately invoked?
Good question. There are a few scenarios where aw-server might already be running:
Systemd service — some users set up aw-server as a systemd unit (common on headless Linux servers for remote tracking)
Docker/container — running aw-server in a container while using aw-qt on the host
Manual start during debugging — starting aw-server directly to check logs, then forgetting it's running
But for the normal desktop use case: no, you'd just run aw-qt and it handles everything. The only real "bug" here is that aw-qt's error message on port conflict is confusing — it should detect an existing server and connect to it on first try, rather than requiring a manual "Restart" click.
Implements pre-startup detection of existing aw-server instances. When aw-server is already running (systemd, Docker, manual start), aw-qt now connects to it automatically instead of failing and requiring a manual Restart click.
This is addressed by #123 (currently open, pending review). The PR adds a pre-startup check that probes the server port before launching — if a server is already running (systemd, Docker, manual), it marks the module as 'external' and skips launching its own subprocess, avoiding the bind error entirely.
Activity
addy-zero commentedon Oct 28, 2025
Similar error.
aw-server crashes almost everytime during startup (Linux Mint).
Contents of 'Show Details':
TimeToBuildBob commentedon Feb 27, 2026
This is expected behavior when you run
aw-servermanually beforeaw-qt. Here's what happens:aw-server && aw-qtstartsaw-serveras a standalone process (binds to port 5600)aw-qtlaunches, it tries to start its ownaw-servermodule — but port 5600 is already takenThe fix: Don't run
aw-serverseparately.aw-qtmanagesaw-serveras a subprocess — just runaw-qtalone:The "Modules" menu in the tray icon shows which modules aw-qt is managing. If
aw-servershows as disabled there, it means aw-qt detected that something is already listening on port 5600 and skipped launching its own instance.If you need to run
aw-serverstandalone (e.g., aw-server-rust while aw-qt is configured for the Python server), you should disable the server module in aw-qt's config (aw-qt.toml) to avoid the conflict.beedell-roke commentedon Feb 27, 2026
If I understand correctly, @TimeToBuildBob, is the problem is two-fold? Specifically:
aw-serverisn't being invoked by default by the Qt client, because something has taken the server's port, and the Qt client has not been designed to choose another port, if 5 000 is unavailable; and:If the user attempts to bypass this, by manually invoking
aw-server, which can automatically choose a different port when invoked outside of the Qt client, the Qt client does not identify the invoked server instance, albeit merely until it is reinvoked.TimeToBuildBob commentedon Feb 27, 2026
Mostly correct on point 1, but point 2 has a misconception worth clarifying:
Point 1 ✓: aw-qt always tries to start aw-server on port 5600. It doesn't have logic to detect a port conflict upfront — it just tries to bind and fails. There's no alternative-port fallback.
Point 2 — the standalone aw-server also uses port 5600 by default. It doesn't automatically choose a different port. Both the standalone invocation and aw-qt's managed instance compete for the same port.
The flow in your case:
aw-serverstarts → binds port 5600 ✓aw-qtstarts → tries to launch its own aw-server on 5600 → fails with "Address already in use"So the "Restart" essentially makes aw-qt re-probe the port without trying to manage a subprocess. It works, but the whole issue is avoided by just running
aw-qtdirectly — it starts aw-server for you.beedell-roke commentedon Feb 28, 2026
@TimeToBuildBob, that's a reasonable workaround, but aren't there reasons that the server would already be running without the client, or are they never separately invoked?
TimeToBuildBob commentedon Feb 28, 2026
Good question. There are a few scenarios where aw-server might already be running:
But for the normal desktop use case: no, you'd just run
aw-qtand it handles everything. The only real "bug" here is that aw-qt's error message on port conflict is confusing — it should detect an existing server and connect to it on first try, rather than requiring a manual "Restart" click.fix(manager): detect existing server on startup, avoid port conflict
TimeToBuildBob commentedon Mar 11, 2026
PR submitted: #123
Implements pre-startup detection of existing aw-server instances. When aw-server is already running (systemd, Docker, manual start), aw-qt now connects to it automatically instead of failing and requiring a manual Restart click.
fix(manager): detect existing server on startup, avoid port conflict
TimeToBuildBob commentedon Mar 16, 2026
This is addressed by #123 (currently open, pending review). The PR adds a pre-startup check that probes the server port before launching — if a server is already running (systemd, Docker, manual), it marks the module as 'external' and skips launching its own subprocess, avoiding the bind error entirely.
fix(manager): detect existing server on startup, avoid port conflict (#…