Chia-Network / chia-blockchain

Chia blockchain python implementation (full node, farmer, harvester, timelord, and wallet)
Apache License 2.0
10.82k stars 2.03k forks source link

[Bug] After updating 2.1.1, the service has been stuck starting #16600

Closed Michael121318 closed 11 months ago

Michael121318 commented 1 year ago

What happened?

After updating 2.1.2, the service has been stuck starting image

Version

2.1.1

What platform are you using?

Windows

What ui mode are you using?

GUI

Relevant log output

No response

BrandtH22 commented 1 year ago

Hey @Michael121318 , It is likely that your database needs to be upgraded to v2 either by using the cli commands here (https://docs.chia.net/cli#upgrade) or by replacing the v1 with the official DB snapshot from here (https://www.chia.net/downloads/#database-checkpoint).

Steps for the CLI command:

1. Stop the chia client (this can be done while chia is running but stopping the client saves from any potential issues)
2. Run the command `chia db upgrade` (you do not need the input or output paths if these are still default)
- This process will take some time and requires additional space as the v1 db is compacted into the v2 db which leaves the v1 db intact
3. 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)
4. After the above completes start the chia client
5. If all loads up properly (might take ~5-10 minutes to load) then you can safely delete the v1 db found here (~\.chia\mainnet\db\blockchain_v1_mainnet.sqlite)

Steps for using the torrent:

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 5-10 minutes)
wjblanke commented 1 year ago

Agreed this is probably a v1/v2 db issue