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

[Bug] database not syncing after height 6,316,286 (always yellow status) #19008

Closed
Taka-Tim opened this issue Dec 9, 2024 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@Taka-Tim
Copy link

Taka-Tim commented Dec 9, 2024

What happened?

database not syncing after height 6,316,286 (always yellow status)
image

Version

2.4.4

What platform are you using?

Windows

What ui mode are you using?

GUI

Relevant log output

2024-12-09T22:49:14.071 2.4.4 full_node chia.full_node.full_node: ERROR    sync from fork point failed: DatabaseError: database disk image is malformed
Traceback (most recent call last):
  File "chia\util\log_exceptions.py", line 20, in log_exceptions
  File "chia\full_node\full_node.py", line 1218, in sync_from_fork_point
  File "chia\full_node\full_node.py", line 1175, in validate_block_batches
  File "chia\full_node\full_node.py", line 1393, in add_block_batch
  File "chia\consensus\blockchain.py", line 427, in add_block
  File "chia\consensus\block_body_validation.py", line 402, in validate_block_body
  File "chia\full_node\coin_store.py", line 171, in get_coin_records
  File "aiosqlite\cursor.py", line 76, in fetchall
  File "aiosqlite\cursor.py", line 40, in _execute
  File "aiosqlite\core.py", line 132, in _execute
  File "aiosqlite\core.py", line 115, in run
sqlite3.DatabaseError: database disk image is malformed
@Taka-Tim Taka-Tim added the bug Something isn't working label Dec 9, 2024
@Taka-Tim Taka-Tim changed the title [Bug] [Bug] database not syncing after height 6,316,286 (always yellow status) Dec 9, 2024
@BrandtH22
Copy link
Contributor

Hey @Taka-Tim , that error log is indicating that the database is corrupt. The two options are to either resync the entire DB from scratch (can take a few days depending on download speeds) or to use the database torrent snapshot.

To use the snapshot you can follow these directions (make sure to remove your current DB first so as to make room for the new one):

  1. Download the torrent file from https://www.chia.net/downloads/#database-checkpoint
  2. Use a torrent client to download the full db
  3. Unpack/reassemble the torrent file that was downloaded (on windows I used 7zip, Mac and linux have built in tools that work for this)
  4. Move the db to the correct folder (~\.chia\mainnet\db\) and update the name to "blockchain_v2_mainnet.sqlite" (removing the date information in the name)
  5. Verify the config file (~\.chia\mainnet\config\config.yaml) has the correct value under the full_node section for database_path: db/blockchain_v2_CHALLENGE.sqlite (should only need to change the v1 to v2)
  6. Launch chia and wait for a bit (the height to hash and peers files need to be built so this can take upwards of 30 minutes)

Make sure you have enough space for the DB and anytime you are upgrading chia or needing to restart the computer ensure that chia is fully stopped first (failure to do so can result in db corruption).

Let us know if you run into any issues setting up the snapshot DB or if any questions arise

@Taka-Tim
Copy link
Author

Dear, friend, How many time I need re-download your totternt?
In my previous request (when after installing version 2.4.4. the program stopped opening) I spent a week downloading it and finding software to open a twice-archived file. I specifically bought (to exclude other versions) a completely new disk and installed the database on it, and now after 5 days of work it is... broken again? Maybe you will already notice that this version of the software breaks the database, and will not force to download it again and again?

@BrandtH22
Copy link
Contributor

@Taka-Tim , this issue seems to be recurring on your system. There are thousands of users running 2.4.4 without having any issues with the DB.

Have you reviewed your system logs to see if there is a hardware issue leading to the corruption?

@BrandtH22
Copy link
Contributor

Hey @Taka-Tim , when you are moving the db to the db folder are you removing the other db and associated files (the -wal and -shm files)?

@Taka-Tim
Copy link
Author

After update to 2.4.5 all problems were eliminated. The program and DB are working.

@BrandtH22
Copy link
Contributor

Hey @Taka-Tim thank you for the confirmation and I am glad to hear it is all working now.
Happy farming 🌱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants