Bitcoin Forum
May 17, 2024, 07:01:30 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Unable to connect using jsonRPCClient; .005btc bounty for a fix  (Read 1355 times)
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 08, 2014, 10:19:19 PM
Last edit: January 08, 2014, 11:55:30 PM by lmfsthefounder
 #1

I'm sure this is a thousand times old by now, but I just do not understand.

I am getting this error:

"Fatal error:  Uncaught exception 'Exception' with message 'Unable to connect to http://such:trust@66.227.203.224:41337/' in /home/content/61/11420661/html/massivetest/jsonRPCClient.php:140"

(Try it yourself at http://nobanchan.com/massivetest/index.php)

Here is my conf:

server=1
daemon=1
rpcuser=SOMEUSERNAME
rpcpassword=SOMEPASSWORD
rpcallowip=*
rpcport=41337
port=41338
addnode=37.187.93.104
addnode=23.253.71.20
addnode=94.242.254.73
addnode=24.20.187.178
addnode=37.59.31.34
addnode=37.59.54.28
addnode=62.212.72.31

Here is my php:

Code:
<?php require_once 'jsonRPCClient.php';
 
  
$btc= new jsonRPCClient('http://this too:thatone@66.227.203.224:41338/');
 
  echo 
"<pre>\n";
  
print_r($btc->getinfo());
  echo 
"</pre>";
  
  
?>

My ports are forwarded as tcp/ip in my router. WHAT am i doing wrong.

 .005btc bounty for a fix
BCB
CTG
VIP
Legendary
*
Offline Offline

Activity: 1078
Merit: 1002


BCJ


View Profile
January 08, 2014, 10:31:08 PM
 #2

have you opened those inbound ports on your ec2 security group?
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 08, 2014, 10:31:43 PM
 #3

I have NO idea what that is
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 08, 2014, 10:38:35 PM
 #4

further reading. this is hosted on my pc; there should be no other firewall here. windows firewall is on, but I even tested with it off.
GoldenWings91
Full Member
***
Offline Offline

Activity: 141
Merit: 100


View Profile
January 08, 2014, 10:42:35 PM
 #5

It says trying to connect to port 41338 it should be rpc port 41337

EDIT: It being your test site: http://nobanchan.com/massivetest/index.php

Support The Bitcoin Network By Running A Full Node
Node Stats     GPG Key-ID: 0x445DF2D8     Monetary Freedom Is A Basic Human Right
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 08, 2014, 10:48:37 PM
 #6

changed. still nothin :/
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 08, 2014, 11:05:03 PM
 #7

this is absolutely nuts that I can't get this to work
GoldenWings91
Full Member
***
Offline Offline

Activity: 141
Merit: 100


View Profile
January 08, 2014, 11:25:23 PM
 #8

I can confirm your client is configured correctly as I can make rpc calls to it.
Try using this curl variant http://pastebin.com/vREuHVr5, if it doesn't work then I'm out of ideas as to why it fails.


Support The Bitcoin Network By Running A Full Node
Node Stats     GPG Key-ID: 0x445DF2D8     Monetary Freedom Is A Basic Human Right
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 08, 2014, 11:35:03 PM
 #9

I can confirm your client is configured correctly as I can make rpc calls to it.
Try using this curl variant http://pastebin.com/vREuHVr5, if it doesn't work then I'm out of ideas as to why it fails.

Interesting; connected I think, but have a different error now
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 08, 2014, 11:53:53 PM
 #10

Yep here is new error:

Code:

Fatal error:  Uncaught exception 'Exception' with message 'Incorrect response id (request id: 1, response id: )' in /home/content/61/11420661/html/massivetest/jsonRPCClient.php:144
Stack trace:
#0 /home/content/61/11420661/html/massivetest/index.php(6): jsonRPCClient->__call('getinfo', Array)
#1 /home/content/61/11420661/html/massivetest/index.php(6): jsonRPCClient->getinfo()
#2 {main}
  thrown in /home/content/61/11420661/html/massivetest/jsonRPCClient.php on line 144


Now what? lol.
Its like it doesnt like my php request for getinfo?

looks like this:

Code:
<?php require_once 'jsonRPCClient.php';
 
  
$coinye = new jsonRPCClient('http://name:pass@66.227.203.224:41337/');
  
$btc = new jsonRPCClient('http://this:that@66.227.203.224:8332/');
  echo 
"<pre>\n";
  
print_r($coinye->getinfo());
  
//print_r($btc->getinfo());

  
echo "</pre>";
  
  
?>
GoldenWings91
Full Member
***
Offline Offline

Activity: 141
Merit: 100


View Profile
January 09, 2014, 12:04:32 AM
 #11

I had no issues connecting before now you changed something and I can't connect either.

Support The Bitcoin Network By Running A Full Node
Node Stats     GPG Key-ID: 0x445DF2D8     Monetary Freedom Is A Basic Human Right
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 09, 2014, 12:11:57 AM
 #12

I had no issues connecting before now you changed something and I can't connect either.

if you are trying with the passwords i have in the thread, they are the same as before. changed them on screen for security. The passwords are still there. Also, i had closed the client for a moment.

I am connected according to the php exception, just cannot get the data I want.
GoldenWings91
Full Member
***
Offline Offline

Activity: 141
Merit: 100


View Profile
January 09, 2014, 12:16:42 AM
 #13

Working for me

Quote
<pre>
Array
(
    [version] => 60400
    [protocolversion] => 60003
    [walletversion] => 60000
    [balance] => 32169.61913646
    [blocks] => 4210
    [connections] => 0
    [proxy] =>
    [difficulty] => 113.33792712
    [testnet] =>
    [keypoololdest] => 1389155877
    [keypoolsize] => 101
    [paytxfee] => 0
    [mininput] => 0.01
    [errors] =>
)
</pre>

Using this code and curl variant for json client
Code:
<?php require_once 'jsonRPCClient.php';
 
  
$btc= new jsonRPCClient('http://user:pass@66.227.203.224:41337/');
 
  echo 
"<pre>\n";
  
print_r($btc->getinfo());
  echo 
"</pre>";
  
?>

Support The Bitcoin Network By Running A Full Node
Node Stats     GPG Key-ID: 0x445DF2D8     Monetary Freedom Is A Basic Human Right
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 09, 2014, 12:27:30 AM
 #14

are you hosting the jsonRPCClient someplace else or something? because when I pull it from http://nobanchan.com/massivetest/index.php it absolultely does not show me what I want.


This is SO frustrating.  Huh Huh
amincd
Hero Member
*****
Offline Offline

Activity: 772
Merit: 501


View Profile
January 09, 2014, 01:13:32 AM
 #15

Have you restarted your bitcoind?
GoldenWings91
Full Member
***
Offline Offline

Activity: 141
Merit: 100


View Profile
January 09, 2014, 01:27:14 AM
 #16

From the client server type this with correct user name and password into a terminal ( assuming you're using linux )

Code:
curl http://user:pass@66.227.203.224:41337/

you should get this:
Code:
{"result":null,"error":{"code":-32700,"message":"Parse error"},"id":null}

Otherwise this:
Code:
curl: (7) couldn't connect to host
which would imply a connection issue, ( wrong user/pass, blocked port, etc )

Support The Bitcoin Network By Running A Full Node
Node Stats     GPG Key-ID: 0x445DF2D8     Monetary Freedom Is A Basic Human Right
lmfsthefounder (OP)
Full Member
***
Offline Offline

Activity: 182
Merit: 100



View Profile
January 09, 2014, 04:36:27 AM
 #17

CURL works, but still nothin from the php file
predictbits
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile WWW
January 09, 2014, 05:53:21 AM
 #18

Allow the client's IP in your firewall on your bitcoind server then in your bitcoind config, set your rpcallowip.
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
January 09, 2014, 06:28:20 AM
 #19

Yep here is new error:

Code:

Fatal error:  Uncaught exception 'Exception' with message 'Incorrect response id (request id: 1, response id: )' in /home/content/61/11420661/html/massivetest/jsonRPCClient.php:144
Stack trace:
#0 /home/content/61/11420661/html/massivetest/index.php(6): jsonRPCClient->__call('getinfo', Array)
#1 /home/content/61/11420661/html/massivetest/index.php(6): jsonRPCClient->getinfo()
#2 {main}
  thrown in /home/content/61/11420661/html/massivetest/jsonRPCClient.php on line 144


This error means that your username or password is incorrect. This is what you should do:

- Edit bitcoin.conf on the server and change the username and password to something that contains only letters and numbers. No special characters or spaces. You can make it really long if you like. Perhaps use openssl rand -hex 32 to get a random password.

- Try with the code below

Code:
<?php require_once 'jsonRPCClient.php';
$btc_username 'yourusername';
$btc_password 'yourpassword';
$btc_ip '66.227.203.224';
$btc_port 41337;

$coinye = new jsonRPCClient"http://$btc_username:$btc_password@$btc_ip:$btc_port/" ) ;

echo 
"<pre>\n";
print_r($coinye->getinfo());
echo 
"</pre>";

?>
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!