Bitcoin Forum

Bitcoin => Armory => Topic started by: wachtwoord on June 17, 2017, 10:12:25 AM



Title: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 17, 2017, 10:12:25 AM
Hi, roughly 14 hours ago I upgraded to Armory 0.96 from an old version, deleted the databases from the datadir folder and started rebuilding the database.

By now armoryDB got to block file 106 (there are over 500 right?). At this pace it will take almost 3 days. Is there any way to speed it up? I ran with default settings (RAM mode 4 and it's using all 6 cores of my machine). I have 8 GB of RAM.

Thank you

Edit:

I run Windows 7 as the OS


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 17, 2017, 02:59:42 PM
I explicitly told you to use the testing builds.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 17, 2017, 04:04:36 PM
I explicitly told you to use the testing builds.

Sorry you did. After I started the process already though (I thought I removed this topic). Did you want me to kill the process and start over?

It's now at block #610, how many more are there?


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 17, 2017, 04:37:16 PM
I explicitly told you to use the testing builds.

Sorry you did. After I started the process already though (I thought I removed this topic). Did you want me to kill the process and start over?

It's now at block #610, how many more are there?

Another 300 or so. Kill the process and use the version I pointed you to.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 17, 2017, 05:01:28 PM
Ok, doing that now. All default settings? (so e.g. for RAM)

Edit:

And do I need to re-delete the database or can I keep the current state?


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 17, 2017, 06:50:47 PM
Ok, doing that now. All default settings? (so e.g. for RAM)

Yes

Quote
And do I need to re-delete the database or can I keep the current state?

No


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 17, 2017, 08:13:41 PM
It seemed to run pretty well, up until the moment it says it takes 4 seconds more for building databases. It's been hanging there for an hour now. There is no open command line window like last time to see what the progress is. Is it still continuing or did it hang here?  (I have the task manager running and I see the RAM usage of ArmoryDB is still slowly going up: about 2.55 GB).


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 17, 2017, 08:51:19 PM
Post your dbLog. If you want to see the command prompt, you'll have to start ArmoryDB from within a prompt.


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 12:20:47 AM
There is nothing in your log indicating an issue, just let it finish.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 11:00:20 AM
The process is a bit further (it passed build databases) but at least since 7 hours ago (maybe more it was in the am) it's been stuck on "scanning transaction history" 0% 4 months.

Anything I can do? Is it likely still going ok? Any idea how much more it should take? (I can't use my main computer).

Thanks :)


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 02:10:38 PM
It just changed to 1% (1.5 months). Is this really going to take 100 times longer? :( Can I run with lower RAM usage (maybe also CPU?) as the PC is completely unusable now. If I move the mouse it doesn't react for a few minutes.

Edit:

After a lot of waiting I managed to check the write time stamps of the logs. Dblog.txt has not been written to in 17 hours, armorycpplog.txt and armorylog.txt have not been written to in 16.5 hours.

Edit:

Over an hour later then my previous post and 2% 3 weeks now



Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 03:39:40 PM
What's the process CPU load? RAM load?


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 03:41:37 PM
Processor was low (a few percent) RAM of the system was changing between 95-99%. The Armorydb.exe process started at 3 GB and slowly bled down until 0.7 GB over time but the total system RAM stayed at 95-99% (I have 8 GB of RAM).

Anyway just now, windows gave me a popup asking me to close armorydb.exe to prevent information loss since the system was low on resources. I declined but it crashed slightly later anyway. Is 8GB of RAM not enough anymore to run Armory?


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 03:47:52 PM
For some reason you managed to get the mem leak bug. Shutdown Bitcoin Core and start the DB alone. What are your system specs btw?


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 03:55:04 PM
So only armorydb.exe (not armoryqt.exe)? With ArmoryDB.exe --datadir=LOCATION --satoshi-datadir=LOCATION

My specs:

AMD Phenom II X6 1055T Processor @ 2.80 GHz (6-core)
8 GB RAM
AMD Radeon HD6800 video card


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 04:11:16 PM
So only armorydb.exe (not armoryqt.exe)?

Yes


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 04:15:39 PM
So only armorydb.exe (not armoryqt.exe)?

Yes

Ok I'm running the bitcoin core client now to sync back up (15 hours behind) and then I'll try it and report back.

I have an alternative datadir and satoshi datadirr so I run it like:

ArmoryDB.exe --datadir=LOCATION --satoshi-datadir=LOCATION  ?

BTW:
I went into the settings (ArmorySettings.txt) and saw that a setting called: Wallet_MYWALLETNAME_BelongsTo is unset. Is that related in anyway?


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 05:35:39 PM
Quote
-INFO  - 18:51:13.306: (..\DatabaseBuilder.cpp:268) parsed block file #852

You are short like 5GB worth of block data.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 05:38:55 PM
Bitcoin core is fully synced. What can be wrong? Why is it not seeing the block data?


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 05:42:04 PM
Are you using a very old copy of the chain? How big are the first blkXXXXX.dat files in your blockchain data folder?


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 05:49:11 PM
I'm using Bitcoin core version 0.13.0.

The blkxxxxx.dat files under Bitcoin data dir /blocks are 127-128 MB except for blk00000, blk00001, blk00002 and blk00003 (which are 1.95GB, 1.95GB, 1.95GB and 1.53 GB respectively). The last blk file is indeed blk00852.data


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 05:52:03 PM
You have an old copy of the chain, that explains it. Just start Armory the regular way now, see how that goes.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 05:57:01 PM
You have an old copy of the chain, that explains it. Just start Armory the regular way now, see how that goes.

Okay, is having an old copy a problem? I always run a bit behind for security reasons (want to give it some time in the wild for bugs to be found). Version 0.13 is only 10 months old. Or is this because my blockchain is based on even older versions of Bitcoin and upgraded every time?

Meanwhile I started ArmoryQT by itself. I blazed passed the first steps (organizing chain, building database) and again is hanging my computer while scanning transaction history. Anything I can see or do?

Edit:

ArmoryDB memory usage is 3.6GB. Total memory usage is 93-99% ArmoryQT UI is hanging (like always, the little spinning banner is frozen)

Edit2:

Memory usage dropped to 1.4GB, 67% of total system memory usage.


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 06:13:12 PM
Okay, is having an old copy a problem? I always run a bit behind for security reasons (want to give it some time in the wild for bugs to be found). Version 0.13 is only 10 months old. Or is this because my blockchain is based on even older versions of Bitcoin and upgraded every time?

No that means you synced your chain with a super old version of Core and never had to nuke it since. Nothing wrong with that, but the size of the early block files is a tell.

Quote
Meanwhile I started ArmoryQT by itself. I blazed passed the first steps (organizing chain, building database) and again is hanging my computer while scanning transaction history. Anything I can see or do?

Edit:

ArmoryDB memory usage is 3.6GB. Total memory usage is 93-99% ArmoryQT UI is hanging (like always, the little spinning banner is frozen)

No this means your computer is so weak that you can 100% trigger this issue even on top of a completed build. I've got a VM gimped enough that I ran in the issue every other 5 scans now (I've never managed to reproduce the issue before), so I think I can get it under control. You'll have to wait for testing build with the fix or build it yourself once I push.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 06:17:29 PM
Ok, so if I leave it running like this it will never finish?

Does this also have something to do with the weird big that started all this? (The, non-existing (?) outgoing transaction that Armory showed with the associated lower balance)

When are you planning to release the testing build? (I have to travel in a few days).


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on June 18, 2017, 06:26:19 PM
Ok, so if I leave it running like this it will never finish?

Not when it triggers this issue.

Quote
Does this also have something to do with the weird big that started all this? (The, non-existing (?) outgoing transaction that Armory showed with the associated lower balance)


I don't know that they are related yet.

Quote
When are you planning to release the testing build? (I have to travel in a few days).

Once it's ready and tested. Can't tell you more.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on June 18, 2017, 06:34:00 PM
Ok thanks for all the help so far.

I found 2 more lines in my log that might help so I'm going to leave them here:

Code:
2017-06-18 19:53:30 (INFO) -- ArmoryQt.py:1890 - loadBlockchainIfNecessary
2017-06-18 19:53:30 (ERROR) -- ArmoryQt.py:1189 - 5 attempts to load blockchain failed.  Remove mempool.bin.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on July 06, 2017, 12:55:21 PM
Ok, I tried the latest #4 testing build last night until this morning. It ran for 12 hours and got to 4% (1.5 months left) and slowed my PC down to a very slow pace like before and was consuming most of the memory.

Does this mean the bug is still there or should I just let it run for >24 hours (or much more?)

BTW: I saw that the Armory installer is installing into "program files (x86)" folder by default while it's a 64 bit application. Is that correct?


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on July 06, 2017, 02:12:42 PM
Ok, I tried the latest #4 testing build last night until this morning. It ran for 12 hours and got to 4% (1.5 months left) and slowed my PC down to a very slow pace like before and was consuming most of the memory.

Does this mean the bug is still there or should I just let it run for >24 hours (or much more?)

At this point it's probably still failing. Delete dbLog.txt and your databases folder, then start from scratch and post the log.

Quote
BTW: I saw that the Armory installer is installing into "program files (x86)" folder by default while it's a 64 bit application. Is that correct?

Legacy from the older versions. I'll fix that one of these days. All versions I've put out are x64 indeed.


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on July 06, 2017, 08:54:21 PM
This is with 0.96.0.4?



Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on July 07, 2017, 02:42:32 PM
Are you building with --db-type==DB_BARE?


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on July 07, 2017, 04:22:11 PM
Are you building with --db-type==DB_BARE?

I didn't build it but downloaded the 0.96.0.4 release from github.

If you mean whether I'm starting Armory with --db-type==DB_BARE as a command line argument, no I'm not. Should I try that? Do I need to delete the database folder again?


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on July 07, 2017, 05:29:03 PM
Are you building with --db-type==DB_BARE?
Should I try that? Do I need to delete the database folder again?

Yes and yes.


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on July 08, 2017, 10:16:43 AM
Try with --ram-usage=1 --thread-count=3. No need to wipe the DB this time.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on July 08, 2017, 12:18:31 PM
Try with --ram-usage=1 --thread-count=3. No need to wipe the DB this time.

It shows this pop-up:

http://i68.tinypic.com/53weon.png

But dblog.txt doesn't show anything. In Armorylog.txt I found:

2017-07-08 14:11:50 (ERROR) -- ArmoryQt.py:1819 - Failed to start Armory database: cannot concatenate 'str' and 'int' objects
Traceback (most recent call last):
  File "ArmoryQt.py", line 1797, in startArmoryDBIfNecessary
  File "SDM.pyc", line 392, in spawnDB
TypeError: cannot concatenate 'str' and 'int' objects



Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on July 08, 2017, 12:25:19 PM
Start the DB manually. Ignore the client for now.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on July 08, 2017, 12:49:04 PM
That works but it's done quite fast:

Quote
Log file opened at 14:44:32.000: XXX\Armory/dbLog.txt
-INFO  - 14:44:32.000: (..\main.cpp:32) Running on 3 threads
-INFO  - 14:44:32.000: (..\main.cpp:33) Ram usage level: 1
-INFO  - 14:44:32.015: (..\BlockUtils.cpp:908) blkfile dir: XXX\Bitcoin/blocks
-INFO  - 14:44:32.015: (..\BlockUtils.cpp:909) lmdb dir: XXX\Armory/databases
-INFO  - 14:44:32.031: (..\lmdb_wrapper.cpp:388) Opening databases...
-INFO  - 14:44:32.124: (c:\users\goat\code\armory3\cppforswig\BDM_Server.h:249) Listening on port 9001
-INFO  - 14:44:34.215: (..\BlockUtils.cpp:1092) Executing: doInitialSyncOnLoad
-INFO  - 14:44:34.386: (..\DatabaseBuilder.cpp:190) Reading headers from db
-INFO  - 14:44:37.976: (..\DatabaseBuilder.cpp:229) Found 474938 headers in db
-INFO  - 14:44:40.127: (..\DatabaseBuilder.cpp:63) Rewinding 100 blocks
-INFO  - 14:44:40.127: (..\DatabaseBuilder.cpp:70) updating HEADERS db
-INFO  - 14:44:42.687: (..\DatabaseBuilder.cpp:272) parsed block file #873
-INFO  - 14:44:42.577: (..\DatabaseBuilder.cpp:482) Found next block after skipping 998141bytes
-INFO  - 14:44:43.201: (..\Blockchain.cpp:246) Organizing chain
-INFO  - 14:44:43.263: (..\Blockchain.cpp:360) Organized chain in 0.051s
-INFO  - 14:44:43.263: (..\DatabaseBuilder.cpp:75) updated HEADERS db in 3.139s
-INFO  - 14:44:43.279: (..\BDM_supportClasses.cpp:1873) Enabling zero-conf tracking

I ran it like: ArmoryDB.exe --datadir="XXX\Armory" --satoshi-datadir="XXX\Bitcoin" --db-type=DB_BARE --ram-usage=1 --thread-count=3

Next start the client?


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on July 08, 2017, 02:19:26 PM
Next start the client?

Yes.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on July 08, 2017, 04:34:05 PM
It works! Thanks so much for the help!  :)

