Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

754
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda