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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to 2.8: service can't start, "attempt to write a readonly database" #959

Closed
maxhac03 opened this issue Nov 24, 2023 · 2 comments
Closed
Labels
馃 bug Something isn't working

Comments

@maxhac03
Copy link

馃悶 Describe the bug
Upgrade from 2.7 to 2.8 with "apt upgrade ntfy" break the service.

馃捇 Components impacted
Ubuntu 22.04.3
VM dedicated to NTFY.

馃挕 Screenshots and/or logs
{"time":"2023-11-24T03:08:01.973Z","level":"INFO","message":"Migrating user database schema: from 4 to 5","tag":"user_manager"}
{"time":"2023-11-24T03:08:01.973Z","level":"FATAL","message":"attempt to write a readonly database","exit_code":1}
{"time":"2023-11-24T03:08:02.304Z","level":"INFO","message":"Migrating user database schema: from 4 to 5","tag":"user_manager"}
{"time":"2023-11-24T03:08:02.306Z","level":"FATAL","message":"attempt to write a readonly database","exit_code":1}
{"time":"2023-11-24T03:08:02.549Z","level":"INFO","message":"Migrating user database schema: from 4 to 5","tag":"user_manager"}
{"time":"2023-11-24T03:08:02.549Z","level":"FATAL","message":"attempt to write a readonly database","exit_code":1}
{"time":"2023-11-24T03:08:02.823Z","level":"INFO","message":"Migrating user database schema: from 4 to 5","tag":"user_manager"}
{"time":"2023-11-24T03:08:02.823Z","level":"FATAL","message":"attempt to write a readonly database","exit_code":1}
{"time":"2023-11-24T03:08:03.055Z","level":"INFO","message":"Migrating user database schema: from 4 to 5","tag":"user_manager"}
{"time":"2023-11-24T03:08:03.055Z","level":"FATAL","message":"attempt to write a readonly database","exit_code":1}

馃敭 Additional context
ntfy_comandline.txt

@maxhac03 maxhac03 added the 馃 bug Something isn't working label Nov 24, 2023
@binwiederhier
Copy link
Owner

That sounds like a permission issue to me: https://matthewsetter.com/sqlite-attempt-to-write-to-readonly-database/

Did you ever change the user database permissions? They should be ntfy:ntfy if you're running systemd, similar to this:

root@ntfy:~# ll /var/lib/ntfy/user.db
-rw-r--r-- 1 ntfy ntfy 1912832 Nov 24 11:43 /var/lib/ntfy/user.db

@maxhac03
Copy link
Author

-rw-r--r-- 1 root root 77824 Aug 31 14:33 /var/lib/ntfy/user.db

This was indeed the issue. After fixing the permission the upgrade worked.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
馃 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants