Cannot connect to database URL
jaronoff97
HOBBYOP

2 years ago

I created a clickhouse database from a template, and i'm able to connect to it from one service successfully via private networking. From another elixir-based service when I use private networking it fails. When i use public networking, the service builds successfully but just says "Completed" upon deployment. I tried running my service locally with the public credentials over the secure port which is successful and it stays alive. Not sure why this is failing only when deployed on Railway.

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

16 Replies

2 years ago

The private network is not available during build unless you have the new builder enabled so make sure you enable that in the service settings.


jaronoff97
HOBBYOP

2 years ago

i had the new builder enabled and it still fails. Does this explain why it would say "completed" when using the public network?


windel
PRO

2 years ago

i too


2 years ago

The state of the deployment is not being correctly reflected, completed could mean active.


jaronoff97
HOBBYOP

2 years ago

I don't believe it's active though, because attempting to connect to the server resulted in this response:

⫸ curl -v https://<domain>.io
*   Trying 10.0.7.1:443...
* connect to 10.0.7.1 port 443 failed: Connection refused
* Failed to connect to airtunnel.io port 443 after 32 ms: Couldn't connect to server
* Closing connection
curl: (7) Failed to connect to airtunnel.io port 443 after 32 ms: Couldn't connect to server

2 years ago

Please make sure you are using the correct variables.


jaronoff97
HOBBYOP

2 years ago

the only difference between the deployments was my database URL which works external from railway (running the code from my laptop)
but not from inside railway.


2 years ago

10.0.7.1 is a local address.

Please provide errors you are getting when attempting to connect to the database via the private network from an app deployed to Railway.


jaronoff97
HOBBYOP

2 years ago

yes, this was connecting from my local machine to prove that the "completed" application was not active.

these were the build logs

No files changed in this command, skipping snapshotting.

Pushed us-west1.registry.rlwy.net/c2505f8e-e8b8-41a8-b06c-756705a997a0/cache@sha256:261bab9058408ac7d1f3bcb1623261e2b0e1da0ffc918c0919d65e5020076587

Pushing image to us-west1.registry.rlwy.net/c2505f8e-e8b8-41a8-b06c-756705a997a0:83c60400-a1b0-49d0-be55-a9571a0c6ad9

Pushed us-west1.registry.rlwy.net/c2505f8e-e8b8-41a8-b06c-756705a997a0@sha256:54cb7f62ff6d8cd644eb3373b6960dfd45a72ba2097b009d17c81002fcd8e799

container event container died

Stopping Container

these were the deploy logs

Starting Container

warning: the VM is running with native name encoding of latin1 which may cause Elixir to malfunction as it expects utf8. Please ensure your locale is set to UTF-8 (which can be verified by running "locale" in your shell)

Compiling 11 files (.ex)

Generated airtunnel app

03:26:28.757 [info] Running AirtunnelWeb.Endpoint with Bandit 1.5.2 at :::4000 (http)

03:26:28.821 [info] Access AirtunnelWeb.Endpoint at https://airtunnel.io

03:26:29.509 [info] CONNECTED TO AirtunnelWeb.CollectorSocket in 54µs

  Transport: :websocket

  Serializer: Airtunnel.Opamp.Serializer

  Parameters: %{}

JOINING

04:07:35.780 [error] Ch.Connection (#PID<0.595.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:35.780 [error] Ch.Connection (#PID<0.599.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:35.780 [error] Ch.Connection (#PID<0.597.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:35.780 [error] Ch.Connection (#PID<0.598.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:35.780 [error] Ch.Connection (#PID<0.593.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:35.780 [error] Ch.Connection (#PID<0.601.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:37.769 [error] Ch.Connection (#PID<0.595.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:37.769 [error] Ch.Connection (#PID<0.599.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:37.769 [error] Ch.Connection (#PID<0.597.0>) disconnected: ** (Mint.TransportError) socket closed

04:07:37.769 [error] Ch.Connection (#PID<0.601.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:03.792 [error] Ch.Connection (#PID<0.602.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:03.792 [error] Ch.Connection (#PID<0.597.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:03.792 [error] Ch.Connection (#PID<0.596.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:03.792 [error] Ch.Connection (#PID<0.595.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:03.792 [error] Ch.Connection (#PID<0.593.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:03.792 [error] Ch.Connection (#PID<0.600.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:03.792 [error] Ch.Connection (#PID<0.598.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:03.792 [error] Ch.Connection (#PID<0.594.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:09.792 [error] Ch.Connection (#PID<0.602.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:09.792 [error] Ch.Connection (#PID<0.593.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:09.792 [error] Ch.Connection (#PID<0.595.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:09.792 [error] Ch.Connection (#PID<0.594.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:09.792 [error] Ch.Connection (#PID<0.596.0>) disconnected: ** (Mint.TransportError) socket closed

04:12:09.792 [error] Ch.Connection (#PID<0.600.0>) disconnected: ** (Mint.TransportError) socket closed

jaronoff97
HOBBYOP

2 years ago

there were no logs from my application at the time of the request, which implied that the request never made it to the service as I have pretty broad debug logging rules right now


2 years ago

These logs do not provide enough information, socket to what closed??


jaronoff97
HOBBYOP

2 years ago

that would be to the database, that's not my log (it's from a dependency). Note that this after around 30 mins after the service came online which implies the database idled. I have a connection from app A to my server B which is sending data on a consistent 30s interval which should be writing data to the database. I believe that implies that app A couldn't connect to my server B which resulted in the database idling.


2 years ago

I'm sorry but I would need better error logging to be able to troubleshoot further.


jaronoff97
HOBBYOP

2 years ago

I don't have any more logs on my side unfortunately, i'm not sure what else I could provide. Is there any way to enable debug logging for railway? i.e. seeing like flow logs or something?


2 years ago

@jaronoff97 just to clarify, are you saying that your Clickhouse service is unreachable from inside Railway (in your service), but reachable over the public network?


jaronoff97
HOBBYOP

2 years ago

@rc I believe that's what I'm seeing yes. Though, I think there may be another issue with how traffic makes it to my service which is preventing it from being routed to. I can followup on discord if you'd like, as i'm pretty perplexed by this point :/


Loading...