Bitcoin Forum
May 22, 2019, 08:20:14 PM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [SOLVED] Bitcoind RPC client freezes on "move" command.  (Read 2266 times)
SlickTheNick
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 !
1558556414
Hero Member
*
Offline Offline

Posts: 1558556414

View Profile Personal Message (Offline)

Ignore
1558556414
Reply with quote  #2

1558556414
Report to moderator
1558556414
Hero Member
*
Offline Offline

Posts: 1558556414

View Profile Personal Message (Offline)

Ignore
1558556414
Reply with quote  #2

1558556414
Report to moderator
1558556414
Hero Member
*
Offline Offline

Posts: 1558556414

View Profile Personal Message (Offline)

Ignore
1558556414
Reply with quote  #2

1558556414
Report to moderator
PLAY OVER 3000 GAMES
LIGHTNING FAST WITHDRAWALS
PLAY NOW
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
gweedo
Legendary
*
Offline Offline

Activity: 1246
Merit: 1000


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
December 13, 2012, 05:28:51 AM
 #2

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.

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
jbis1
Newbie
*
Offline Offline

Activity: 50
Merit: 0



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

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.
gweedo
Legendary
*
Offline Offline

Activity: 1246
Merit: 1000


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
December 13, 2012, 05:40:27 AM
 #4

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.

A try and catch is only useful if you know that at some point the bitcoind could not be reachable, but otherwise all other bitcoind specific errors will be produced in JSON. That error is a JSONRPCClient exception not a bitcoind.

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
SlickTheNick
Full Member
***
Offline Offline

Activity: 220
Merit: 100


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

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 !
gweedo
Legendary
*
Offline Offline

Activity: 1246
Merit: 1000


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
December 13, 2012, 06:29:25 AM
 #6

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

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

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
SlickTheNick
Full Member
***
Offline Offline

Activity: 220
Merit: 100


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


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
Legendary
*
Offline Offline

Activity: 924
Merit: 1003


Firstbits: 1pirata


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


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
Full Member
***
Offline Offline

Activity: 220
Merit: 100


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


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
Legendary
*
Offline Offline

Activity: 924
Merit: 1003


Firstbits: 1pirata


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

...

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
Full Member
***
Offline Offline

Activity: 220
Merit: 100


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

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
Legendary
*
Offline Offline

Activity: 924
Merit: 1003


Firstbits: 1pirata


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

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
 #13

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
Legendary
*
Offline Offline

Activity: 924
Merit: 1003


Firstbits: 1pirata


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

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
Full Member
***
Offline Offline

Activity: 220
Merit: 100


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

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 !
gweedo
Legendary
*
Offline Offline

Activity: 1246
Merit: 1000


Java, PHP, HTML/CSS Programmer for Hire!


View Profile WWW
December 13, 2012, 11:25:27 PM
 #16

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.

Want to earn 2500 SATOSHIS per hour? Come Chat and Chill in https://goseemybits.com/lobby
SlickTheNick
Full Member
***
Offline Offline

Activity: 220
Merit: 100


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

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
Legendary
*
Offline Offline

Activity: 924
Merit: 1003


Firstbits: 1pirata


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

...

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
Full Member
***
Offline Offline

Activity: 220
Merit: 100


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

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
Full Member
***
Offline Offline

Activity: 220
Merit: 100


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

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 !
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!