Hi, every time I start dcrd to do a full sync I get this problem after some time: 2017-08-28 22:21:32.823 [INF] DCRD: Version 1.0.8+release (Go version go1.8.3) 2017-08-28 22:21:32.826 [INF] DCRD: Home dir: /home/pi/.dcrd 2017-08-28 22:21:32.827 [INF] DCRD: Loading block database from '/home/pi/.dcrd/data/mainnet/blocks_ffldb' 2017-08-28 22:21:32.858 [ERR] DCRD: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-000534]: leveldb: manifest corrupted (field 'comparer'): missing [file=MANIFEST-000534] 2017-08-28 22:21:32.858 [INF] DCRD: Shutdown complete also I did the update because 1.0.7 was having a corrupt db after some time... there is one thing clearly missing. The ability to repair the db... even smth as simple as saying from block 111233 on delete and sync again.
That's odd. I think something might have already been off prior to the upgrade. I upgraded to 1.0.8 without issue on my Raspberry Pi. I've never seen that issue before but I would suggest deleting the entire block chain (from /home/pi/.dcrd/data/mainnet/) and letting dcrd download it from scratch. It will take awhile on a Raspberry Pi, but leave it on overnight and hopefully it will be done by morning. Alternatively, I can upload a copy of the blockchain from my Raspberry Pi running dcrd v1.0.8 and you can try to import it. I'm not sure if that would work or not, but it might be worth a try!
@David that's actually what I did when upgrading to 1.0.8, because the db was corrupt. So I thought I'll do a full sync and upgrade at the same time. I tried the full sync 2 times and every time I got this problem. Would you mind sharing your Raspberry Pi configuration? I have the feeling that running it crashes the system and this is what is causing a corrupt db. I added both dcrd and dcrwallet to /etc/init.d and made them available as services. Is this something that might cause problems? Are you limiting the cpu and or memory for dcrd and dcrwallet? Also are you using raspberian or something else?
Oh, alright. Sure thing. I have the dcr utilities running on both a RPi2 and RPi3. I have always used the binary files and not the installer. The repo I always download from is here: https://github.com/decred/decred-binaries/releases/download/v1.0.8/decred-linux-arm-v1.0.8.tar.gz I unzip it and just move the executables (dcr* and promptpass) to my primary decred folder which is basically ~/decred. I haven't ever made the executables run as services. Are you doing that so you can run them in the background and maintain your shell access? If so, you might want to look into screen. If you're not familiar with it, it lets you create multiple terminals inside a single "session". I use a screen session called decred, and when I open up the screen session, I have access to multiple CLI's - one for dcrd, one for dcrwallet, and one for dcrctl. I don't change any of the cpu/memory settings either.
Corruption like this is seen rarely and it usually indicates some sort of hardware fault or possibly a power loss at an inopportune time. A tool to just drop the obviously corrupt parts could still leave undetected corruption behind which is why such a tool doesn't exist. BTW, the Pi was notorious for a long time for corrupting SD/uSD cards. Some fixes were made in the firmware so check that you've updated recently. I know some uSD/SD card manufacturers seem to be more susceptible than others. You may want to try a different uSD card if this is a persistent issue.
I am seeing this as well happen quite a bit with a new SD card. Basically every time the device shuts down. Would it not be an idea to add an option to dcrd to delete all database files and start over in case of corruption?