Bitcoin Forum
May 05, 2024, 05:02:48 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Remote end closed connection without response` error with bitcoinrpc.authproxy  (Read 85 times)
decent1984 (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 3


View Profile
August 03, 2021, 08:21:34 PM
 #1

Hi There,

I am using import bitcoinrpc.authproxy for regtest like below:

Code:
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:18444"%("bitcoin", "bitcoin"),timeout = 120)

Upon running the above code, I am getting the below http error:

Code:
 ~/Doc/code/pythonprojects  python -u "/Users/re/Documents/code/pythonprojects/mini_initial.py"
Traceback (most recent call last):
  File "/Users/re/Documents/code/pythonprojects/mini_initial.py", line 17, in <module>
    regTestChainSize = get_blockchain_size()
  File "/Users/re/Documents/code/pythonprojects/mini_initial.py", line 5, in get_blockchain_size
    iBlockSize = rpc_connection.getblockcount()
  File "/Users/re/Documents/code/pythonprojects/venv/lib/python3.9/site-packages/bitcoinrpc/authproxy.py", line 139, in __call__
    response = self._get_response()
  File "/Users/re/Documents/code/pythonprojects/venv/lib/python3.9/site-packages/bitcoinrpc/authproxy.py", line 179, in _get_response
    http_response = self.__conn.getresponse()
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1349, in getresponse
    response.begin()
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 316, in begin
    version, status, reason = self._read_status()
  File "/usr/local/Cellar/python@3.9/3.9.6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 285, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

We can see that there is a `Remote end closed connection without response` error, any idea what could be causing this connection issue on regtest?

Thanks
1714928568
Hero Member
*
Offline Offline

Posts: 1714928568

View Profile Personal Message (Offline)

Ignore
1714928568
Reply with quote  #2

1714928568
Report to moderator
You can see the statistics of your reports to moderators on the "Report to moderator" pages.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714928568
Hero Member
*
Offline Offline

Posts: 1714928568

View Profile Personal Message (Offline)

Ignore
1714928568
Reply with quote  #2

1714928568
Report to moderator
1714928568
Hero Member
*
Offline Offline

Posts: 1714928568

View Profile Personal Message (Offline)

Ignore
1714928568
Reply with quote  #2

1714928568
Report to moderator
1714928568
Hero Member
*
Offline Offline

Posts: 1714928568

View Profile Personal Message (Offline)

Ignore
1714928568
Reply with quote  #2

1714928568
Report to moderator
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5588


Self-proclaimed Genius


View Profile
August 04, 2021, 05:06:28 AM
 #2

I see that you have a reply to this thread: How to use regtest - the definitive guide
I followed the instructions in that thread and it worked at my end.
I used your command, changed the rpc user and password then added a command and it worked.

I tried to remove some of the config and it returned with the same error when both these lines are removed:
  • connect=127.0.0.1:18444
  • rpcport=18444

I can't reproduce it by other means.

Have you included the configs that should be added to the bitcoin.conf file?
take note that it should be in the default data directory and not in the custom datadir that you've set (if you set a different one).

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
August 04, 2021, 05:10:55 AM
Merited by ABCbits (1), nc50lc (1)
 #3

The default RPC port for regtest is 18443, but you are using 18444.

nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5588


Self-proclaimed Genius


View Profile
August 04, 2021, 05:35:02 AM
 #4

The default RPC port for regtest is 18443, but you are using 18444.
Ah, that explains the error when those lines are removed from the config.
He used the command in that linked thread that uses port 18444 but didn't followed the configuration to set the port to 18444.

@decent1984 you got two options to 'fix' it:
Change your code's port to default 18443; or keep it and set 18444 in the config file as instructed in the tutorial.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
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!