Bitcoin Forum
December 05, 2016, 02:39:17 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: bitcoind not responding to RPC  (Read 3477 times)
mtgox
Full Member
***
Offline Offline

Activity: 185


View Profile WWW
July 23, 2010, 12:29:48 PM
 #1

Occasionally bitcoind will not respond to RPC I'm calling it from php and I get this error:

Warning: fopen(http://127.0.0.1:8332) [function.fopen]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error

It happens a lot locally on my windows machine and less frequently on my linux server.

Anyone else have this problem?

1480948757
Hero Member
*
Offline Offline

Posts: 1480948757

View Profile Personal Message (Offline)

Ignore
1480948757
Reply with quote  #2

1480948757
Report to moderator
1480948757
Hero Member
*
Offline Offline

Posts: 1480948757

View Profile Personal Message (Offline)

Ignore
1480948757
Reply with quote  #2

1480948757
Report to moderator
1480948757
Hero Member
*
Offline Offline

Posts: 1480948757

View Profile Personal Message (Offline)

Ignore
1480948757
Reply with quote  #2

1480948757
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
July 23, 2010, 04:23:16 PM
 #2

Try taking the "http://" out of your fsockopen(). The JSON-RPC server isn't really HTTP.

I've had the best luck with the curl+json php extensions, myself.

mtgox
Full Member
***
Offline Offline

Activity: 185


View Profile WWW
July 23, 2010, 04:25:59 PM
 #3

Well it works 95% of the time which is what is weird

The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
July 23, 2010, 04:39:00 PM
 #4

Strange. I use my bitcoind almost every day from PHP, and I haven't encountered that.
mtgox
Full Member
***
Offline Offline

Activity: 185


View Profile WWW
July 23, 2010, 04:47:36 PM
 #5

I also get it anytime I send an invalid bitcoin address. Which is weird since it doesn't seem like that would effect the connecting.

satoshi
Founder
Sr. Member
*
Offline Offline

Activity: 364


View Profile
July 23, 2010, 05:23:47 PM
 #6

If I recall correctly, 500 is the prescribed status code for JSON-RPC error responses.  There is still a JSON response in the body of the reply telling the explanation of the error, which could be something like {"result":"","error":"bitcoin address not found","id":"1"}.
mtgox
Full Member
***
Offline Offline

Activity: 185


View Profile WWW
July 23, 2010, 06:14:48 PM
 #7

Weird I guess fopen() in php dies if the response is 500?

It seems like errors such as invalid address should just be normal replies just not "sent" so we can just check the reply string. I think of 500 errors as the server itself having an error.

satoshi
Founder
Sr. Member
*
Offline Offline

Activity: 364


View Profile
July 24, 2010, 01:15:58 AM
 #8

Can anyone confirm if JSON-RPC over HTTP is supposed to use status 500 if the reply is an error reply?  I can't remember where I picked that up, maybe it's wrong.  It seems like 200 would make more sense unless there's something wrong with the mechanics of the HTTP request itself.  (and maybe that's what it said and I forgot and spread 500 to all error responses)
Coinbuck @ BTCLot
Hero Member
*****
Offline Offline

Activity: 541

The future begins today


View Profile WWW
June 24, 2011, 11:53:25 PM
 #9

I'm having the same issue, one year later ...

Windows 7 + Lastest bitcoin client

I'm using this: https://en.bitcoin.it/wiki/PHP_developer_intro

Bitcoin is the future !
Pages: [1]
  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!