Connection refused for layout show or status #886

Closed
opened 2024-10-09 23:37:30 +00:00 by williamdes · 1 comment

The Garage CLI reports an access denied.

rpc_bind_addr = "192.168.2.32:3901"
rpc_public_addr = "11.22.33.44:3901"

This is my current config, bind the private address and advertise the Freebox public IP that does NAT for me.

# garage status
Error: Unable to connect to destination RPC host. Check that you are using the same value of rpc_secret as them, and that you have their correct full-length node ID (public key).
IO error: Connection refused (os error 111)
# garage layout show
Error: Unable to connect to destination RPC host. Check that you are using the same value of rpc_secret as them, and that you have their correct full-length node ID (public key).
IO error: Connection refused (os error 111)

But if I run strace garage layout show
It reveals:

connect(9, {sa_family=AF_INET, sin_port=htons(3901), sin_addr=inet_addr("11.22.33.44")}, 16) = -1 EINPROGRESS (Operation now in progress)
epoll_ctl(5, EPOLL_CTL_ADD, 9, {events=EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, data={u32=3509827072, u64=94578689684992}}) = 0
futex(0x5604d1305ab0, FUTEX_WAIT_BITSET_PRIVATE, 0, NULL, FUTEX_BITSET_MATCH_ANY) = 0
getsockopt(9, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [4]) = 0

I conclude that the code should use the bind address and not the public address to get the status.
My freebox router does not know how to route packets to itself (it's own public IP).

The Garage CLI reports an access denied. ```toml rpc_bind_addr = "192.168.2.32:3901" rpc_public_addr = "11.22.33.44:3901" ``` This is my current config, bind the private address and advertise the Freebox public IP that does NAT for me. ```sh # garage status Error: Unable to connect to destination RPC host. Check that you are using the same value of rpc_secret as them, and that you have their correct full-length node ID (public key). IO error: Connection refused (os error 111) # garage layout show Error: Unable to connect to destination RPC host. Check that you are using the same value of rpc_secret as them, and that you have their correct full-length node ID (public key). IO error: Connection refused (os error 111) ``` But if I run `strace garage layout show` It reveals: ```sh connect(9, {sa_family=AF_INET, sin_port=htons(3901), sin_addr=inet_addr("11.22.33.44")}, 16) = -1 EINPROGRESS (Operation now in progress) epoll_ctl(5, EPOLL_CTL_ADD, 9, {events=EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, data={u32=3509827072, u64=94578689684992}}) = 0 futex(0x5604d1305ab0, FUTEX_WAIT_BITSET_PRIVATE, 0, NULL, FUTEX_BITSET_MATCH_ANY) = 0 getsockopt(9, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [4]) = 0 ``` I conclude that the code should use the bind address and not the public address to get the status. My freebox router does not know how to route packets to itself (it's own public IP).
Owner

In all cases, you must configure your network (including your router) so that connections to rpc_public_addr are directed to your Garage node, otherwise your Garage cluster will not work. The current behaviour is correct: rpc_bind_addr describes the address to bind for the listening socket (which can be 0.0.0.0 for all IP addresses); and rpc_public_addr describes the address other nodes and the CLI tool should use to connect to your node.

In all cases, you must configure your network (including your router) so that connections to `rpc_public_addr` are directed to your Garage node, otherwise your Garage cluster will not work. The current behaviour is correct: `rpc_bind_addr` describes the address to bind for the listening socket (which can be `0.0.0.0` for all IP addresses); and `rpc_public_addr` describes the address other nodes and the CLI tool should use to connect to your node.
lx closed this issue 2024-11-19 09:26:23 +00:00
lx was assigned by maximilien 2024-11-19 22:24:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#886
No description provided.