internal network not accessible

nadilas
HOBBY

2 years ago

Using ENABLEALPINEPRIVATE_NETWORKING=true I managed to get past the no such host issue in my golang image.

Now when I try to access the minio service internally I face: cannot assign requested address:

time="2024-03-24T19:43:46Z" level=fatal msg="Get \"[http://bucket:9000/modules/?location=](http://bucket:9000/modules/?location=)": dial tcp: lookup bucket on [fd12::10]:53: dial udp [fd12::10]:53: connect: cannot assign requested address" op=storage

View Deploy

Solved

8 Replies


Status changed to Solved Railway • over 1 year ago


nadilas
HOBBY

2 years ago

I’m not sure this is the solution. The application retries connecting to the service every second. The container crashes after a minute. That should be enough time for the network to come up.


2 years ago

Railway restarting the container does not solve this, please try adding a 3-second delay to the start of your app.

Another thing to note is that the service you are trying to connect to needs to be in the same project.


nadilas
HOBBY

2 years ago

Adding it via the start command (sleep 3 && …) results in the container changing to "completed" state with no logs.
Adding it via the Dockerfile also doesn't help, because of the start command override.

The app is checking, as you can see over multiple seconds:

time="2024-03-25T19:15:03Z" level=info msg="Using S3 at bucket:9000"
time="2024-03-25T19:15:03Z" level=fatal msg="Get \"[http://bucket:9000/modules/?location=](http://bucket:9000/modules/?location=)": dial tcp: lookup bucket on [fd12::10]:53: dial udp [fd12::10]:53: connect: cannot assign requested address" op=storage

time="2024-03-25T19:15:04Z" level=info msg="Using S3 at bucket:9000"
time="2024-03-25T19:15:04Z" level=fatal msg="Get \"[http://bucket:9000/modules/?location=](http://bucket:9000/modules/?location=)": dial tcp: lookup bucket on [fd12::10]:53: dial udp [fd12::10]:53: connect: cannot assign requested address" op=storage

time="2024-03-25T19:15:05Z" level=info msg="Using S3 at bucket:9000"
time="2024-03-25T19:15:05Z" level=fatal msg="Get \"[http://bucket:9000/modules/?location=](http://bucket:9000/modules/?location=)": dial tcp: lookup bucket on [fd12::10]:53: dial udp [fd12::10]:53: connect: cannot assign requested address" op=storage

time="2024-03-25T19:15:07Z" level=info msg="Using S3 at bucket:9000"
time="2024-03-25T19:15:07Z" level=fatal msg="Get \"[http://bucket:9000/modules/?location=](http://bucket:9000/modules/?location=)": dial tcp: lookup bucket on [fd12::10]:53: dial udp [fd12::10]:53: connect: cannot assign requested address" op=storage


2 years ago

You are using a Dockerfile, thus the start command in the service settings overwrites the ENTRYPOINT in exec format meaning shell features like && don't work, you would need to wrap your start command in a shell - /bin/sh -c "sleep 3 && [start command]"


2 years ago

The app is checking, as you can see over multiple seconds

From my perspective, this looks like the container crashing and Railway restarting it, and as previously mentioned, this behaviour does not solve the issue.


2 years ago

Can you confirm the bucket service is located within the same project as the service that's trying to connect to it?


nadilas
HOBBY

2 years ago

Yes, I can confirm, bucket and the service are running in the same project.
Sorry for dragging this out, wrapping the start command in a shell worked perfectly. šŸ™