Reputation: 394
I have the tutorial app from the flask docs and modified for my use.
I was able to deploy my flask app and create the db via container_commands (flask init-db)
But when I try to write something to the db from the web browser. It throws the exception that
"sqlite3.OperationalError: attempt to write a readonly database"
It seems the problem is the write permission to the sqlite file. But it was created at the time of deploying the application. Any help. Ideally when you are deploying in your own production env (not cloud), the sqlite is created in the venv/var/app-instance folder. How do I access this in AWS EB.
Upvotes: 2
Views: 1398
Reputation: 8593
It looks like file write permission issue to me as well.
here is how i would troubleshoot the issue:
.ebextensions
Hope this helps you move forward.
Also look at the reference below shows how to change file permissions.
Reference: python sqlite3 OperationalError: attempt to write a readonly database
Upvotes: 1