<p>the error is caused by a connectivity problem, but we can't be sure of what is exactly causing the problem without you providing additional details, so I would start diagnosing the connectivity between the two hosts. Please post masked results.</p>
<p>Please check IP addresses, and make sure you have them correctly, run in each host. Please specify if both hosts belong to the same subnet or not and if possible your hosting provider (some may require a special routing setup or policies).:</p>
<pre><code>ip a
</code></pre>
<p>Please use IP numbers for the other tests below (instead of hostnames).</p>
<p>Please ping and tracert from each host to the other.</p>
<pre><code>ping other_host
sudo apt install traceroute
traceroute other_host
</code></pre>
<p>Check if ufw or iptables are running in each host:</p>
<pre><code>sudo ufw status numbered
service iptables status
</code></pre>
<p>Check if there's something running in the expected port:</p>
<pre><code>netstat -an |grep LISTEN |grep your_port_for_that_host
</code></pre>
<p>If there's connectivity (you've got ping replies), there's no firewall (at least in your hosts), and your ports are in LISTEN state, you should be able to connect. Otherwise we should start looking outside your hosts (i.e. a network firewall).</p>
<p>Please check that the host 1 port is reachable from host 2.
From host 1:</p>
<pre><code>nc -zv host_2_ip host_2_port
</code></pre>
<p>Depending on the results for the above tests, we can test further.</p>
<p>EDIT: After the first batch of tests, it seems that TCP connectivity to the node ports exists between the two hosts.</p>
<p>What instructions did you follow to install the nodes? are you using guild-operators scripts or any other? How do you start the node?</p>
<p>If using systemd, could you provide the output of the following command for both nodes?</p>
<pre><code>sudo systemctl -l --no-pager status cnode
</code></pre>
<p>Cheers,
Josep</p>

CC BY-SA 4.0
2022-07-27T19:36:47.713Z
There's connectivity (you've got ping replies), there's no firewall, my ports are in LISTEN state and `nc -zv host_2_ip host_2_port` succeeded in both servers. "should start looking outside your hosts (i.e. a network firewall)" we should roceed with this
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-27T21:31:07.140Z
What is the output of nc -zv? Why do you say it succeeds? if it does, you should see a message like "Connection to x.x.x.x x port [tcp/*] succeeded!". Please check in both directions. If it really succeeds, we should have a look at the nodes configuration.
Josep M Homs
CC BY-SA 4.0
2022-07-27T23:10:02.277Z
Yes, That exact message. I runned it in both directions.
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-28T15:40:55.120Z
Great Alberto, please provide the output of "sudo systemctl -l --no-pager status cnode" for both nodes.
Josep M Homs
CC BY-SA 4.0
2022-07-28T19:06:24.750Z
I have truly no idea why, but its working now. I haven't changed anything. When I run "netstat -tpan" I see the connection between the nodes. I will leave it working for some days before doing anything, I'll let you know.
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-28T19:21:54.953Z
Hey Alberto, I'm glad it is working now! Be aware that when you start the node and a database already exists, it can take some minutes, or hours if it's not in a clean state, to fully start the node and make the connections. Please be sure that you're able to stop/start the node and the system and that everything keeps working, and also get used to the time it takes each operation. Don't forget to mark the question as solved. Cheers!
Josep M Homs
CC BY-SA 4.0
2022-07-28T21:34:10.583Z
Are you getting connection errors in the node log files? When was the date/time of last connection error?
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-27T12:41:58.847Z
2022-07-28T15:36:29.977Z
2022-07-28T15:36:29.977Z
Josep M Homs
<p>I am setting up a stake pool on mainnet after practicing on testnet for a while, but I can't get over this issue. BP is supposed to connect to my relay only, but I get the following:</p>
<p>BP:</p>
<pre><code>[vmi92943:cardano.node.IpSubscription:Info:376] [2022-07-22 02:37:28.30 UTC] IPs: 0.0.0.0:0 [RelayIP:6000] Connection Attempt Start, destination RelayIP:6000
[vmi92943:cardano.node.IpSubscription:Error:376] [2022-07-22 02:37:31.36 UTC] IPs: 0.0.0.0:0 [RelayIP:6000] Connection Attempt Exception, destination RelayIP:6000 exception: Network.Socket.connect: &lt;socket: 131&gt;: does not exist (No route to host)
[vmi92943:cardano.node.ErrorPolicy:Notice:360] [2022-07-22 02:37:31.36 UTC] IP RelayIP:6000 ErrorPolicySuspendConsumer (Just (ConnectionExceptionTrace Network.Socket.connect: &lt;socket: 131&gt;: does not exist (No route to host))) 20s
[vmi92943:cardano.node.IpSubscription:Error:362] [2022-07-22 02:37:31.36 UTC] IPs: 0.0.0.0:0 [RelayIP:6000] Failed to start all required subscriptions

