R
Railway•14mo ago
spicyyriice

Can't connect MySQL with my piwigo app on railway.app

I wanna deploy my Piwigo project my on railway.app and I did 2 instances An instance of MySQL An instance of my repo that contains only a Dockerfile Here's the link of the railway public project: https://railway.app/project/d2432f06-b0e2-44dc-8dea-bc07df66aea2 Here's the content of this Docker file Dockerfile: FROM alpine:3.10.3 LABEL maintainer="Moritz Heiber <hello@heiber.im>" ENV PIWIGO_VERSION="12.2.0" \ PIWIGO_CHECKSUM="824ee83f46654b68962263567f2957933d75b2bac016e6dbb9ea9df9a2a86e88" RUN set -x && apk --no-cache add curl php7 php7-gd php7-mysqli php7-json php7-session php7-exif && \ curl -Lo /tmp/piwigo.zip "http://piwigo.org/download/dlcounter.php?code=${PIWIGO_VERSION}" && \ echo "${PIWIGO_CHECKSUM} /tmp/piwigo.zip" | sha256sum -wsc - && \ adduser -h /piwigo -DS piwigo && \ unzip /tmp/piwigo.zip -d /piwigo && \ install -d -o piwigo /piwigo/piwigo/galleries /piwigo/piwigo/upload && \ chown -R piwigo /piwigo/piwigo/local && \ apk --no-cache del curl && \ rm /tmp/piwigo.zip WORKDIR /piwigo USER piwigo CMD ["php","-S","0.0.0.0:8000","-t","piwigo"] In the piwigo side, I tried to put all informations from the database and it gives me this an error saying Cannot connect to server How can fix this problem?
39 Replies
Percy
Percy•14mo ago
Project ID: d2432f06-b0e2-44dc-8dea-bc07df66aea2
Brody
Brody•14mo ago
you did not just publicly post your database credentials?? please go and regenerate the credentials in the database plugin's settings
spicyyriice
spicyyriice•14mo ago
Yes but I will delete the project after
Brody
Brody•14mo ago
show me a screenshot of your service variables please
spicyyriice
spicyyriice•14mo ago
Where can I find thos services variables?
spicyyriice
spicyyriice•14mo ago
Is it this?
Brody
Brody•14mo ago
start by clicking on the service that's the database plugin
spicyyriice
spicyyriice•14mo ago
spicyyriice
spicyyriice•14mo ago
I try to link those 2 services
Brody
Brody•14mo ago
yes that looks good to me
spicyyriice
spicyyriice•14mo ago
but is it how we are supposed to do?
Brody
Brody•14mo ago
full disclosure, I have absolutely no clue what piwigo is but is piwigo setup to use those specific environment variables?
spicyyriice
spicyyriice•14mo ago
Self hosted gallery Well I did locally with docker commands I can show you I did locally these commands on my pc and it works $ docker network create piwigo $ docker run -d --name piwigo_mysql --network piwigo -e MYSQL_USER=piwigo -e MYSQL_PASSWORD=piwigo -e MYSQL_DATABASE=piwigo -e MYSQL_RANDOM_ROOT_PASSWORD=true mysql:8.0.18 --default-authentication-plugin=mysql_native_password $ docker build -t piwigo-docker . $ docker run -d --name piwigo --network piwigo -p 8000:8000 piwigo-docker
spicyyriice
spicyyriice•14mo ago
With this dockerfile from this repo https://github.com/RichardLayhoutLao/gallery
GitHub
GitHub - RichardLayhoutLao/gallery
Contribute to RichardLayhoutLao/gallery development by creating an account on GitHub.
spicyyriice
spicyyriice•14mo ago
or I use docker-compose file, but railway doesnt support yet mildpanic
Brody
Brody•14mo ago
it looks like the variable names you normal give to piwigo don't match what you have setup in your railway service, you can change the names of the variables in the railway service to match what piwigo is setup to use
spicyyriice
spicyyriice•14mo ago
you mean the values of name, password from the MySQL ?
Brody
Brody•14mo ago
yeah
spicyyriice
spicyyriice•14mo ago
But how can I edit it?
Brody
Brody•14mo ago
just click the raw editor button and update the names according to what piwigo expects them to be named
spicyyriice
spicyyriice•14mo ago
So instead of those values, i should replace these by the values from mySQL
spicyyriice
spicyyriice•14mo ago
Brody
Brody•14mo ago
change the names of the variables don't touch the funky looking values or you will break stuff
spicyyriice
spicyyriice•14mo ago
Hmmm I changed the variables and still the same issue
spicyyriice
spicyyriice•14mo ago
spicyyriice
spicyyriice•14mo ago
I even hard coded
spicyyriice
spicyyriice•14mo ago
Brody
Brody•14mo ago
show me another screenshot of your service variables
spicyyriice
spicyyriice•14mo ago
Brody
Brody•14mo ago
are those the variable names piwigo expects?
spicyyriice
spicyyriice•14mo ago
Yes
Brody
Brody•14mo ago
show me the error message please
spicyyriice
spicyyriice•14mo ago
spicyyriice
spicyyriice•14mo ago
Cannot connect to server
Brody
Brody•14mo ago
1. you need to be using variable references. 2. what makes you think that those are the variable names piwigo uses?
spicyyriice
spicyyriice•14mo ago
Chatgpt told me that hahaha😅😅
Brody
Brody•14mo ago
I didn't think it needed to be said, but you can't take information an AI tells you at face value
spicyyriice
spicyyriice•14mo ago
I also base from docker files Some use MYSQL_SOMETHING I will see at home and tell you after Do you know when docker-compose will be available in railway.app?
Brody
Brody•14mo ago
no I do not
Want results from more Discord servers?
Add your server
More Posts
failed to calculate checksum of ref moby, docker error when building rust projecthi deployment fails for a Rust project of mine with the following error: ``` ERROR: failed to solvePostgres connection issue in production environment, can connect manually```django.db.utils.OperationalError: connection to server at "containers-****.railway.app" (IP), por(React with Vite) -> ReactRouter 404 Routing Error on Page reloadHi everybody! I hosted a react app on this platform and I'm getting 404 errors on page reloads. Goihow can I change the environment variable for my Railway project?I want to change environment variable for nocodb but can't figure out where I need to change that vaDeployment crashes with confusing TypeErrorSo, I have a piece of code that works flawlessly in my project. But the same piece of code in my newIs it possible to use Fonts?Hello, I have a Node.js server where I use the Sharp library to turn SVG's into other image formats.Datatype TIMEHello, I have a database postgresql in local and I have datatype time on columns. It works well. butNode graceful shutdownsI have a node task manager process deployed to Railway that I'm trying to get to gracefully shutdownAlpine.js button from standard Laravel Breeze package not working in prodThe weird thing is that it works perfectly locally. But in production https://manul-shop-productionIf a DJANGO process is failing because of the workersI do some maths in my django app on railway. It's complicated, and CPU bound. I have the current Dev