I tried to look up what DB_BARE means and I think it means I'm still a fill node (through bitcoin core) and everything is validated fully but some hash information is not stored making it some searches from Armory less rich. Is that correct? Can I just keep running like this?

Considering the difficulty I had with getting this to run does that mean relatively soon I won't be able to run Armory online on this computer or shouldn't I worry about that?


Edit:

When I close the client I see the following errors in the log (and it takes a while to close the client meanwhile it's not responding). Is that all ok?

Code:
-INFO  - 18:30:41.689: (..\BlockchainScanner.cpp:665) scanned from height #474800 to #474816
-ERROR - 18:36:38.775: (c:\users\goat\code\armory3\cppforswig\DataObject.h:286) exhausted entries in Arguments object
-INFO  - 18:38:49.956: (..\BDM_Server.cpp:1103) unregistered bdv: 23a775c696bc38acaafa
-ERROR - 18:38:49.159: (c:\users\goat\code\armory3\cppforswig\DataObject.h:286) exhausted entries in Arguments object
-ERROR - 18:38:52.905: (..\SocketObject.cpp:290) POLLERR error in readFromSocketThread
-ERROR - 18:38:52.920: (..\BitcoinP2P.cpp:1027) caught SocketError exception in processDataStackThread: POLLERR error in readFromSocketThread
-INFO  - 18:38:52.983: (..\BitcoinP2P.cpp:969) Disconnected from Bitcoin node


Title: Re: Upgraded to 0.96 building database takes long
Post by: goatpig on July 08, 2017, 05:03:46 PM
I tried to look up what DB_BARE means and I think it means I'm still a fill node (through bitcoin core) and everything is validated fully but some hash information is not stored making it some searches from Armory less rich.

It means it does not maintain the dataset to resolve arbitrary tx hashes. On the GUI side that means you can't input tx nor fee of incoming transactions (people paying you). This is the state 0.94 was in.

Quote
Can I just keep running like this?

Well yes and no. You can keep on using this DB type but due to a mess up on my end, you have to specify the --db-type on each run. I fixed that issue but there's no build out with it yet. You're not supposed to be able to swap types once a DB is instantiated, but again, I messed up the check.

If you don't specify it, it will corrupt the DB on the next run. You can use armoryqt.conf to force that arg for now. Once the fix goes into the next build, you won't have to worry about the arg after bootstrapping.

Quote
Considering the difficulty I had with getting this to run does that mean relatively soon I won't be able to run Armory online on this computer or shouldn't I worry about that?

I can't tell. Clearly there is an issue that only exists with slow/old machines, since I never run into it, and all cases I can remember like yours are on old/weak machines. For now there seems to be a critical point at which a machine is too aged/weak and can't bootstrap the DB off of defaults. Until the point I figure out what's going on, you are stuck with using custom settings. What you ran is basically the fail safe setting.

I don't think the issue is related to block size but rather block load. Smaller blocks with lighter transactions (up around block #350k) are easy enough to parse. It's the recent stuff that's grinding some machines to a halt. Seeing you eventually got past it, I'm gonna guess your machine can keep on going.

Quote
When I close the client I see the following errors in the log (and it takes a while to close the client meanwhile it's not responding). Is that all ok?

False positives. A bunch of debug verbose I left there cause people on OSX are complaining about slow shutdowns. This helps me figure out what's going on. Ignore on anything but OSX.


Title: Re: Upgraded to 0.96 building database takes long
Post by: wachtwoord on July 08, 2017, 05:55:25 PM
All is clear thanks again :)