</code></pre>
<p>Relay:</p>
<pre><code>[vmi92943:cardano.node.IpSubscription:Info:428] [2022-07-22 02:40:52.25 UTC] IPs: 0.0.0.0:0 [BPIP:6000] Skipping peer BPIP:6000
[vmi92943:cardano.node.IpSubscription:Error:428] [2022-07-22 02:40:52.25 UTC] IPs: 0.0.0.0:0 [BPIP:6000] Failed to start all required subscriptions
[vmi92943:cardano.node.IpSubscription:Info:428] [2022-07-22 02:40:53.25 UTC] IPs: 0.0.0.0:0 [BPIP:6000] Restarting Subscription after 1.004306329s desired valency 1 current valency 0

</code></pre>
<p>My topology seems to be fine:</p>
<p>BP:</p>
<pre><code>{
  &quot;Producers&quot;: [
    {
      &quot;addr&quot;: &quot;Relay ip&quot;,
      &quot;port&quot;: 6000,
      &quot;valency&quot;: 1
    }
  ]
}

</code></pre>
<p>Relay:</p>
<pre><code> {
    &quot;Producers&quot;: [
      {
        &quot;addr&quot;: &quot;BP ip&quot;,
        &quot;port&quot;: 6000,
        &quot;valency&quot;: 1
      },
      {
        &quot;addr&quot;: &quot;relays-new.cardano-mainnet.iohk.io&quot;,
        &quot;port&quot;: 3001,
        &quot;valency&quot;: 2
      }
    ]
  }
</code></pre>
<p>Currently I have no firewall on both systems.</p>
<p>I can't figure out the source of this issue. Thanks in advance for your help.</p>

CC BY-SA 4.0
2022-07-22T04:46:07.233Z
Starting with the obvious, can you confirm that each node server can ping the other, and that each node is running on the expected port number. Then try `netstat -tpan` to see IPs, ports and processes - everything look as expected there (for the cardano node process)? Port 6000 is often used by X Windows - do you need to change it?
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-22T14:57:33.040Z
The nodes are running on Ubuntu, still, I changed the ports of bp and relay to 3002 and 3001, I am getting the same error as before. I runned ` telnet relay/bp ip port` and I get `telnet: Unable to connect to remote host: No route to host` in both machines.
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-22T15:14:35.960Z
I checked my ports at https://www.yougetsignal.com/tools/open-ports/ and both nodes show as open.
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-23T02:55:09.360Z
Let's hit these nodes one at a time - on your relay node can you see connections from other nodes? Use `netstat -tpan` as mentioned earlier to see IP, port and process. You should have other nodes connecting in and you will see their IP for the cardano-node process.
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-23T03:01:01.063Z
Also check your outbound firewall rules on each server to make sure it is not locked down for the IP+Port of the other server.
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-23T14:34:16.623Z
When running `sudo ufw status numbered` I get `Status: inactive` in both servers
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-24T00:38:22.927Z
That shows that `ufw` is not active/running - did you configure it fully or are you using some other firewall? Can you see other IPs connected to your relay server when using `netstat -tpan` - this is important to check so we get some idea about whether all connections are failing or only between your two servers.
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-24T18:07:14.680Z
My relay has an established connection with an iohk node, this connection shows correctly when running `netstat -tpan` I don't have any firewall running. I used `sudo ufw --force disable` at my very first steps in debugging this issue.
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-24T22:04:17.767Z
Ok that's good that you see a connection. Now check that the environment variable `CARDANO_NODE_SOCKET_PATH` is set correctly for the user/service that starts your nodes, and matches `--socket-path` in your start-up scripts. Use the absolute path to be sure. Do you start the nodes as a service or user script?
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-25T22:06:48.433Z
I start my nodes as a service. I just checked bashrc and my scripts and the path is correct.
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-26T01:19:21.227Z
Can you post your node `.service` file eg `/etc/systemd/system/cardano-node.service` so we can see more details (block IP/port as needed). It sounds like a path to socket mismatch, often due to use of `$HOME` to `~` so using the absolute path can help.
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-26T18:51:45.813Z
BP:
[Unit]
Description     = Cardano node service
Wants           = network-online.target
After           = network-online.target 

