env variables missing in cron job
-
Hello!
We've migrated our Snipe-IT installation to Cloudron. Everything seems to work fine, but following stack trace keeps coming into the
laravel.log.
It seems like the cron job does not resolve the environment variables from the/app/data/envfile.
Since we migrated Snipe-IT from another host (DB Dump + uploads directory + some settings in/app/data/env), I'm not sure if we broke something, or if this something happening to others too.
Have you seen this issue elsewhere already?[2026-09-12 20:46:00] production.ERROR: PDOException: PDO::connect(): php_network_getaddresses: getaddrinfo for ${CLOUDRON_MYSQL_HOST} failed: Name or service not known in /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:67 Stack trace: #0 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(67): PDO::connect() #1 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(85): Illuminate\Database\Connectors\Connector->createPdoConnection() #2 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(48): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection() #3 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection() #4 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(186): Illuminate\Database\Connectors\MySqlConnector->connect() #5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->{closure:Illuminate\Database\Connectors\ConnectionFactory::createPdoResolverWithHosts():181}() #6 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1257): call_user_func() #7 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(605): Illuminate\Database\Connection->getPdo() #8 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(827): Illuminate\Database\Connection->{closure:Illuminate\Database\Connection::affectingStatement():597}() #9 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(999): Illuminate\Database\Connection->runQueryCallback() #10 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(978): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() #11 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(796): Illuminate\Database\Connection->handleQueryException() #12 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(597): Illuminate\Database\Connection->run() #13 /app/code/vendor/laravel/framework/src/Illuminate/Database/Connection.php(561): Illuminate\Database\Connection->affectingStatement() #14 /app/code/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(4426): Illuminate\Database\Connection->delete() #15 /app/code/vendor/laravel/framework/src/Illuminate/Auth/Passwords/DatabaseTokenRepository.php(155): Illuminate\Database\Query\Builder->delete() #16 /app/code/vendor/laravel/framework/src/Illuminate/Auth/Console/ClearResetsCommand.php(32): Illuminate\Auth\Passwords\DatabaseTokenRepository->deleteExpired() #17 /app/code/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Auth\Console\ClearResetsCommand->handle() #18 /app/code/vendor/laravel/framework/src/Illuminate/Container/Util.php(43): Illuminate\Container\BoundMethod::{closure:Illuminate\Container\BoundMethod::call():35}() #19 /app/code/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(96): Illuminate\Container\Util::unwrapIfClosure() #20 /app/code/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod() #21 /app/code/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\Container\BoundMethod::call() #22 /app/code/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call() #23 /app/code/vendor/symfony/console/Command/Command.php(341): Illuminate\Console\Command->execute() #24 /app/code/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run() #25 /app/code/vendor/symfony/console/Application.php(1117): Illuminate\Console\Command->run() #26 /app/code/vendor/symfony/console/Application.php(356): Symfony\Component\Console\Application->doRunCommand() #27 /app/code/vendor/symfony/console/Application.php(195): Symfony\Component\Console\Application->doRun() #28 /app/code/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(198): Symfony\Component\Console\Application->run() #29 /app/code/artisan(33): Illuminate\Foundation\Console\Kernel->handle() #30 {main} -
I've now checked on a fresh install what the laravel.log will look like. Yesterday - after writing this post - i created a new and fresh Snipe-IT instance on my server. I've not made any changes or edits on that instance what so ever. Today I downloaded the laravel.log and it has the same errors as my original laravel.log.
I'm not allowed to upload the log file (no permissions to do so in this forum). So I pasted a shortened version in a public pastebin (will be removed in 1 month): https://pastes.io/k3q2pkIG
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login