Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database restore issues in Docker #34

Open
darryldaniel opened this issue Jul 13, 2024 · 1 comment
Open

Database restore issues in Docker #34

darryldaniel opened this issue Jul 13, 2024 · 1 comment

Comments

@darryldaniel
Copy link

I'm running a Rails app in a Docker container with Sqlite and I'm using the following command in the Docker entrypoint file:

./bin/rails litestream:restore -- --database=storage/production.sqlite3 --if-replica-exists

A few times now, the database has failed to restore with the following error message:

level=ERROR msg="failed to run" error="cannot apply wal: database disk image is malformed"

What does this error mean and is this the way I should be managing this in a docker environment?

@fractaledmind
Copy link
Owner

I unfortunately don't use Docker myself, so I'm not sure if that is an important detail or not. We can start debugging by checking the integrity of the database. Open the Rails console and run ActiveRecord::Base.connection.raw_connection.execute "PRAGMA integrity_check;". What output do you see?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants