Bitcoin Forum
April 23, 2024, 10:04:54 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [SOLVED] Bitcoind RPC client freezes on "move" command.  (Read 2365 times)
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 13, 2012, 05:16:05 AM
Last edit: December 14, 2012, 02:52:56 PM by SlickTheNick
 #1

Hey guys, so I installed the bitcoind server on my VPS (latest version of ubuntu, 64 bit). For the most part it works fine, however when I try and use the 'move' command to move balances between accounts, it just hangs there and the server freezes and doesnt accept any more commands (besides the help command). Iv tried searching around a bunch, but I cant seem to find a solution, and most of the information I have found is for windows users..

Is this a common problem? any ideas for a easy way to solve this? Am I going to have to compile a custom build of bitcoin and reinstall it? If so, could anyone tell me how I would go about doing that (total noob to compiling things), or point me to a resource that would show me how?


now for part 2..

Im trying to use the jsonRPCClient for PHP to build a web app that uses bitcoin. Part of it requires moving balances between accounts.. hence the issue above. But also, whenever I try and use the sendaddress() call, all I get is a fatal error that states that the http request to the bitcoin server was refused..

Code:
Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to .... in jsonRPCClient.php

I tried the command directly from the command line, and recieved an error saying that due to the small size of the transaction it required a transaction fee (i forgot to change it from 0.000 btc).

Anyways, is it normal behavior for it to throw up the fatal error like that if a command returns false? Shouldnt it just return that the command failed, or return the error that bitcoin spits out, instead of just killing PHP? It doesnt seem to be very well documented..

thanks in advance


*edit* see my post on page 2 about how I solved this

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
1713866694
Hero Member
*
Offline Offline

Posts: 1713866694

View Profile Personal Message (Offline)

Ignore
1713866694
Reply with quote  #2

1713866694
Report to moderator
The block chain is the main innovation of Bitcoin. It is the first distributed timestamping system.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713866694
Hero Member
*
Offline Offline

Posts: 1713866694

View Profile Personal Message (Offline)

Ignore
1713866694
Reply with quote  #2

1713866694
Report to moderator
1713866694
Hero Member
*
Offline Offline

Posts: 1713866694

View Profile Personal Message (Offline)

Ignore
1713866694
Reply with quote  #2

1713866694
Report to moderator
jbis1
Newbie
*
Offline Offline

Activity: 50
Merit: 0



View Profile
December 13, 2012, 05:37:07 AM
 #2

I am not sure about the part one. For the second part, you should implement exception handling. You should have something like the following:

Code:
try {
    sendaddress();
} catch(Exception $e) {
    echo "There was an issue sending the bitcoins. Please try again or notify the site's administrator if you continue to receive this message.";
}

That will allow php to continue to execute the rest of the code. You should use a try...catch block whenever there is the possibility of an exception being raised.
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 13, 2012, 06:00:23 AM
 #3

The accounts are you trying to move do they have a lot of addresses? That is probably the issue.

Error means it can't connect so check your JSONRPC username and password, make sure you are server mode. Also I have seen a lot of people just set rpcssl to 1 without creating the correct key pairs so check that.

no, they are fairly new accounts. I have only like a dozen addresses or so.

Also pretty sure its not the user/pass, because I can use getbalance, getinfo, listaccounts, listtransactions, getnewaddress etc. just fine with PHP

also good point for the exception handling. Figuring all that stuff out now.

But still, not being able to use the move command has kind of put me at a stand still

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 13, 2012, 02:46:02 PM
 #4


Is your wallet encrypted cause then you need to unlock it then lock it again.

No, its not currently encrypted at all. Iv managed to use sendtoaddress straight from the command line and its worked fine, but when using the move command it just freezes up completely, forcing me to find the process and terminate it manually

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
December 13, 2012, 02:52:31 PM
 #5


Is your wallet encrypted cause then you need to unlock it then lock it again.

No, its not currently encrypted at all. Iv managed to use sendtoaddress straight from the command line and its worked fine, but when using the move command it just freezes up completely, forcing me to find the process and terminate it manually

Just trying to wrap my head around your issue here.

You say that issuing the following command freezes the daemon?

Code:
bitcoind move account2 account2 0.01

Can you give an example of account names you have? Note "" is default account and the ones that include a space like "bitcoin account" need to be quoted.

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 13, 2012, 03:15:51 PM
 #6


Is your wallet encrypted cause then you need to unlock it then lock it again.

No, its not currently encrypted at all. Iv managed to use sendtoaddress straight from the command line and its worked fine, but when using the move command it just freezes up completely, forcing me to find the process and terminate it manually

Just trying to wrap my head around your issue here.

You say that issuing the following command freezes the daemon?

Code:
bitcoind move account2 account2 0.01

Can you give an example of account names you have? Note "" is default account and the ones that include a space like "bitcoin account" need to be quoted.

heres the exact command that I ran from the terminal:

Code:
bitcoind move "derp - 0.4" "Main Account" 0.0016

on further searching, iv found that someone has had a issue with the move command locking up the server, and has made a build/patch of the bitcoind server... see here: https://github.com/sipa/bitcoin/tree/4291e8feab308cb9c7840d74fc7aacf137a7c21f

not sure if that will solve my problem, looks like I would have to build it from source... not really sure how to do that lol. the install file says to use these commands to build it:
Code:
cd src/
make -f makefile.unix

but when I try that it gives me all kinds of errors, like the following:
Code:
alert.cpp:198: error: âcs_mapAlertsâ was not declared in this scope
alert.cpp:198: error: initializer expression list treated as compound expression
alert.cpp:206: error: âclass CClientUIInterfaceâ has no member named âNotifyAlertChangedâ
alert.cpp:212: error: âclass CClientUIInterfaceâ has no member named âNotifyAlertChangedâ
alert.cpp:220: error: expected primary-expression before â&â token

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
December 13, 2012, 03:35:29 PM
 #7

...

heres the exact command that I ran from the terminal:

Code:
bitcoind move "derp - 0.4" "Main Account" 0.0016

...

Ok I understand, it should be like:

Code:
bitcoind move derp "Main Account" 0.0016

Accounts need to exist before moving amounts between them. Is "derp - 0.4" the exact name of the account? Issue a "bitcoind listaccounts" command and find out. I don't think your issue is that serious so you have to build from source.

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 13, 2012, 03:41:05 PM
 #8

yep, "derp - 0.4" is the exact name of the account and it has exactly 0.0016 BTC in it. Its a weird name for an account, I know. Dont ask :p

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
December 13, 2012, 03:58:05 PM
 #9

yep, "derp - 0.4" is the exact name of the account and it has exactly 0.0016 BTC in it. Its a weird name for an account, I know. Dont ask :p

Got it. I don't know exactly what is the issue you have, never experienced such a thing. I could say is the strange combination of characters in the account name but I could be wrong.

Can you try creating test1 and test2 accounts and move coins between them without the ""? Don't worry if they go negative atm.

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
pc
Sr. Member
****
Offline Offline

Activity: 253
Merit: 250


View Profile
December 13, 2012, 04:04:04 PM
 #10

Might it be the problem that's to-be-fixed in version 0.7.2?

Try out the release candidate and see if it works any better for you.
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
December 13, 2012, 04:11:09 PM
 #11

Might it be the problem that's to-be-fixed in version 0.7.2?

Try out the release candidate and see if it works any better for you.

I just saw the fix, nice find

Quote
Bug fixes
---------

* Prevent RPC 'move' from deadlocking. This was caused by trying to lock the
  database twice.

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 13, 2012, 11:09:58 PM
 #12

Might it be the problem that's to-be-fixed in version 0.7.2?

Try out the release candidate and see if it works any better for you.

I just saw the fix, nice find

Quote
Bug fixes
---------

* Prevent RPC 'move' from deadlocking. This was caused by trying to lock the
  database twice.

Awesome, thanks guys. Pretty sure this will work..

maybe I just have no idea what im doing, but I cant seem to get the server to work. According to the release candidate post, all I have to do is copy over the 'bitcoind' file. So i went to /usr/bin/bitcoin, copied the file over, gave the new file executable permissions (sudo chmod +x bitcoind)

now, when, heres what I get:
Code:
# sudo bitcoind
exec: 14: /usr/lib/bitcoin/bitcoind: not found

the file is there though, not sure what im missing here?

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 13, 2012, 11:37:53 PM
 #13

you have do
Code:
./usr/bin/bitcoin/bitcoind

It is cause you didn't alias it with bitcoind, and never run it in sudo either, security risk.

that seems to give me the same error.

Code:
# ./usr/bin/bitcoin/bitcoind
-bash: ./usr/bin/bitcoin/bitcoind: No such file or directory

but when I cd into the directory, the file is there..

Code:
# cd /usr/lib/bitcoin
# ls
bitcoind


Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
December 13, 2012, 11:58:56 PM
 #14

...

that seems to give me the same error.

Code:
# ./usr/bin/bitcoin/bitcoind
-bash: ./usr/bin/bitcoin/bitcoind: No such file or directory

but when I cd into the directory, the file is there..

Code:
# cd /usr/lib/bitcoin
# ls
bitcoind



Run...

Code:
./usr/lib/bitcoind &

if you have it in that folder Smiley

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 14, 2012, 12:06:55 AM
 #15

Run...

Code:
./usr/lib/bitcoind &

if you have it in that folder Smiley

hmm... this is confusing. I see the file in there. its named exactly the same. its set to be executable.. but still it keeps saying not found:

Code:
# ./usr/lib/bitcoin/bitcoind &
[1] 3016
-bash: ./usr/lib/bitcoin/bitcoind: No such file or directory


Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 14, 2012, 02:24:36 PM
 #16

So does anyone have any idea why when I run the 'bitcoind' command it keeps saying the file isnt found, even though I can CLEARLY see it exactly where it should be when I type in 'ls' or when I look at the server through a FTP program...?? doesnt make any sense at all

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
pc
Sr. Member
****
Offline Offline

Activity: 253
Merit: 250


View Profile
December 14, 2012, 02:39:18 PM
 #17

I'm no expert, but my guess is that it can't find a library it's expecting or something. That is, something trying to load the program is getting a "file not found", and somehow that's bubbling up to a confusing error message.
SlickTheNick (OP)
Full Member
***
Offline Offline

Activity: 220
Merit: 100


View Profile
December 14, 2012, 02:52:01 PM
 #18

So I finally figured it out! I backed up my wallet file, completely uninstalled bitcoind and figured out how to successfully compile bitcoin from source, using the 0.7.2rc2 build mentioned previously in the thread. Moved the file that it created into /usr/bin/bitcoind, and the server starts up again! Also tried using the move command, and it works flawlessly

Going to ahead and mark this as solved. Thanks for the help everyone!

Looking for a way to get some bitcoins for free? Check out http://earnfreebitcoins.com !
Get easy bitcoins at  https://coincontroller.com?r=eaef398b5 !
paraipan
In memoriam
Legendary
*
Offline Offline

Activity: 924
Merit: 1004


Firstbits: 1pirata


View Profile WWW
December 14, 2012, 08:28:50 PM
 #19

So I finally figured it out! I backed up my wallet file, completely uninstalled bitcoind and figured out how to successfully compile bitcoin from source, using the 0.7.2rc2 build mentioned previously in the thread. Moved the file that it created into /usr/bin/bitcoind, and the server starts up again! Also tried using the move command, and it works flawlessly

Going to ahead and mark this as solved. Thanks for the help everyone!

Nice to hear that  Smiley

BTCitcoin: An Idea Worth Saving - Q&A with bitcoins on rugatu.com - Check my rep
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!