R
Railway5mo ago
bledar

Application sometimes is failing to connect with the DB

Since yesterday we are having a wired problem with our Laravel app since some of the request are failing due to db connection error: The error I am getting is php_network_getaddresses: getaddrinfo failed: Name does not resolve at . Php fails to resolve host address of the DB. This problems is not happening in every request but the majority of them are failing. The load of the DB and the app seems to be fine. I have also migrated a couple of days ago to the new DB system. ProjectID: 31a7f69c-e284-469d-bfac-e7c9ca208610
12 Replies
Percy
Percy5mo ago
Project ID: 31a7f69c-e284-469d-bfac-e7c9ca208610
Percy
Percy5mo ago
Project ID: 31a7f69c-e284-469d-bfac-e7c9ca208610
Brody
Brody5mo ago
is your app trying to connect to the database via the public or private url?
bledar
bledar5mo ago
I was trying to connect with public URL
Brody
Brody5mo ago
try the private url?
bledar
bledar5mo ago
I actually was referencing the MYSQLHOST in the env as ${{MySQL.MYSQLHOST}} and after seting this host url manually with referencing seems to fix the problem.
Brody
Brody5mo ago
${{MySQL.MYSQLHOST}} is correct
bledar
bledar5mo ago
I am not sure what was the problem but changing DB HOST to put the value as string fixed the problem in the app. The strange thing was that not all the request were not failing all the time. The same request sometimes was resolved with success sometime was rejected.
Brody
Brody5mo ago
hard coding database variables is never the solution
bledar
bledar5mo ago
You guys can investigate more if this is only my problem or is affecting others as well. ...but in my case is solving the problem. I will try to use again the referenced variable and hoping that will not cause problems again.
Brody
Brody5mo ago
yes but what solved it was something else, like the re-deploy caused by changing the variable
bledar
bledar5mo ago
I have tried to do re-deploy and restart but did not solve my problem
Want results from more Discord servers?
Add your server
More Posts
Static IPsWe are using an API that just notified us that they will be forcing us to make our calls from a whitDeployment StrategiesWhat are the deployment strategies available on railway, So that the API doesn't have at least 3-4 sCSRF Verification problemCan anyone tell me why CSRF verification is getting failed. I have included {% csrf_token %} in my phttps:// works but https://www. gives the "Not Secure" messagewhen accessing my website using www. i get the "Your connection is not private" message and the erroGunicorn failed to deploy after building (new to railway)Changed from api import app, db to many others like from . import app, db, not sure if this is the palready putting the forceScheme https but the payload form data is still being showedhi guys, does anyone know why is the payload show the token, username, and password on the network tInternal hosts don't work after region migrationIt seems that the internal hosts e.g. postgresql://postgres:xxx@postgres.railway.internal:5432/railwMigrating Postgres to v2 databases has gone horribly wrong. HelpI should mention that I'd already migrated another project with near enough exactly the same stack, Error to connect on databa service (Postgrees) from an api servicesI am getting an issue after the build on my backend(node) service on railway: (node:7) [DEP0040] DeAfter migrating to railway's new database, we are having an issueHello, we migrated to the new MYSQL database from the old MYSQL database. I was told we had until th