SQLIte3 permissions

I am getting this error when accessing blog.russell-clark-linuxvps3.site: attempt to write a readonly database
The permissions are:
:~/DjangoBlog$ ls -l
total 200
drwxrwxr-x 6 russellclark russellclark 4096 Apr 26 16:45 app_users
drwxr-xr-x 6 russellclark russellclark 4096 Apr 26 16:45 blog
drwxrwxr-x 3 russellclark russellclark 4096 Apr 26 17:35 DjangoBlog
-rwxrwxrwx 1 www-data www-data 155648 Oct 1 15:00 djangoblog.db
drwxrwxr-x 6 russellclark russellclark 4096 Apr 26 17:37 env
-rwxr-xr-x 1 russellclark russellclark 539 Apr 26 16:39 manage.py
drwxrwxr-x 4 russellclark www-data 4096 Apr 26 16:45 media
drwxr-xr-x 4 russellclark russellclark 4096 Oct 1 14:46 project
-rw-rw-r-- 1 russellclark russellclark 9104 Apr 26 16:45 README.md
-rw-rw-r-- 1 russellclark russellclark 230 Apr 26 16:45 requirements.txt
drwxrwxr-x 4 russellclark russellclark 4096 Apr 26 16:45 static_collected

Any help much appreciated

[Wed Oct 02 09:43:54.273766 2019] [wsgi:error] [pid 756:tid 139634846447360] [remote 81.158.43.63:57020] django.db.utils.OperationalError: attempt to write a readonly database

2 Replies

Linode Staff

Any chance you're running SELinux? I've had similar issues like this in the past. If so, you might find this StackOverflow thread helpful: https://stackoverflow.com/questions/21054245/attempt-to-write-a-readonly-database-django-w-selinux-error/31542906

I have sweated over this for over a day. And you ride to my rescue. I am using Ubuntu 19.04. But the article you reference says sudo chown www-data:www-data on the site directory & sqllite.db. IT WORKED. Its the directory permission which did the trick.

CANNOT THANK YOU ENOUGH!!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct