Failed to save categories after import, adding, editing or remove
Pre-submission checklist
- [x] I am on the latest ActivityWatch release.
- [x] I searched existing issues and believe this is not a duplicate.
OS
Windows 11 Pro 10.0.26200
ActivityWatch version
v0.14.1
Describe the bug
First after importing the "aw-category-export.json" an clicking the "save"-Button it appears an error message with these information: "Failed to save categories (HTTP 500): Request failed with status code 500". Furthermore, it is no longer possible to delete categories or save newly created ones.
Restart of aw in taskbar doesn't fix the problem.
Steps to reproduce
- Go to "http://localhost:5600/#/settings/categorization"
- Click on "import" or "add category"
- Get Error Message
- Close browser tab and goto step 1
Expected behavior
"Saved" message displayed and new categories saved, changed or deleted
Logs, screenshots, or other documentation
aw-server_2026-10-20T18-09-19.log
Additional context
No response
Hi there! As you're new to this repo, please make sure you've used an appropriate issue template and searched for duplicates (it helps us focus on actual development!). We'd also like to suggest that you read our contribution guidelines and our code of conduct. Thanks a bunch for opening your first issue! 🙏
The log points to a settings-file write failure rather than a category-format error: PermissionError on settings.json recurs for locale and other settings too, while database heartbeats continue writing.
Could you check that file's attributes and whether it is a file rather than a folder? These read-only PowerShell commands use the directory shown in your log:
$p = Join-Path $env:LOCALAPPDATA 'activitywatch\activitywatch\aw-server\settings.json'
Get-Item -LiteralPath $p | Select-Object FullName, PSIsContainer, Attributes
attrib $p
Please share the attributes (you can redact your username). Don't delete the file or change permissions broadly; it contains your settings. A read-only attribute or a process holding the file are possible causes, not yet confirmed.
I opened ActivityWatch/aw-server#198 to preserve the previous settings on failed writes and return a more useful path/error message. Its 139 selected server tests pass locally, including failed writes, concurrent updates and symlink preservation. That PR is not released and does not establish the cause of your Windows permission denial, so this report stays open.
Tested the #/settings/categorization import/add/edit/remove/save flow end-to-end on published v0.14.3 (aw-server + bundled WebUI, macOS 27.3 arm64, isolated HOME and --profile verify1537 --port 5698):
- Writable
settings.json: Importing anaw-category-export.json, adding, editing, and removing categories all save cleanly (HTTP 200) and persist acrossaw-serverrestarts. - Read-only
settings.json(chmod 444) — backend (ActivityWatch/aw-server#198): Works as intended.POST /api/0/settings/classespreserves the previous categories in memory and on disk, logs the error (errno 13) plus the startup read-only warning on restart, and returnsHTTP 500with the actionable JSON body:{"message": "Unable to save settings to .../aw-server/settings.json: Settings file is read-only", "path": ".../aw-server/settings.json", "errno": 13} - WebUI gap still present in
v0.14.3andaw-webuimaster(af79fb1d): Even whenaw-serverreturns that JSON body, clicking Save in#/settings/categorizationstill displays only the opaque alert from this issue:
InFailed to save categories (HTTP 500): Request failed with status code 500ActivityWatch/aw-webui'ssrc/views/settings/CategorizationSettings.vue(saveClasses), the catch block readsconst detail = (e && e.message) || String(e);and never checkse?.response?.data?.message, so Axios's generic status message hides the server'ssettings.jsonpath and reason.
Scope note: this does not diagnose the original Windows 11 PermissionError cause (still waiting on the file attributes requested above); it only flags that the improved aw-server#198 error detail isn't yet surfaced in the Categorization UI on v0.14.3.
(Disclosure: isolated testing and this verification note were prepared with AI assistance.)
Thanks for the detailed verification. I confirmed the WebUI error-handling gap on current master and opened ActivityWatch/aw-webui#1294 to show the server's message (including the settings path and reason), while keeping the HTTP status and a fallback for older servers or network errors.
The mounted Save-button regression failed before the fix and passes afterward; 205 related tests pass locally. The PR is not merged or released, and CI/review are still running.
This improves diagnosis, not permissions. The original Windows failure remains open pending the file attributes requested above; no settings deletion or permission changes are needed to test this UI fix.