Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

746
Views
Python Flask - SQLite database still gives readonly error even after changing permissions

I have a CentOS server on which I have Apache 2.4, mod_wsgi 4.8 and Flask on python 3.6 (running though https). My app is running online fine except when I try to write to my SQLite database. I get the error of sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) attempt to write a readonly database

Searching through diferent posts it is recomended to change the owenership of the database and respective containing folder which I did (I even gave 777 permissions for the sake of testing)

see image

I doubled checked the user running the server cross checking with the PID and confirmed its the user apache.

see image

Here is the ssl_error_log:

  • [Mon Jul 05 18:59:29.815559 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130] raise exception
  • [Mon Jul 05 18:59:29.815567 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130] File "/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/sqlalchemy/engine/base.py", line 1771, in _execute_context
  • [Mon Jul 05 18:59:29.815574 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130] cursor, statement, parameters, context
  • [Mon Jul 05 18:59:29.815582 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130] File "/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
  • [Mon Jul 05 18:59:29.815589 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130] cursor.execute(statement, parameters)
  • [Mon Jul 05 18:59:29.815596 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130] sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) attempt to write a readonly database
  • [Mon Jul 05 18:59:29.815603 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130] [SQL: INSERT INTO "Utilizadores" (id, nome, email, imagem_perfil) VALUES (?, ?, ?, ?)]
  • [Mon Jul 05 18:59:29.815639 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130] (Background on this error at: http://sqlalche.me/e/14/e3q8)
  • [Mon Jul 05 18:59:29.815711 2021] [wsgi:error] [pid 5292] [remote 86.216.60.158:64130]

Your help would be apreciated.

P.S. Sorry for the lack of formatting it's my first post.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!