2 years ago
When trying to deploy I get this error:
SQLSTATE[HY000] [2002] phpnetworkgetaddresses: getaddrinfo for mysql failed: Name or service not known (Connection: mysql, SQL: select tablename as name, (datalength + indexlength) as size, tablecomment as comment, engine as engine, tablecollation as collation from informationschema.tables where tableschema = 'railway' and tabletype in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)
and:
ERROR: failed to solve: process "/bin/bash -ol pipefail -c composer install && php artisan optimize && php artisan config:cache && php artisan migrate --force" did not complete successfully: exit code: 1
The db service is created (using MySQL) and the .ENV file contains the db credentials provided by the db service.
This error happens when using this command in the .ENV file :
NIXPACKSBUILDCMD="composer install && php artisan optimize && php artisan config:cache && php artisan migrate --force"
If I remove the command, the deployment is successful but the migrations are not executed and db tables are not created
ⓘ Deployment information is only viewable by project members and Railway employees.
0 Replies