Problem with Deploy Laravel app

aryeteincTRIAL

7 months ago

I have deployed a Laravel and Filamentphp 3 app but when deploying I get the following error

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for admin.railway.internal failed: Name or service not known (Connection: mysql, SQL: select table_name as name, (data_length + index_length) as size, table_comment as comment, engine as engine, table_collation as collation from information_schema.tables where table_schema = 'railway' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name), I have modified all the environment variables and put all the possible values ​​to solve it but I still can't connect to the DB I don't know how to solve it, has anyone been able to solve this error

here the log

You reached the start of the range → Oct 11, 2024 2:20 PM

Oct 11 14:21:20

#15 6.993 Clearing cached Blade icons .................................... 0.97ms DONE

Oct 11 14:21:20

#15 6.994

Oct 11 14:21:20

Oct 11 14:21:20

#15 7.286

Oct 11 14:21:20

#15 7.286 Illuminate\Database\QueryException

Oct 11 14:21:20

#15 7.286

Oct 11 14:21:20

#15 7.286 SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for admin.railway.internal failed: Name or service not known (Connection: mysql, SQL: select table_name as name, (data_length + index_length) as size, table_comment as comment, engine as engine, table_collation as collation from information_schema.tables where table_schema = 'railway' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name)

Oct 11 14:21:20

Oct 11 14:21:21

#15 7.286

Oct 11 14:21:21

#15 7.286 at vendor/laravel/framework/src/Illuminate/Database/Connection.php:825

Oct 11 14:21:21

#15 7.289 821▕ $this->getName(), $query, $this->prepareBindings($bindings), $e

Oct 11 14:21:21

#15 7.289 822▕ );

Oct 11 14:21:21

#15 7.289 823▕ }

Oct 11 14:21:21

#15 7.289 824▕

Oct 11 14:21:21

#15 7.289 ➜ 825▕ throw new QueryException(

Oct 11 14:21:21

#15 7.289 826▕ $this->getName(), $query, $this->prepareBindings($bindings), $e

Oct 11 14:21:21

#15 7.289 827▕ );

Oct 11 14:21:21

#15 7.289 828▕ }

Oct 11 14:21:21

#15 7.289 829▕ }

Oct 11 14:21:21

#15 7.289

Oct 11 14:21:21

#15 7.289 +41 vendor frames

Oct 11 14:21:21

#15 7.289

Oct 11 14:21:21

#15 7.290 42 artisan:13

Oct 11 14:21:21

#15 7.290 Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

Oct 11 14:21:21

#15 7.290

Oct 11 14:21:21

#15 ERROR: process "/bin/bash -ol pipefail -c composer install && npm install && npm run build && php artisan optimize && php artisan config:clear && php artisan config:cache && php artisan view:cache && php artisan storage:link && php artisan filament:optimize && php artisan filament:optimize-clear && php artisan migrate" did not complete successfully: exit code: 1

Oct 11 14:21:21

Oct 11 14:21:21

-----

Oct 11 14:21:21

> [11/12] RUN composer install && npm install && npm run build && php artisan optimize && php artisan config:clear && php artisan config:cache && php artisan view:cache && php artisan storage:link && php artisan filament:optimize && php artisan filament:optimize-clear && php artisan migrate:

Oct 11 14:21:21

7.289 826▕ $this->getName(), $query, $this->prepareBindings($bindings), $e

Oct 11 14:21:21

7.289 827▕ );

Oct 11 14:21:21

7.289 828▕ }

Oct 11 14:21:21

7.289 829▕ }

Oct 11 14:21:21

7.289

Oct 11 14:21:21

7.289 +41 vendor frames

Oct 11 14:21:21

7.289

Oct 11 14:21:21

7.290 42 artisan:13

Oct 11 14:21:21

7.290 Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

Oct 11 14:21:21

7.290

Oct 11 14:21:21

-----

Oct 11 14:21:21

Oct 11 14:21:21

Dockerfile:25

Oct 11 14:21:21

-------------------

Oct 11 14:21:21

23 | # build phase

Oct 11 14:21:21

24 | COPY . /app/.

Oct 11 14:21:21

25 | >>> RUN composer install && npm install && npm run build && php artisan optimize && php artisan config:clear && php artisan config:cache && php artisan view:cache && php artisan storage:link && php artisan filament:optimize && php artisan filament:optimize-clear && php artisan migrate

Oct 11 14:21:21

26 |

Oct 11 14:21:21

27 |

Oct 11 14:21:21

-------------------

Oct 11 14:21:21

ERROR: failed to solve: process "/bin/bash -ol pipefail -c composer install && npm install && npm run build && php artisan optimize && php artisan config:clear && php artisan config:cache && php artisan view:cache && php artisan storage:link && php artisan filament:optimize && php artisan filament:optimize-clear && php artisan migrate" did not complete successfully: exit code: 1

Oct 11 14:21:21

Oct 11 14:21:21

Error: Docker build failed

2 Replies

cal80HOBBY

3 months ago

Same problem here. Laravel can't reach mysql :(


jobayed112TRIAL

2 months ago

php artisan migrate --force problem

Attachments