question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question on Readonly DB error

See original GitHub issue

Currently when i build the Dockerfile (the one in the root directory) and execute it… it works fine. Site comes up, no prob.

But, i am not able to add a dashboard. Im just trying to make sure this works properly before launching it to a production environment.

ERROR:flask_appbuilder.models.sqla.interface:Add record error: (sqlite3.OperationalError) attempt to write a readonly database
[SQL: INSERT INTO dashboards (created_on, changed_on, dashboard_title, position_json, description, css, json_metadata, slug, published, created_by_fk, changed_by_fk) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
[parameters: ('2020-06-17 18:22:23.045075', '2020-06-17 18:22:23.045085', 'Test', None, None, None, None, 'test', 0, 1, 1)]
(Background on this error at: http://sqlalche.me/e/e3q8)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1248, in _execute_context
    cursor, statement, parameters, context
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 590, in do_execute
    cursor.execute(statement, parameters)
sqlite3.OperationalError: attempt to write a readonly database

How do I fix this readonly db issue? Thanks in advance, appreciate the help.

  • Superset version: 0.36
  • Python version 3.6
  • Docker Versions 19.03.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
issue-label-bot[bot]commented, Jun 17, 2020

Issue-Label Bot is automatically applying the label #question to this issue, with a confidence of 0.71. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

0reactions
NoneFirecommented, Apr 17, 2022

Thanks,it’s a really good and effective method. I think the reason of this question is the supert user and root user have different file permissions.

It’s my dockerfile,for you reference:


USER root

RUN pip install mysqlclient

RUN pip install sqlalchemy-redshift
RUN pip install PyMySQL

USER superset

RUN superset fab create-admin xxxxx

RUN superset db upgrade

RUN superset load_examples

RUN superset init```
Read more comments on GitHub >

github_iconTop Results From Across the Web

Question on Readonly DB error · Issue #10087 - GitHub
How do I fix this readonly db issue? Thanks in advance, appreciate the help. Superset version: 0.36; Python version 3.6; Docker Versions 19.03.5....
Read more >
SQLite error 'attempt to write a readonly database' during insert?
The problem, as it turns out, is that the PDO SQLite driver requires that if you are going to do a write operation...
Read more >
Database cannot be upgraded because it is read-only or has ...
This isn't an access issue. The problem is that you are attaching the database to a higher version of SQL Server than the...
Read more >
error changing data - attempt to write a readonly database
Take a detailed look at the permissions on the folder where you keep your database files, the database file, and journal or .shm...
Read more >
Applicationintent=ReadOnly Failed to update database ...
Applicationintent=ReadOnly Failed to update database "master" because the database is read-only. (Microsoft SQL Server, Error: 3906).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found