3 months ago
I am experiencing an issue with my n8n instance hosted on Railway.com. I have lost access to the n8n UI and am encountering a login error
("column User.apiKey does not exist").
Unfortunately, I did not export my workflows previously. Is there any way to recover my workflows directly from the backend on Railway.com, since I cannot access the n8n interface?
Specifically, I would like to know:
Is it possible to access workflow data directly from the PostgreSQL database or Redis instance linked to my Railway deployment?
If so, what are the steps to safely extract and export my workflows in a recoverable format (e.g., JSON)?
Are there any backup or recovery options available through Railway.com that could help me restore my workflows?
Any guidance you can provide on recovering my workflows in this situation would be greatly appreciated.
Thank you for your time and assistance.
6 Replies
3 months ago
These are mostly questions for n8n, not railway, but yes, you can recover the data.
Go to your postgres db -> settings -> networking -> create a TCP proxy pointed to port 5432
Then, go to the "data" tab. You will be able to view the contents of the database from there
Status changed to Awaiting User Response railway[bot] • 3 months ago
itsrems
These are mostly questions for n8n, not railway, but yes, you can recover the data.Go to your postgres db -> settings -> networking -> create a TCP proxy pointed to port 5432Then, go to the "data" tab. You will be able to view the contents of the database from there
3 months ago
I have this message in the screenshot, but when I check my variables they are correctly filled in.
Attachments
Status changed to Awaiting Railway Response railway[bot] • 3 months ago
itsrems
These are mostly questions for n8n, not railway, but yes, you can recover the data.Go to your postgres db -> settings -> networking -> create a TCP proxy pointed to port 5432Then, go to the "data" tab. You will be able to view the contents of the database from there
3 months ago
## DNS Resolution Failure in Railway Shell Preventing PostgreSQL Connection (Private Endpoints) - TCP Proxy Created, Data Tab Empty
Dear Railway.com Support Team,
I am encountering persistent issues connecting to my PostgreSQL database from the railway shell in my project. I have already gone through extensive troubleshooting steps and would greatly appreciate your assistance in resolving what appears to be a DNS resolution problem.
Initially, the environment variables $PGHOST and $PGPORT were empty within the railway shell, preventing any connection. Following previous support suggestions, I created a TCP Proxy for the PostgreSQL service. While this did help populate the $PGHOST and $PGPORT variables, as per your previous suggestion, I also checked the "Data" tab in my PostgreSQL service after creating the TCP Proxy, but I am still unable to visualize the database content there.
More recently, I switched the variables to utilize private endpoints, and $PGHOST and $PGPORT now return the correct private endpoint values:
echo "$PGHOST" returns: postgres.railway.internal
echo "$PGPORT" returns: 5432
However, the connection to the PostgreSQL database still fails. The error I receive when attempting to connect using psql "$DATABASE_URL" or psql -h "$PGHOST" -p "$PGPORT" -U "$POSTGRES_USER" -d "$POSTGRES_DB" is as follows:
psql: error: could not translate host name "postgres.railway.internal" to address: nodename nor servname provided, or not known
To investigate further, I executed the CRITICAL command ping postgres.railway.internal INSIDE the railway shell. The result of the ping was:
ping: cannot resolve postgres.railway.internal: Unknown host
This ping result confirms that the issue is a DNS RESOLUTION FAILURE for PRIVATE hostnames (like postgres.railway.internal) WITHIN my railway shell environment. It appears the railway shell is unable to resolve the IP address corresponding to the private hostname postgres.railway.internal.
The $RAILWAY_PRIVATE_DOMAIN variable is correctly configured and returns the expected value:
echo "$RAILWAY_PRIVATE_DOMAIN" returns: postgres.railway.internal
I'd like to request your assistance in resolving this DNS resolution issue, as it is also preventing me from visualizing my database content in the "Data" tab, even after creating the TCP Proxy as previously suggested.
Please find below my project and PostgreSQL service information to facilitate your investigation:
Project Name: n8n-railway
PostgreSQL Service ID: 153e57e9-7b45-49f4-b604-ce0c9fe06ece
Environment: Production
Thank you very much for your attention and help in resolving this DNS resolution problem as quickly as possible, and for any guidance on accessing my database content in the "Data" tab.
Sincerely,
Carlos Guimarães
3 months ago
You're trying to ping the railway internal network which only works for our services. You'd want to use the TCP proxy domain/port to connect to the database. If you want to access the internal railway network, you can look into setting up tailscale: https://docs.railway.com/tutorials/set-up-a-tailscale-subnet-router
Otherwise, ensure the variables for PGHOST and PGPORT are set to the tcp proxy.
Status changed to Awaiting User Response railway[bot] • 3 months ago
3 months ago
Hi Team,
Thank you for suggesting the Tailscale Subnet Router to access the PostgreSQL database and recover my n8n workflows.
I followed the instructions and the official "Tailscale Subnet Router" template from Railway.com, completing these steps:
Generated a Tailscale Auth Key.
Configured Split DNS in Tailscale as per documentation.
Deployed the "Tailscale Subnet Router" template in my project, inserting the Auth Key.
Attempted deployment with the default template "Source image": tailscale/tailscale:stable.
Due to failures, I tried changing the "Source image" to tailscale/tailscale:latest and tailscale/tailscale:v1.20.1.
In all attempts, the "Tailscale" service deployment failed with the persistent error: "This image does not have a tag."
No deployment logs are generated, only the message: "No deployment logs. All output sent to stdout will be displayed here".
This issue persists regardless of the Docker image tag used. I suspect the failure is on the Railway.com platform's side when attempting to pull the tailscale/tailscale image from Docker Hub.
Given the persistent error and lack of detailed logs, I await investigation from the Railway.com support team to identify and resolve this platform issue.
Sincerely,
Carlos Guimarães
Status changed to Awaiting Railway Response railway[bot] • 3 months ago
3 months ago
Hi, we're investigating an issue with image pulls in metal regions: https://status.railway.com/cm8fwtzac0018ksgsby0yuaz7
Status changed to Awaiting User Response railway[bot] • 3 months ago