ActivityWatch Tauri sometimes fails to initialize on startup and does not record activity
Pre-submission checklist
- [x] I am on the latest ActivityWatch release.
- [x] I searched existing issues and believe this is not a duplicate.
OS
Parrot OS 7.4
ActivityWatch version
v0.14.1
Describe the bug
Every morning after starting my laptop, ActivityWatch Tauri sometimes fails to initialize correctly. A background process appears to be running, but the application does not open normally and activity tracking does not work.
I have to find and terminate the existing process, then launch the AppImage again. Sometimes I need to repeat this two or three times before ActivityWatch starts working correctly.
Until it initializes successfully, activity is not recorded, potentially leaving gaps in my daily tracking history.
Steps to reproduce
- Start the laptop.
- Launch the v0.14.1 AppImage.
- Observe that a background process may be running, but the application is not functioning normally and activity is not being recorded.
- Check the API using:
curl -sS --max-time 3 http://localhost:5600/api/0/info - During unsuccessful startup attempts, the request fails with Could not connect to server.
- After waiting and retrying, the API eventually responds.
- Find and terminate the existing process, then relaunch the AppImage if necessary.
Expected behavior
ActivityWatch should initialize reliably when launched, make its API available, open its interface normally, and begin recording activity without requiring repeated manual process termination and restarts.
Logs, screenshots, or other documentation
Additional context
- Startup is unreliable and may require multiple manual restarts.
- The API is initially unreachable during unsuccessful startup attempts.
- Activity tracking does not work until the application initializes successfully.
- When the API eventually responds, it reports v0.14.0 (rust) even though I launched the v0.14.1 AppImage.
The terminal also displays GTK warnings, including:
- Failed to load module "xapp-gtk3-module"
- Failed to load module "colorreload-gtk-module"
- Failed to load module "appmenu-gtk-module"
Fixed in ActivityWatch/aw-tauri#297.
Two changes:
-
The autostart entry is refreshed. The OS entry records the executable that registered it, so a new AppImage downloaded to a new path leaves the entry running the old, now-deleted image — login starts nothing, with no explanation. On launch aw-tauri now reads the registered command and rewrites the entry when it no longer matches the executable this build would register now (
$APPIMAGEon Linux, notcurrent_exe()). The enabled state is kept, and an entry the user disabled in place (Hidden=true) is left alone. -
The silent second-instance exit is explained. When a second instance is closed because one is already running, the running instance now shows a notification naming its version and executable path — so launching a newer AppImage tells you which older build is in the way, instead of nothing appearing at all.
Verified on Linux with an isolated HOME and two AppImage paths: with a binary built from master the entry kept pointing at the old path; with the fix it is rewritten to the new one. Details and logs are in the PR.
Leaving this issue open — the fix only reaches users in a release that contains it.
Tested the published macOS Apple Silicon v0.14.3 Tauri artifact (activitywatch-tauri-v0.14.3-macos-arm64.dmg, SHA-256 2e505f98..., which includes ActivityWatch/aw-tauri#297, ActivityWatch/aw-tauri#300, and ActivityWatch/aw-tauri#293) on macOS 27.3 (arm64) using an isolated HOME, --profile verify11a --port 5691, AW_DISABLE_AUTO_UPDATE=1, and empty autostart.modules:
- Stale named-profile LaunchAgent refresh (
aw-tauri#297): A pre-seededaw-tauri-verify11a.plistpointing at a nonexistent app path was updated in place to the runningaw-tauribinary while preserving--profile verify11a --port 5691,RunAtLoad, andKeepAlive. MovingActivityWatch.appinto a directory with spaces and relaunching also refreshedaw-tauri's own generated plist cleanly (plutil -lintpassed). - Failed migration retention & retry (
aw-tauri#300): With a legacyaw-tauri.plistowning--profile verify11aand a directory blockingaw-tauri-verify11a.plist, startup loggedFailed to migrate legacy autostart entry; keeping the original for retry: Is a directory (os error 21)and kept the original plist intact. Removing the blocker let the next launch create the new plist and remove the legacy one. - Second-instance exit & version (
aw-tauri#297/aw-tauri#293): Launching a second instance while the first was running exited0, the primary loggedAnother instance is running, quitting!/Lock file detected, and/api/0/inforeturnedv0.14.3. CleanSIGTERMremoved/tmp/net_activitywatch_tauri_si.sock.
Scope note: this covers the pending native macOS published-artifact verification for named-profile LaunchAgents and single-instance handling; default-profile AppleScript Login Items (which aw-tauri#297 notes cannot be read back) and the reporter's Parrot OS AppImage retest remain separate.
(Disclosure: isolated testing and this verification note were prepared with AI assistance.)
@mahammadsahin the fix from ActivityWatch/aw-tauri#297 shipped in the stable v0.14.3 release (activitywatch-tauri-v0.14.3-linux-x86_64.AppImage).
It matches one detail in your report: the API answered v0.14.0 while you had launched the v0.14.1 AppImage. That means an older instance was running, most likely started at login from an autostart entry that still pointed to a previous AppImage path. The second launch then exited silently. v0.14.3 rewrites that autostart entry to the current AppImage when it launches. If another instance is already running, it now shows a notification with that instance's version and path.
Could you try v0.14.3 for a few mornings? Launch it manually once so the autostart entry gets refreshed. If it still fails to start, please post the output of cat ~/.config/autostart/aw-tauri*.desktop and curl -sS http://localhost:5600/api/0/info.
Thanks for the fix! I've been using v0.14.3, and the autostart seems to be working properly now. I haven't experienced the issue again so far. Appreciate you investigating and fixing this!
Thanks for confirming! Closing as resolved in v0.14.3 with your successful retest. If startup or recording fails again, please let us know here so we can reopen and investigate.