Private network does't work on production environment
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.Solution:Jump to solution
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.
19 Replies
Project ID:
f1e022d8-5efa-4e96-b14d-8f809949e983
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?
also, are you okay if I delete the post on the help station? discord is far easier to give support over
Sure, go ahead! Let me check the settings here.
Brody, I checked here and the configuration is injected during build time. I have this on my Dockerfile:
ENV WORDPRESS_DB_HOST=$MYSQLHOST:$MYSQLPORT
ENV WORDPRESS_DB_NAME=$MYSQLDATABASE
ENV WORDPRESS_DB_USER=$MYSQLUSER
ENV WORDPRESS_DB_PASSWORD=$MYSQLPASSWORD
ENV WORDPRESS_TABLEPREFIX="RW"
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)
I performed the same change on another env, which worked fine.
okay that does look fine to me
what is the specific error you are getting?
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.
okay that's helpful, what is the from image of your dockerfile
Couldn't find a friendlier way of posting this text. Here is the full log of that build
wow, how did you even do that
in all my time helping users, I have never had someone send me logs like that
https://cleanshot.cloud/
This app is pretty cool, allows you to scroll capture anywhere. 🙂
oops, https://cleanshot.com/
CleanShot X for Mac
Capture your Mac’s screen like a pro.
well, discord on mobile makes it absolutely un-readable, so use this instead - https://bookmarklets.up.railway.app/log-downloader/
Nice solution!
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.
this isnt an issue with the volume, can you set a
ENABLE_ALPINE_PRIVATE_NETWORKING=true
service variableSolution
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.
Sorry, that was on my end. Rubber ducking with you helped, though. Really appreciate the help!
its still an alpine based image though, hmmm
either way, glad you where able to solve!