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

Run application after manually modifying the database file #3876

Closed
2 tasks done
0xgeorgiev opened this issue Oct 11, 2023 · 2 comments
Closed
2 tasks done

Run application after manually modifying the database file #3876

0xgeorgiev opened this issue Oct 11, 2023 · 2 comments
Labels
area:core issues describing changes to the core of uptime kuma help question Further information is requested

Comments

@0xgeorgiev
Copy link

⚠️ Please verify that this bug has NOT been raised before.

  • I checked and didn't find similar issue

🛡️ Security Policy

📝 Describe your problem

After adding a new PostgreSQL monitor and providing wrong connection string (ending with "ssl=true") as described in #3868, the application threw an error message in the logs and the container started restarting. In order to fix the issue I had to manually modify the "kuma.db" database file and remove the service from the "monitor" table. I also decremented by 1 the value of the "seq" column where the "name" column has value of "monitor" in the "sqlite_sequence" table (I guess this holds information for the last generated id, and since I removed the last entry, decided to reduce it by 1). There wasn't any other data regarding the deleted entry in the other tables, so they remained unchanged.
I did that, because I didn't want to lose all my data which was already in the database and I did not have a backup of it. After I reuploaded the database file to the Azure blob, where the application is running, I found some more error messages in the logs which were regarding SQLite I/O operations. I guess the database went out of sync or something like that. I also suppose that it has something to do with the "kuma.db-shm" and "kuma.db-wal" as they are responsible for sync.
Now I am stuck and not sure how to proceed. Should I recreate those other databases or should I use the old ones?
Any advise is welcomed and the final goal is to recreate the application with the database that I have modified and still holds all the information about my monitored services. Cheers!

📝 Error Message(s) or Log

[INCREMENTALVACUUM] ERROR: Failed: PRAGMA wal_checkpoint(PASSIVE) - SQLITE_IOERR: disk I/O error

🐻 Uptime-Kuma Version

1.23.2

💻 Operating System and Arch

Windows

🌐 Browser

Google Chrome 117.0.5938.150

🐋 Docker Version

No response

🟩 NodeJS Version

16.20.2

@louislam
Copy link
Owner

My guess is you did not download shm and wal files to your local and modified the db.

My suggestion in this case:

  1. Backup all data first
    2, Remove shm and wal files
    3, Try to start again the server again.

I guess it should be able to start server, but some data in wal files may be lost since we removed it. If you did any other configs just before the crash, you should review them.

@CommanderStorm CommanderStorm added question Further information is requested area:core issues describing changes to the core of uptime kuma labels Dec 21, 2023
@CommanderStorm
Copy link
Collaborator

since @errorgeorgiev did not answer, I am assuming this issue is resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core issues describing changes to the core of uptime kuma help question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants