Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aw-server-rust gives 404 when run from .app on macOS #441

Closed
2 tasks done
mpeteuil opened this issue Jun 15, 2020 · 4 comments · Fixed by #506
Closed
2 tasks done

aw-server-rust gives 404 when run from .app on macOS #441

mpeteuil opened this issue Jun 15, 2020 · 4 comments · Fixed by #506

Comments

@mpeteuil
Copy link

mpeteuil commented Jun 15, 2020

  • I am on the latest ActivityWatch version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • OS version and name: MacOS Mojave 10.14.6

  • ActivityWatch version: 0.9.2

Describe the bug

Switching on aw-server-rust and turning off aw-server seems to result in some of the dashboard (WebUI) functionality missing. I have verified that aw-server-rust is running since http://localhost:5600/api/0/buckets/ actually returns what you would expect when it's on.

To Reproduce

  1. Download the latest ActivityWatch for macOS (https://github.com/ActivityWatch/activitywatch/releases/download/v0.9.2/activitywatch-v0.9.2-macos-x86_64.dmg)
  2. Install by copying the .app to the Applications directory
  3. Open ActivityWatch (doing the Security & Privacy preferences dance to open it)
  4. Grant ActivityWatch required permissions under Accessibility and also under Automation (System Events).
  5. Open the WebUI by going to http://localhost:5600
  6. Disable aw-server by opening the tray icon > modules and clicking aw-server.
  7. Enable aw-server-rust by opening the tray icon > modules and clicking aw-server-rust.
  8. Reload the WebUI at http://localhost:5600 and get a 404 json reponse {"reason":"Resource was not found.","status":404}

Expected behavior

The expectation is that reloading the WebUI after switching to aw-server-rust in step 8 would give the same result as the aw-server running in step 5.

Documentation

Here's a bit from the aw-server-rust logs:

[2020-06-15][08:27:36][aw_server][INFO] Using DB at path "/Users/mpeteuil/Library/Application Support/activitywatch/aw-server-rust/sqlite.db"
[2020-06-15][08:27:36][aw_server][WARN] Unable to find an aw-webui asset path which exists, falling back to ./aw-webui/dist
[2020-06-15][08:27:36][aw_server][INFO] Using aw-webui assets at path "./aw-webui/dist/"
[2020-06-15][08:27:36][aw_server::endpoints][INFO] Starting aw-server-rust at 127.0.0.1:5600
[2020-06-15][08:27:36][rocket::rocket][WARN] environment is 'production', but no `secret_key` is configured
[2020-06-15][08:27:37][_][ERROR] No matching routes for OPTIONS /api/0/buckets/aw-watcher-web-firefox/heartbeat?pulsetime=80.
[2020-06-15][08:27:37][_][WARN] Responding with 404 Not Found catcher.
[2020-06-15][08:27:45][_][WARN] Response was `None`.
[2020-06-15][08:27:45][_][WARN] Responding with 404 Not Found catcher.

The No matching routes for OPTIONS message is most of the log file as you might expect with it being a heartbeat.

Additional context

If there's more that could be helpful let me know and I'll add it.

@johan-bjareholt
Copy link
Member

johan-bjareholt commented Jun 16, 2020

Thanks for the descriptive report!
The issue can be seen in the log, seems like we don't put aw-webui in the directory which aw-server-rust looks for it on macOS. Definitely needs to be fixed!

[2020-06-15][08:27:36][aw_server][WARN] Unable to find an aw-webui asset path which exists, falling back to ./aw-webui/dist

@nicolae-stroncea
Copy link
Member

@mpeteuil did you try a hard refresh to the page? I had the same issue on Linux and that fixed it for me

@mpeteuil
Copy link
Author

Thanks for the suggestion @nicolae-stroncea, unfortunately refreshing the page does not resolve the issue. This seems to be a routing problem.

@ErikBjare
Copy link
Member

@mpeteuil It has now been fixed, the changes will be in the next release (v0.10)

@ErikBjare ErikBjare changed the title Switching to aw-server-rust instead of aw-server gives 404 in WebUI aw-server-rust gives 404 when run from .app on macOS Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants