Problem connection to garage in docker #507

Closed
opened 2023-02-17 07:30:14 +00:00 by moanos · 1 comment

Hi I have the following problem:

Problem

I start garage in docker with the following command

docker run --name=garage --log-driver=none --network host -v /garage/garage/config/garage.toml:/etc/garage.toml  -v /garage/garage/meta:/var/lib/garage/meta -v /garage/garage/data:/var/lib/garage/data --security-opt seccomp=unconfined docker.io/dxflrs/garage:v0.8.1

I then try to check the status wit

root@raspberrypi:/garage/garage# garage -c /garage/garage/config/garage.toml 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 public key.
Handshake error: i/o: unexpected end of file

So I use the same configuration file - but it does not work.

Debugging I did

On the other hand when I start garage without docker (root@raspberrypi:/garage/garage/config# garage -c garage.toml server) I can connect to garage without a problem. This leads me to belive it is a problem connected to docker.

I also tried to specify rpc_secret and rpc_host explicitly but there was the same error

Context

Here is my configuration

root@raspberrypi:/garage/garage/config# cat garage.toml
metadata_dir = "/tmp/meta"
data_dir = "/tmp/data"
db_engine = "lmdb"

replication_mode = "none"

rpc_bind_addr = "[::]:3901"
rpc_public_addr = "127.0.0.1:3901"
rpc_secret = "secret"

[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = "s3.localhost"

[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.localhost"
index = "index.html"

[k2v_api]
api_bind_addr = "[::]:3904"

[admin]
api_bind_addr = "0.0.0.0:3903"
admin_token = "secret"
Hi I have the following problem: ## Problem I start garage in docker with the following command ``` docker run --name=garage --log-driver=none --network host -v /garage/garage/config/garage.toml:/etc/garage.toml -v /garage/garage/meta:/var/lib/garage/meta -v /garage/garage/data:/var/lib/garage/data --security-opt seccomp=unconfined docker.io/dxflrs/garage:v0.8.1 ``` I then try to check the status wit ``` root@raspberrypi:/garage/garage# garage -c /garage/garage/config/garage.toml 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 public key. Handshake error: i/o: unexpected end of file ``` So I use the same configuration file - but it does not work. ## Debugging I did On the other hand when I start garage without docker (`root@raspberrypi:/garage/garage/config# garage -c garage.toml server`) I can connect to garage without a problem. This leads me to belive it is a problem connected to docker. I also tried to specify rpc_secret and rpc_host explicitly but there was the same error ## Context Here is my configuration ``` root@raspberrypi:/garage/garage/config# cat garage.toml metadata_dir = "/tmp/meta" data_dir = "/tmp/data" db_engine = "lmdb" replication_mode = "none" rpc_bind_addr = "[::]:3901" rpc_public_addr = "127.0.0.1:3901" rpc_secret = "secret" [s3_api] s3_region = "garage" api_bind_addr = "[::]:3900" root_domain = "s3.localhost" [s3_web] bind_addr = "[::]:3902" root_domain = ".web.localhost" index = "index.html" [k2v_api] api_bind_addr = "[::]:3904" [admin] api_bind_addr = "0.0.0.0:3903" admin_token = "secret" ```
Author

So apperantly I made a mistake with the rpc_host. After getting the node info with

docker exec -it garage /garage node id
5bedd5502notthereal8e7ba87261fa33de75@127.0.0.1:3901

I could connect to it with the binary with

garage garage --rpc-host 5bedd5502notthereal8e7ba87261fa33de75@127.0.0.1:3901 --rpc-secret verysecret status
So apperantly I made a mistake with the rpc_host. After getting the node info with ``` docker exec -it garage /garage node id 5bedd5502notthereal8e7ba87261fa33de75@127.0.0.1:3901 ``` I could connect to it with the binary with ``` garage garage --rpc-host 5bedd5502notthereal8e7ba87261fa33de75@127.0.0.1:3901 --rpc-secret verysecret status ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#507
No description provided.