Bitcoin Forum
May 07, 2024, 04:39:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: RPC port 8332 not accessible after reboot  (Read 149 times)
nemomaximus (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 18


View Profile
April 03, 2022, 09:32:22 AM
Merited by ABCbits (1)
 #1

I have compiled and installed Bitcoin Core for the first time on Debian 11. Everything is up and running except that RPC port 8332 is not accessible after a reboot.

I get the following error running bitcoin-cli getblockcount:

error: timeout on transient error: Could not connect to the server 127.0.0.1:8332

If I then run systemctl restart bitcoind then everything works fine.

systemctl status bitcoind shows that it is up and running just fine after a reboot.

Look at this after the reboot:

Code:
netstat -nap | grep bitcoin | grep LISTEN

tcp 0 0 0.0.0.0:8333 0.0.0.0:* LISTEN 456/bitcoind
tcp 0 0 127.0.0.1:8334 0.0.0.0:* LISTEN 456/bitcoind
tcp6 0 0 ::1:8332 :::* LISTEN 456/bitcoind
tcp6 0 0 :::8333 :::* LISTEN 456/bitcoind

And then after systemctl restart bitcoind:

Code:
tcp 0 0 127.0.0.1:8332 0.0.0.0:* LISTEN 532/bitcoind
tcp 0 0 0.0.0.0:8333 0.0.0.0:* LISTEN 532/bitcoind
tcp 0 0 127.0.0.1:8334 0.0.0.0:* LISTEN 532/bitcoind
tcp6 0 0 ::1:8332 :::* LISTEN 532/bitcoind
tcp6 0 0 :::8333 :::* LISTEN 532/bitcoind
For some reason the 8332 port is not opened on reboot...

Any idea what will solve the problem?
1715099952
Hero Member
*
Offline Offline

Posts: 1715099952

View Profile Personal Message (Offline)

Ignore
1715099952
Reply with quote  #2

1715099952
Report to moderator
According to NIST and ECRYPT II, the cryptographic algorithms used in Bitcoin are expected to be strong until at least 2030. (After that, it will not be too difficult to transition to different algorithms.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5818


not your keys, not your coins!


View Profile WWW
April 03, 2022, 10:43:35 PM
 #2

Any idea what will solve the problem?

Can you share your bitcoind unit file (bitcoind.service file)? I only could think it's caused when bitcoind started. But if you don't mind ugly workaround, edit your crontab to restart the service shortly after boot.

Code:
@reboot sleep 30 && systemctl restart bitcoind
That's not very clean though. I would first ask OP to send their systemd service file and to have a look at the debug.log of Bitcoin Core; usually there's something useful in there.

I do suspect that it's something like missing a After=network.target or something like this.
For reference, I use:
Code:
[Unit]
Description=Bitcoin daemon
After=network.target

[Service]
ExecStart=/usr/local/bin/bitcoind -daemon -conf=/home/bitcoin/.bitcoin/bitcoin.conf

# Make sure the config directory is readable by the service user
PermissionsStartOnly=true

# Process management
####################

Type=forking
Restart=on-failure

# Directory creation and permissions
####################################

# Run as bitcoin:bitcoin
User=bitcoin
Group=users

# Hardening measures
####################

# Provide a private /tmp and /var/tmp.
PrivateTmp=true

# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full

# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true

# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true

# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true

[Install]
WantedBy=multi-user.target

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
nemomaximus (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 18


View Profile
April 07, 2022, 08:09:22 AM
Merited by ABCbits (1)
 #3

I basically use the the "/bitcoin/core/bitcoin/contrib/init/bitcoind.service" which I just slightly edit...

I was able to solve the problem by adding the following to the bitcoin.conf file:

Code:
rpcbind=0.0.0.0
rpcport=8332
rpcallowip=192.168.230.0/255.255.255.0
nemomaximus (OP)
Newbie
*
Offline Offline

Activity: 10
Merit: 18


View Profile
April 14, 2022, 08:21:22 AM
 #4

Yes, correct Smiley
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!