R
Railway•4w ago
Soulz

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:
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.
Jump to solution
19 Replies
Percy
Percy•4w ago
Project ID: f1e022d8-5efa-4e96-b14d-8f809949e983
Brody
Brody•4w 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? also, are you okay if I delete the post on the help station? discord is far easier to give support over
Soulz
Soulz•4w ago
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)
Soulz
Soulz•4w ago
No description
Soulz
Soulz•4w ago
I performed the same change on another env, which worked fine.
No description
Brody
Brody•4w ago
okay that does look fine to me what is the specific error you are getting?
Soulz
Soulz•4w 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.
No description
Brody
Brody•4w ago
okay that's helpful, what is the from image of your dockerfile
Soulz
Soulz•4w ago
Couldn't find a friendlier way of posting this text. Here is the full log of that build
No description
Brody
Brody•4w ago
wow, how did you even do that in all my time helping users, I have never had someone send me logs like that
Soulz
Soulz•4w ago
https://cleanshot.cloud/ This app is pretty cool, allows you to scroll capture anywhere. 🙂
Blazing-fast screenshot and screen recording sharing service for CleanShot X.
Soulz
Soulz•4w ago
CleanShot X for Mac
Capture your Mac’s screen like a pro.
Brody
Brody•4w ago
well, discord on mobile makes it absolutely un-readable, so use this instead - https://bookmarklets.up.railway.app/log-downloader/
Soulz
Soulz•4w ago
Soulz
Soulz•4w 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
Brody•4w ago
this isnt an issue with the volume, can you set a ENABLE_ALPINE_PRIVATE_NETWORKING=true service variable
Solution
Soulz
Soulz•4w 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.
Soulz
Soulz•4w ago
Sorry, that was on my end. Rubber ducking with you helped, though. Really appreciate the help!
Brody
Brody•4w ago
its still an alpine based image though, hmmm either way, glad you where able to solve!