Private network does't work on production environment
estevao
PROOP

2 years ago

Hi! On this project (f1e022d8-5efa-4e96-b14d-8f809949e983) I noticed that on production environment I am using the public proxy to connect my Wordpress site to MySQL. I have a copy of this environment I use for testing (staging) and the same change worked fine there.

As soon I tried to change the config on production to use the private network, I got the Database connection error and it just didn't work. It didn't normalize at all after waiting some time.

How can I make this work? Not sure if it helps, but one difference I see is that my production environment uses viaduct proxy instead of monorail like on staging.

Sorry for the dupe on help.railway.app, but I need some help as my Network Egress is wrecking my bill.

24 Replies

2 years ago

viaduct / monorail and any other subdomain for the TCP proxy don't mean anything, it all points to the same thing in the end.

How have you configured wordpress to connect to the database via the private network?


2 years ago

also, are you okay if I delete the post on the help station? discord is far easier to give support over


estevao
PROOP

2 years ago

Sure, go ahead! Let me check the settings here.


estevao
PROOP

2 years ago

Brody, I checked here and the configuration is injected during build time. I have this on my Dockerfile:

ENV WORDPRESSDBHOST=$MYSQLHOST:$MYSQLPORT
ENV WORDPRESSDBNAME=$MYSQLDATABASE
ENV WORDPRESSDBUSER=$MYSQLUSER
ENV WORDPRESSDBPASSWORD=$MYSQLPASSWORD
ENV WORDPRESSTABLEPREFIX="RW_"


estevao
PROOP

2 years ago

So, when I changed the config, I changed MYSQLHOST, MYSQLPORT and MYSQL_URL.

(which I just saw it seems it is not used at all)


estevao
PROOP

2 years ago

1251191375118995700


estevao
PROOP

2 years ago

I performed the same change on another env, which worked fine.

1251191497404186600


2 years ago

okay that does look fine to me


2 years ago

what is the specific error you are getting?


estevao
PROOP

2 years ago

This is the deploy log from the latest change I attempted. It keeps trying to connect to the db. If I revert back the env vars, it works.

1251192525767835600


2 years ago

okay that's helpful, what is the from image of your dockerfile


estevao
PROOP

2 years ago

Couldn't find a friendlier way of posting this text. Here is the full log of that build

1251193970239869200


2 years ago

wow, how did you even do that


2 years ago

in all my time helping users, I have never had someone send me logs like that


estevao
PROOP

2 years ago

https://cleanshot.cloud/
This app is pretty cool, allows you to scroll capture anywhere. 🙂


estevao
PROOP

2 years ago


2 years ago

well, discord on mobile makes it absolutely un-readable, so use this instead -


estevao
PROOP

2 years ago

Nice solution!

1251195394772435108


estevao
PROOP

2 years ago

Brody, just a sec, I replicated the issue on staging, I think it is some difference on the volume files. I will debug this now. This Wordpress setup is a mix of Dockerfile + volume data, kind of a nightmare to handle.


2 years ago

this isnt an issue with the volume, can you set a ENABLE_ALPINE_PRIVATE_NETWORKING=true service variable


estevao
PROOP

2 years ago

I got it working! This setup uses the wordpress Dockerfile, but on every deploy I update some files on the volume, where the Wordpress dir is actually hosted. There was a mismatch of the files on the staging volume comparing to production.


estevao
PROOP

2 years ago

Sorry, that was on my end. Rubber ducking with you helped, though. Really appreciate the help!


2 years ago

its still an alpine based image though, hmmm


2 years ago

either way, glad you where able to solve!


Loading...