[Service]
User            = cardanobp
Type            = simple
WorkingDirectory= /home/cardanobp/node
ExecStart       = /bin/bash -c '/home/cardanobp/node/startBlockProducingNode.sh'
KillSignal=SIGINT
RestartKillSignal=SIGINT
TimeoutStopSec=300
LimitNOFILE=32768
Restart=always
RestartSec=5
SyslogIdentifier=cardano-node

[Install]
WantedBy= multi-user.target
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-26T18:52:38.973Z
Relay: 
[Unit]
Description     = Cardano node service
Wants           = network-online.target
After           = network-online.target 

[Service]
User            = cardanobp
Type            = simple
WorkingDirectory= /home/cardanobp/node
ExecStart       = /bin/bash -c '/home/cardanobp/node/startBlockProducingNode.sh'
KillSignal=SIGINT
RestartKillSignal=SIGINT
TimeoutStopSec=300
LimitNOFILE=32768
Restart=always
RestartSec=5
SyslogIdentifier=cardano-node

[Install]
WantedBy= multi-user.target
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-26T18:53:27.843Z
BP script: #!/bin/bash
DIRECTORY=/home/cardanobp/node
PORT=3002
HOSTADDR=0.0.0.0
TOPOLOGY=${DIRECTORY}/mainnet-topology.json
DB_PATH=${DIRECTORY}/db
SOCKET_PATH=${DIRECTORY}/db/socket
CONFIG=${DIRECTORY}/mainnet-config.json
/home/cardanobp/.local/bin/cardano-node run +RTS -N -A16m -qg -qb -RTS --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG}
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-26T18:53:58.350Z
Relay script:#!/bin/bash
DIRECTORY=/home/cardano/node
PORT=3001
HOSTADDR=0.0.0.0
TOPOLOGY=${DIRECTORY}/mainnet-topology.json
DB_PATH=${DIRECTORY}/db
SOCKET_PATH=${DIRECTORY}/db/socket
CONFIG=${DIRECTORY}/mainnet-config.json
/home/cardano/.local/bin/cardano-node run +RTS -N -A16m -qg -qb -RTS --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG}
Alberto Osorio Muñoz
CC BY-SA 4.0
2022-07-27T03:27:40.840Z
A couple of things I noticed 1) Your relay service refs `cardanobp` (in 3 spots) but relay script refs `cardano` - was that a bad copy/paste? 2) Is your socket file named `$DIR/db/socket`? Most people use `$DIR/db/node.socket`, not that it matters as long as you are consistent when setting CARDANO_NODE_SOCKET_PATH
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-27T04:14:16.370Z
Also, check the iptables rules (eg `sudo iptables -S`) for your IPs and Ports. Start UFW and make sure the node/relay ports are accepting from all IPs ie from 'Anywhere' eg `sudo ufw status verbose` (you can lock down the inbound IP of your relay on the BP node later, so then only the relay can connect to your BP), and monitor all updated logs in /var/log.
MC_Brisbane - JUST Pool
CC BY-SA 4.0
2022-07-28T21:43:03.293Z
Create an answer and detail what you think was the likely fix, and accept that answer. This way other people can learn from your experience.
MC_Brisbane - JUST Pool
<cardano-node><stake-pool>
Error when connectiong BP node and Relay
# Error when connectiong BP node and Relay

(Asked by: username_0 on 2022-07-22)

I am setting up a stake pool on mainnet after practicing on testnet for a while, but I can't get over this issue. BP is supposed to connect to my relay only, but I get the following:
BP:
[vmi92943:cardano.node.IpSubscription:Info:376] [2022-07-22 02:37:28.30 UTC] IPs: 0.0.0.0:0 [RelayIP:6000] Connection Attempt Start, destination RelayIP:6000
[vmi92943:cardano.node.IpSubscription:Error:376] [2022-07-22 02:37:31.36 UTC] IPs: 0.0.0.0:0 [RelayIP:6000] Connection Attempt Exception, destination RelayIP:6000 exception: Network.Socket.connect: : does not exist (No route to host)
[vmi92943:cardano.node.ErrorPolicy:Notice:360] [2022-07-22 02:37:31.36 UTC] IP RelayIP:6000 ErrorPolicySuspendConsumer (Just (ConnectionExceptionTrace Network.Socket.connect: : does not exist (No route to host))) 20s
[vmi92943:cardano.node.IpSubscription:Error:362] [2022-07-22 02:37:31.36 UTC] IPs: 0.0.0.0:0 [RelayIP:6000] Failed to start all required subscriptions


Relay:
[vmi92943:cardano.node.IpSubscription:Info:428] [2022-07-22 02:40:52.25 UTC] IPs: 0.0.0.0:0 [BPIP:6000] Skipping peer BPIP:6000
[vmi92943:cardano.node.IpSubscription:Error:428] [2022-07-22 02:40:52.25 UTC] IPs: 0.0.0.0:0 [BPIP:6000] Failed to start all required subscriptions
[vmi92943:cardano.node.IpSubscription:Info:428] [2022-07-22 02:40:53.25 UTC] IPs: 0.0.0.0:0 [BPIP:6000] Restarting Subscription after 1.004306329s desired valency 1 current valency 0


My topology seems to be fine:
BP:
{
  "Producers": [
    {
      "addr": "Relay ip",
      "port": 6000,
      "valency": 1
    }
  ]
}


Relay:
 {
    "Producers": [
      {
        "addr": "BP ip",
        "port": 6000,
        "valency": 1
      },
      {
        "addr": "relays-new.cardano-mainnet.iohk.io",
        "port": 3001,
        "valency": 2
      }
    ]
  }

Currently I have no firewall on both systems.
I can't figure out the source of this issue. Thanks in advance for your help.

**Tags:** cardano-node, stake-pool
> **Comments:**
> **username_1**: Starting with the obvious, can you confirm that each node server can ping the other, and that each node is running on the expected port number. Then try `netstat -tpan` to see IPs, ports and processes - everything look as expected there (for the cardano node process)? Port 6000 is often used by X Windows - do you need to change it?  
> **username_0**: The nodes are running on Ubuntu, still, I changed the ports of bp and relay to 3002 and 3001, I am getting the same error as before. I runned ` telnet relay/bp ip port` and I get `telnet: Unable to connect to remote host: No route to host` in both machines.  
> **username_0**: I checked my ports at https://www.yougetsignal.com/tools/open-ports/ and both nodes show as open.  
> **username_1**: Let's hit these nodes one at a time - on your relay node can you see connections from other nodes? Use `netstat -tpan` as mentioned earlier to see IP, port and process. You should have other nodes connecting in and you will see their IP for the cardano-node process.  
> **username_1**: Also check your outbound firewall rules on each server to make sure it is not locked down for the IP+Port of the other server.  
> **username_0**: When running `sudo ufw status numbered` I get `Status: inactive` in both servers  
> **username_1**: That shows that `ufw` is not active/running - did you configure it fully or are you using some other firewall? Can you see other IPs connected to your relay server when using `netstat -tpan` - this is important to check so we get some idea about whether all connections are failing or only between your two servers.  
> **username_0**: My relay has an established connection with an iohk node, this connection shows correctly when running `netstat -tpan` I don't have any firewall running. I used `sudo ufw --force disable` at my very first steps in debugging this issue.  
> **username_1**: Ok that's good that you see a connection. Now check that the environment variable `CARDANO_NODE_SOCKET_PATH` is set correctly for the user/service that starts your nodes, and matches `--socket-path` in your start-up scripts. Use the absolute path to be sure. Do you start the nodes as a service or user script?  
> **username_0**: I start my nodes as a service. I just checked bashrc and my scripts and the path is correct.  
> **username_1**: Can you post your node `.service` file eg `/etc/systemd/system/cardano-node.service` so we can see more details (block IP/port as needed). It sounds like a path to socket mismatch, often due to use of `$HOME` to `~` so using the absolute path can help.  
> **username_0**: BP: [Unit] Description     = Cardano node service Wants           = network-online.target After           = network-online.target   [Service] User            = cardanobp Type            = simple WorkingDirectory= /home/cardanobp/node ExecStart       = /bin/bash -c '/home/cardanobp/node/startBlockProducingNode.sh' KillSignal=SIGINT RestartKillSignal=SIGINT TimeoutStopSec=300 LimitNOFILE=32768 Restart=always RestartSec=5 SyslogIdentifier=cardano-node  [Install] WantedBy= multi-user.target  
> **username_0**: Relay:  [Unit] Description     = Cardano node service Wants           = network-online.target After           = network-online.target   [Service] User            = cardanobp Type            = simple WorkingDirectory= /home/cardanobp/node ExecStart       = /bin/bash -c '/home/cardanobp/node/startBlockProducingNode.sh' KillSignal=SIGINT RestartKillSignal=SIGINT TimeoutStopSec=300 LimitNOFILE=32768 Restart=always RestartSec=5 SyslogIdentifier=cardano-node  [Install] WantedBy= multi-user.target  
> **username_0**: BP script: #!/bin/bash DIRECTORY=/home/cardanobp/node PORT=3002 HOSTADDR=0.0.0.0 TOPOLOGY=${DIRECTORY}/mainnet-topology.json DB_PATH=${DIRECTORY}/db SOCKET_PATH=${DIRECTORY}/db/socket CONFIG=${DIRECTORY}/mainnet-config.json /home/cardanobp/.local/bin/cardano-node run +RTS -N -A16m -qg -qb -RTS --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG}  
> **username_0**: Relay script:#!/bin/bash DIRECTORY=/home/cardano/node PORT=3001 HOSTADDR=0.0.0.0 TOPOLOGY=${DIRECTORY}/mainnet-topology.json DB_PATH=${DIRECTORY}/db SOCKET_PATH=${DIRECTORY}/db/socket CONFIG=${DIRECTORY}/mainnet-config.json /home/cardano/.local/bin/cardano-node run +RTS -N -A16m -qg -qb -RTS --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG}  
> **username_1**: A couple of things I noticed 1) Your relay service refs `cardanobp` (in 3 spots) but relay script refs `cardano` - was that a bad copy/paste? 2) Is your socket file named `$DIR/db/socket`? Most people use `$DIR/db/node.socket`, not that it matters as long as you are consistent when setting CARDANO_NODE_SOCKET_PATH  
> **username_1**: Also, check the iptables rules (eg `sudo iptables -S`) for your IPs and Ports. Start UFW and make sure the node/relay ports are accepting from all IPs ie from 'Anywhere' eg `sudo ufw status verbose` (you can lock down the inbound IP of your relay on the BP node later, so then only the relay can connect to your BP), and monitor all updated logs in /var/log.  
> **username_1**: Create an answer and detail what you think was the likely fix, and accept that answer. This way other people can learn from your experience.  

---

## 1 answers

### Answer by username_2 on 2022-07-27. Score: 1 | Accepted answer

the error is caused by a connectivity problem, but we can't be sure of what is exactly causing the problem without you providing additional details, so I would start diagnosing the connectivity between the two hosts. Please post masked results.
Please check IP addresses, and make sure you have them correctly, run in each host. Please specify if both hosts belong to the same subnet or not and if possible your hosting provider (some may require a special routing setup or policies).:
ip a

Please use IP numbers for the other tests below (instead of hostnames).
Please ping and tracert from each host to the other.
ping other_host
sudo apt install traceroute
traceroute other_host

Check if ufw or iptables are running in each host:
sudo ufw status numbered
service iptables status

Check if there's something running in the expected port:
netstat -an |grep LISTEN |grep your_port_for_that_host

If there's connectivity (you've got ping replies), there's no firewall (at least in your hosts), and your ports are in LISTEN state, you should be able to connect. Otherwise we should start looking outside your hosts (i.e. a network firewall).
Please check that the host 1 port is reachable from host 2.
From host 1:
nc -zv host_2_ip host_2_port

Depending on the results for the above tests, we can test further.
EDIT: After the first batch of tests, it seems that TCP connectivity to the node ports exists between the two hosts.
What instructions did you follow to install the nodes? are you using guild-operators scripts or any other? How do you start the node?
If using systemd, could you provide the output of the following command for both nodes?
sudo systemctl -l --no-pager status cnode

Cheers,
Josep

> **Comments:**
> **username_0**: There's connectivity (you've got ping replies), there's no firewall, my ports are in LISTEN state and `nc -zv host_2_ip host_2_port` succeeded in both servers. "should start looking outside your hosts (i.e. a network firewall)" we should roceed with this  
> **username_2**: What is the output of nc -zv? Why do you say it succeeds? if it does, you should see a message like "Connection to x.x.x.x x port [tcp/*] succeeded!". Please check in both directions. If it really succeeds, we should have a look at the nodes configuration.  
> **username_0**: Yes, That exact message. I runned it in both directions.  
> **username_2**: Great Alberto, please provide the output of "sudo systemctl -l --no-pager status cnode" for both nodes.  
> **username_0**: I have truly no idea why, but its working now. I haven't changed anything. When I run "netstat -tpan" I see the connection between the nodes. I will leave it working for some days before doing anything, I'll let you know.  
> **username_2**: Hey Alberto, I'm glad it is working now! Be aware that when you start the node and a database already exists, it can take some minutes, or hours if it's not in a clean state, to fully start the node and make the connections. Please be sure that you're able to stop/start the node and the system and that everything keeps working, and also get used to the time it takes each operation. Don't forget to mark the question as solved. Cheers!  
> **username_1**: Are you getting connection errors in the node log files? When was the date/time of last connection error?  

---

