Private network does't work on production environment
estevao
PROOP

a year 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.

0 Replies

brody
EMPLOYEE

a year 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?


brody
EMPLOYEE

a year ago

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


estevao
PROOP

a year ago

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


estevao
PROOP

a year 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

a year 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

a year ago

1251191375118995700


estevao
PROOP

a year ago

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

1251191497404186600


brody
EMPLOYEE

a year ago

okay that does look fine to me


brody
EMPLOYEE

a year ago

what is the specific error you are getting?


estevao
PROOP

a year 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


brody
EMPLOYEE

a year ago

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


estevao
PROOP

a year ago

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

1251193970239869200


brody
EMPLOYEE

a year ago

wow, how did you even do that


brody
EMPLOYEE

a year ago

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


estevao
PROOP

a year ago

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


estevao
PROOP

a year ago


brody
EMPLOYEE

a year ago

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


estevao
PROOP

a year ago

Nice solution!

1251195394772435108


estevao
PROOP

a year 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.


brody
EMPLOYEE

a year ago

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


estevao
PROOP

a year 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

a year ago

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


brody
EMPLOYEE

a year ago

its still an alpine based image though, hmmm


brody
EMPLOYEE

a year ago

either way, glad you where able to solve!


Loading...