Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

748
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda