Servas icon indicating copy to clipboard operation
Servas copied to clipboard

500 Internal Server Error

Open raxororax opened this issue 11 months ago • 7 comments

docker run -d --name servas -p 8080:80 beromir/servas the docker is running but when i try to generate the key, I get error saying there is no .env file in /app/ docker exec -it servas /bin/sh touch .env apk add nano nano .env ADD Line: APP_KEY= *save and close exit docker exec -it servas php artisan key:generate –force docker exec -it servas php artisan config:cache docker restart servas

I open firefox and still get 500 Internal Server Error.

I tried installing with docker-compose with your docker folder .env and .yaml examples. Same result. Searching around, some people on unraid forums seem to be having the same issue. Thank you very much!

Edit: I'm on debian bookwork not some unraid deal. ty

raxororax avatar Apr 20 '25 13:04 raxororax

Hi, can you check the Laravel logs in /app/storage/logs/laravel.log?

beromir avatar Apr 20 '25 16:04 beromir

Here is the last bit. Above this it has more of me throwing stuff at the wall. Let me know you you want that for any reason. Thank you very much!

[2025-04-20 12:46:37] production.ERROR: No application encryption key has been specified. {"exception":"[object] (Illuminate\Encryption\MissingAppKeyException(code: 0): No application encryption key has been specified. at /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:79) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(320): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}() #1 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(77): tap() #2 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(60): Illuminate\Encryption\EncryptionServiceProvider->key() #3 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(32): Illuminate\Encryption\EncryptionServiceProvider->parseKey() #4 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(908): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}() #5 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build() #6 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(986): Illuminate\Container\Container->resolve() #7 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve() #8 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(971): Illuminate\Container\Container->make() #9 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(1066): Illuminate\Foundation\Application->make() #10 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(982): Illuminate\Container\Container->resolveClass() #11 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(943): Illuminate\Container\Container->resolveDependencies() #12 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build() #13 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(986): Illuminate\Container\Container->resolve() #14 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve() #15 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(971): Illuminate\Container\Container->make() #16 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(172): Illuminate\Foundation\Application->make() #17 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #18 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(805): Illuminate\Pipeline\Pipeline->then() #19 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\Routing\Router->runRouteWithinStack() #20 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\Routing\Router->runRoute() #21 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\Routing\Router->dispatchToRoute() #22 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\Routing\Router->dispatch() #23 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}() #24 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #25 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() #26 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle() #27 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #28 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() #29 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\TrimStrings->handle() #30 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #31 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle() #32 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #33 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle() #34 /app/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #35 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\HandleCors->handle() #36 /app/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #37 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\Http\Middleware\TrustProxies->handle() #38 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #39 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\Pipeline\Pipeline->then() #40 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() #41 /app/public/index.php(51): Illuminate\Foundation\Http\Kernel->handle() #42 {main} "} [2025-04-20 12:46:37] production.ERROR: No application encryption key has been specified. {"exception":"[object] (Illuminate\Encryption\MissingAppKeyException(code: 0): No application encryption key has been specified. at /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:79) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(320): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}() #1 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(77): tap() #2 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(60): Illuminate\Encryption\EncryptionServiceProvider->key() #3 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(32): Illuminate\Encryption\EncryptionServiceProvider->parseKey() #4 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(908): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}() #5 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build() #6 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(986): Illuminate\Container\Container->resolve() #7 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve() #8 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(971): Illuminate\Container\Container->make() #9 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(1066): Illuminate\Foundation\Application->make() #10 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(982): Illuminate\Container\Container->resolveClass() #11 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(943): Illuminate\Container\Container->resolveDependencies() #12 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\Container\Container->build() #13 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(986): Illuminate\Container\Container->resolve() #14 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Foundation\Application->resolve() #15 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(971): Illuminate\Container\Container->make() #16 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(255): Illuminate\Foundation\Application->make() #17 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(213): Illuminate\Foundation\Http\Kernel->terminateMiddleware() #18 /app/public/index.php(55): Illuminate\Foundation\Http\Kernel->terminate() #19 {main} "} [2025-04-20 22:33:24] production.ERROR: SQLSTATE[HY000] [2002] Connection refused (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 = 'forge' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name) {"exception":"[object] (Illuminate\Database\QueryException(code: 2002): SQLSTATE[HY000] [2002] Connection refused (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 = 'forge' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name) at /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(983): Illuminate\Database\Connection->runQueryCallback() #1 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(962): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() #2 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(785): Illuminate\Database\Connection->handleQueryException() #3 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): Illuminate\Database\Connection->run() #4 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(401): Illuminate\Database\Connection->select() #5 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(41): Illuminate\Database\Connection->selectFromWriteConnection() #6 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(165): Illuminate\Database\Schema\MySqlBuilder->getTables() #7 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(184): Illuminate\Database\Schema\Builder->hasTable() #8 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(727): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists() #9 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): Illuminate\Database\Migrations\Migrator->repositoryExists() #10 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(261): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #11 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): retry() #12 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(116): Illuminate\Database\Console\Migrations\MigrateCommand->repositoryExists() #13 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(84): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() #14 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(641): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #15 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\Database\Migrations\Migrator->usingConnection() #16 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle() #17 /app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #18 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #19 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod() #20 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call() #21 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call() #22 /app/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute() #23 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run() #24 /app/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run() #25 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand() #26 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun() #27 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run() #28 /app/artisan(35): Illuminate\Foundation\Console\Kernel->handle() #29 {main}

[previous exception] [object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:65) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(65): PDO->__construct() #1 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(83): Illuminate\Database\Connectors\Connector->createPdoConnection() #2 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(48): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection() #3 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection() #4 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect() #5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}() #6 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1339): call_user_func() #7 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(528): Illuminate\Database\Connection->getPdo() #8 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(423): Illuminate\Database\Connection->getPdoForSelect() #9 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(816): Illuminate\Database\Connection->Illuminate\Database\{closure}() #10 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(983): Illuminate\Database\Connection->runQueryCallback() #11 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(962): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() #12 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(785): Illuminate\Database\Connection->handleQueryException() #13 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): Illuminate\Database\Connection->run() #14 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(401): Illuminate\Database\Connection->select() #15 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(41): Illuminate\Database\Connection->selectFromWriteConnection() #16 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(165): Illuminate\Database\Schema\MySqlBuilder->getTables() #17 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(184): Illuminate\Database\Schema\Builder->hasTable() #18 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(727): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists() #19 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): Illuminate\Database\Migrations\Migrator->repositoryExists() #20 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(261): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #21 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): retry() #22 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(116): Illuminate\Database\Console\Migrations\MigrateCommand->repositoryExists() #23 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(84): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() #24 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(641): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #25 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\Database\Migrations\Migrator->usingConnection() #26 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle() #27 /app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #28 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #29 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod() #30 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call() #31 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call() #32 /app/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute() #33 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run() #34 /app/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run() #35 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand() #36 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun() #37 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run() #38 /app/artisan(35): Illuminate\Foundation\Console\Kernel->handle() #39 {main} "}

raxororax avatar Apr 20 '25 21:04 raxororax

Okay, it seems that the database connection is not working. You need to add the following lines to the .env file and leave the APP_Key there:

APP_NAME=Servas
APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-servas-instance

SERVAS_ENABLE_REGISTRATION=true
SERVAS_SHOW_APP_VERSION=true

# SQLite
DB_CONNECTION=sqlite
DB_DATABASE=/app/database/database.sqlite
DB_FOREIGN_KEYS=true

beromir avatar Apr 22 '25 07:04 beromir

I did what you said, but now I just get a blank screen in firefox. I don't know if this matters, but I have been using http://localhost as the APP_URL. Also, I tried to install this in another vm with the docker-compose. That one uses your recommended .env and docker-compose from the docker folder with the only change being the same APP_URL as htttp://localhost. On that one, I always get the 500 Internal Server Error. (Same .env as you just posted.) I'll post the log below, but I can't see any difference. Maybe I'm missing something... Thank you for your time!

[2025-04-22 19:25:07] production.ERROR: SQLSTATE[HY000] [2002] Connection refused (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 = 'forge' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name) {"exception":"[object] (Illuminate\Database\QueryException(code: 2002): SQLSTATE[HY000] [2002] Connection refused (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 = 'forge' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name) at /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(983): Illuminate\Database\Connection->runQueryCallback() #1 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(962): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() #2 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(785): Illuminate\Database\Connection->handleQueryException() #3 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): Illuminate\Database\Connection->run() #4 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(401): Illuminate\Database\Connection->select() #5 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(41): Illuminate\Database\Connection->selectFromWriteConnection() #6 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(165): Illuminate\Database\Schema\MySqlBuilder->getTables() #7 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(184): Illuminate\Database\Schema\Builder->hasTable() #8 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(727): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists() #9 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): Illuminate\Database\Migrations\Migrator->repositoryExists() #10 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(261): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #11 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): retry() #12 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(116): Illuminate\Database\Console\Migrations\MigrateCommand->repositoryExists() #13 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(84): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() #14 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(641): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #15 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\Database\Migrations\Migrator->usingConnection() #16 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle() #17 /app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #18 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #19 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod() #20 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call() #21 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call() #22 /app/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute() #23 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run() #24 /app/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run() #25 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand() #26 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun() #27 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run() #28 /app/artisan(35): Illuminate\Foundation\Console\Kernel->handle() #29 {main}

[previous exception] [object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:65) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(65): PDO->__construct() #1 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(83): Illuminate\Database\Connectors\Connector->createPdoConnection() #2 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(48): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection() #3 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection() #4 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect() #5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}() #6 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1339): call_user_func() #7 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(528): Illuminate\Database\Connection->getPdo() #8 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(423): Illuminate\Database\Connection->getPdoForSelect() #9 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(816): Illuminate\Database\Connection->Illuminate\Database\{closure}() #10 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(983): Illuminate\Database\Connection->runQueryCallback() #11 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(962): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() #12 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(785): Illuminate\Database\Connection->handleQueryException() #13 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): Illuminate\Database\Connection->run() #14 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(401): Illuminate\Database\Connection->select() #15 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(41): Illuminate\Database\Connection->selectFromWriteConnection() #16 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(165): Illuminate\Database\Schema\MySqlBuilder->getTables() #17 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(184): Illuminate\Database\Schema\Builder->hasTable() #18 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(727): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists() #19 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): Illuminate\Database\Migrations\Migrator->repositoryExists() #20 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(261): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #21 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): retry() #22 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(116): Illuminate\Database\Console\Migrations\MigrateCommand->repositoryExists() #23 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(84): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() #24 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(641): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #25 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\Database\Migrations\Migrator->usingConnection() #26 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle() #27 /app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #28 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #29 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod() #30 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call() #31 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call() #32 /app/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute() #33 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run() #34 /app/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run() #35 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand() #36 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun() #37 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run() #38 /app/artisan(35): Illuminate\Foundation\Console\Kernel->handle() #39 {main} "} [2025-04-22 19:30:51] production.ERROR: SQLSTATE[HY000] [2002] Connection refused (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 = 'forge' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name) {"exception":"[object] (Illuminate\Database\QueryException(code: 2002): SQLSTATE[HY000] [2002] Connection refused (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 = 'forge' and table_type in ('BASE TABLE', 'SYSTEM VERSIONED') order by table_name) at /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:829) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(983): Illuminate\Database\Connection->runQueryCallback() #1 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(962): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() #2 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(785): Illuminate\Database\Connection->handleQueryException() #3 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): Illuminate\Database\Connection->run() #4 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(401): Illuminate\Database\Connection->select() #5 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(41): Illuminate\Database\Connection->selectFromWriteConnection() #6 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(165): Illuminate\Database\Schema\MySqlBuilder->getTables() #7 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(184): Illuminate\Database\Schema\Builder->hasTable() #8 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(727): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists() #9 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): Illuminate\Database\Migrations\Migrator->repositoryExists() #10 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(261): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #11 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): retry() #12 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(116): Illuminate\Database\Console\Migrations\MigrateCommand->repositoryExists() #13 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(84): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() #14 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(641): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #15 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\Database\Migrations\Migrator->usingConnection() #16 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle() #17 /app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #18 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #19 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod() #20 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call() #21 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call() #22 /app/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute() #23 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run() #24 /app/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run() #25 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand() #26 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun() #27 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run() #28 /app/artisan(35): Illuminate\Foundation\Console\Kernel->handle() #29 {main}

[previous exception] [object] (PDOException(code: 2002): SQLSTATE[HY000] [2002] Connection refused at /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:65) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(65): PDO->__construct() #1 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(83): Illuminate\Database\Connectors\Connector->createPdoConnection() #2 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(48): Illuminate\Database\Connectors\Connector->tryAgainIfCausedByLostConnection() #3 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection() #4 /app/vendor/laravel/framework/src/Illuminate/Database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect() #5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}() #6 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(1339): call_user_func() #7 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(528): Illuminate\Database\Connection->getPdo() #8 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(423): Illuminate\Database\Connection->getPdoForSelect() #9 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(816): Illuminate\Database\Connection->Illuminate\Database\{closure}() #10 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(983): Illuminate\Database\Connection->runQueryCallback() #11 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(962): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection() #12 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(785): Illuminate\Database\Connection->handleQueryException() #13 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(414): Illuminate\Database\Connection->run() #14 /app/vendor/laravel/framework/src/Illuminate/Database/Connection.php(401): Illuminate\Database\Connection->select() #15 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/MySqlBuilder.php(41): Illuminate\Database\Connection->selectFromWriteConnection() #16 /app/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php(165): Illuminate\Database\Schema\MySqlBuilder->getTables() #17 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(184): Illuminate\Database\Schema\Builder->hasTable() #18 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(727): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists() #19 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): Illuminate\Database\Migrations\Migrator->repositoryExists() #20 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(261): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #21 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(140): retry() #22 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(116): Illuminate\Database\Console\Migrations\MigrateCommand->repositoryExists() #23 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(84): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase() #24 /app/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(641): Illuminate\Database\Console\Migrations\MigrateCommand->Illuminate\Database\Console\Migrations\{closure}() #25 /app/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(83): Illuminate\Database\Migrations\Migrator->usingConnection() #26 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Database\Console\Migrations\MigrateCommand->handle() #27 /app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #28 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #29 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod() #30 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call() #31 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(211): Illuminate\Container\Container->call() #32 /app/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute() #33 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(180): Symfony\Component\Console\Command\Command->run() #34 /app/vendor/symfony/console/Application.php(1096): Illuminate\Console\Command->run() #35 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand() #36 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun() #37 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(201): Symfony\Component\Console\Application->run() #38 /app/artisan(35): Illuminate\Foundation\Console\Kernel->handle() #39 {main} "}

raxororax avatar Apr 22 '25 18:04 raxororax

Confirmed same error both before and after making the change suggested at https://github.com/beromir/Servas/issues/118#issuecomment-2820413915

jrcastine avatar May 12 '25 18:05 jrcastine

Sorry for the late reply. Can you check if there is a database file in the directory /app/database/database.sqlite and can you also check the file permissions?

beromir avatar May 13 '25 18:05 beromir

For anyone facing this issue, removing database.sqlite from line 12 in compose.yaml seems to fix it:

    volumes:
      - ./.env:/app/.env
      # - servas-db-sqlite:/app/database/database.sqlite
      - servas-db-sqlite:/app/database

(checking in the container, it seemed that database.sqlite was being created as a folder instead of a file)

manekenpix avatar Jun 19 '25 01:06 manekenpix

I've tried both for volumes

  • ./database:/app/database/database.sqlite and
  • ./database:/app/database/database

none works. First one creates an empty directory and the other one the database.sqlite in the folder. Running docker exec -it servas php artisan key:generate --force works and writes a new key in the .env, but I still got 500 server error when I try to access the register page. I'm running docker on the latest alpine linux on a vm.

Edit: tried to force a user with user: "1001:1001"

using

  • ./database:/app/database/database

and chmod the folder to 777 works but the database folder is still empty!?

EDIT 2:

with:

  - servas_data:/app/database/database # This will now be a bind-mounted named volume

volumes: servas_data: driver: local driver_opts: type: none o: bind device: /mnt/docker/servas/volume

no chmod 777 is needed but the volume is still empty. removing the docker image, removes all the data.

EDIT 3:

I think there is a problem with docker compose or setup of this image in general in combination with latest alpine linux. I was not able to setup the sqlite or maria db version of servas with docker compose using the config templates or edited ones. Moving the mariadb volume from a debian installation to alpine (including the key in the .env) gives me a working instance of servas with my data.

underwoodblog avatar Jul 09 '25 10:07 underwoodblog

Can you remove all volumes with docker compose down -v (this will remove your data) and remove the volumes binding of the DB in the compose file? Then start the containers again with docker compose up -d and check the output of docker exec -it servas php artisan db:show.

beromir avatar Jul 09 '25 16:07 beromir

`❯ docker exec -it servas php artisan db:show

   .................................................................................................................................................
  Database ............................................................................................................................... servas_db
  Host .......................................................................................................................................... db
  Port ........................................................................................................................................ 3306
  Username .......................................................................................................................... servas_db_user
  URL ..............................................................................................................................................
  Open Connections ............................................................................................................................... 1
  Tables ......................................................................................................................................... 0
`

underwoodblog avatar Jul 09 '25 20:07 underwoodblog

after running docker exec -it servas php artisan key:generate --force I have still the 500 internal server error

and this is the output from my manual fiddled in database to alpine from my debian docker servas instance

`
  .................................................................................................................................................
  Database ............................................................................................................................... servas_db
  Host .......................................................................................................................................... db
  Port ........................................................................................................................................ 3306
  Username .......................................................................................................................... servas_db_user
  URL ..............................................................................................................................................
  Open Connections ............................................................................................................................... 1
  Tables ........................................................................................................................................ 12
  Total Size ............................................................................................................................... 0.56MiB

  Table ................................................................................................................................. Size (MiB)
  failed_jobs ................................................................................................................................. 0.03
  password_resets ............................................................................................................................. 0.03
  public_links ................................................................................................................................ 0.08
  groupables .................................................................................................................................. 0.03
  migrations .................................................................................................................................. 0.02
  sessions .................................................................................................................................... 0.05
  users ....................................................................................................................................... 0.03
  groups ...................................................................................................................................... 0.05
  links ....................................................................................................................................... 0.09
  personal_access_tokens ...................................................................................................................... 0.06
  taggables ................................................................................................................................... 0.06
  tags ........................................................................................................................................ 0.03
`

underwoodblog avatar Jul 09 '25 20:07 underwoodblog

after running docker exec -it servas php artisan key:generate --force I have still the 500 internal server error

and this is the output from my manual fiddled in database to alpine from my debian docker servas instance

`
  .................................................................................................................................................
  Database ............................................................................................................................... servas_db
  Host .......................................................................................................................................... db
  Port ........................................................................................................................................ 3306
  Username .......................................................................................................................... servas_db_user
  URL ..............................................................................................................................................
  Open Connections ............................................................................................................................... 1
  Tables ........................................................................................................................................ 12
  Total Size ............................................................................................................................... 0.56MiB

  Table ................................................................................................................................. Size (MiB)
  failed_jobs ................................................................................................................................. 0.03
  password_resets ............................................................................................................................. 0.03
  public_links ................................................................................................................................ 0.08
  groupables .................................................................................................................................. 0.03
  migrations .................................................................................................................................. 0.02
  sessions .................................................................................................................................... 0.05
  users ....................................................................................................................................... 0.03
  groups ...................................................................................................................................... 0.05
  links ....................................................................................................................................... 0.09
  personal_access_tokens ...................................................................................................................... 0.06
  taggables ................................................................................................................................... 0.06
  tags ........................................................................................................................................ 0.03
`

Hello, same problem ;)

prohand avatar Jul 10 '25 14:07 prohand

Can you share the output of app/storage/logs/laravel.log?

beromir avatar Jul 10 '25 14:07 beromir

Thanks for you're reply

Image Image

prohand avatar Jul 10 '25 15:07 prohand

Sorry. My bad. You need the slash at the beginning: /app/storage/logs/laravel.log

beromir avatar Jul 10 '25 15:07 beromir

[2025-07-10 17:14:50] production.ERROR: No application encryption key has been specified. {"exception":"[object] (Illuminate\\Encryption\\MissingAppKeyException(code: 0): No application encryption key has been specified. at /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:79) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(320): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}() #1 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(77): tap() #2 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(60): Illuminate\\Encryption\\EncryptionServiceProvider->key() #3 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(32): Illuminate\\Encryption\\EncryptionServiceProvider->parseKey() #4 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(908): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}() #5 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\\Container\\Container->build() #6 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(986): Illuminate\\Container\\Container->resolve() #7 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\\Foundation\\Application->resolve() #8 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(971): Illuminate\\Container\\Container->make() #9 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(1066): Illuminate\\Foundation\\Application->make() #10 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(982): Illuminate\\Container\\Container->resolveClass() #11 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(943): Illuminate\\Container\\Container->resolveDependencies() #12 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\\Container\\Container->build() #13 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(986): Illuminate\\Container\\Container->resolve() #14 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\\Foundation\\Application->resolve() #15 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(971): Illuminate\\Container\\Container->make() #16 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(172): Illuminate\\Foundation\\Application->make() #17 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #18 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(805): Illuminate\\Pipeline\\Pipeline->then() #19 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(784): Illuminate\\Routing\\Router->runRouteWithinStack() #20 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(748): Illuminate\\Routing\\Router->runRoute() #21 /app/vendor/laravel/framework/src/Illuminate/Routing/Router.php(737): Illuminate\\Routing\\Router->dispatchToRoute() #22 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch() #23 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(144): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}() #24 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #25 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle() #26 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle() #27 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #28 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle() #29 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle() #30 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #31 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle() #32 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(99): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #33 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle() #34 /app/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #35 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\HandleCors->handle() #36 /app/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #37 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(183): Illuminate\\Http\\Middleware\\TrustProxies->handle() #38 /app/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(119): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}() #39 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then() #40 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter() #41 /app/public/index.php(51): Illuminate\\Foundation\\Http\\Kernel->handle() #42 {main} "} [2025-07-10 17:14:50] production.ERROR: No application encryption key has been specified. {"exception":"[object] (Illuminate\\Encryption\\MissingAppKeyException(code: 0): No application encryption key has been specified. at /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:79) [stacktrace] #0 /app/vendor/laravel/framework/src/Illuminate/Support/helpers.php(320): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}() #1 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(77): tap() #2 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(60): Illuminate\\Encryption\\EncryptionServiceProvider->key() #3 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(32): Illuminate\\Encryption\\EncryptionServiceProvider->parseKey() #4 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(908): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}() #5 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\\Container\\Container->build() #6 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(986): Illuminate\\Container\\Container->resolve() #7 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\\Foundation\\Application->resolve() #8 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(971): Illuminate\\Container\\Container->make() #9 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(1066): Illuminate\\Foundation\\Application->make() #10 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(982): Illuminate\\Container\\Container->resolveClass() #11 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(943): Illuminate\\Container\\Container->resolveDependencies() #12 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\\Container\\Container->build() #13 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(986): Illuminate\\Container\\Container->resolve() #14 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\\Foundation\\Application->resolve() #15 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(971): Illuminate\\Container\\Container->make() #16 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(255): Illuminate\\Foundation\\Application->make() #17 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(213): Illuminate\\Foundation\\Http\\Kernel->terminateMiddleware() #18 /app/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->terminate() #19 {main} "}

I didn't realize I'd commented on APP_KEY.

Sorry.

It's ok after uncommenting it

prohand avatar Jul 10 '25 15:07 prohand

I got the docker working. I got to the same point as @prohand and @underwoodblog with the ....................... response to docker exec -it servas php artisan db:show

I edited the .env file APP_URL to: APP_URL=https://0.0.0.0 then in firefox I had to type in http://0.0.0.0:8080 and it would work. Note http and NOT https. Anything with https failed with or without a port. Before, localhost as APP_URL always failed to no matter what I tried. So I am guessing there is something funky behind that. Below is the full rundown of what I did to get it working in debian:

sudo docker pull beromir/servas
docker run -d --name servas -p 8080:80 beromir/servas
docker exec -it servas /bin/sh
add apk nano
touch .env
nano .env

Paste the folowing into .env:

APP_NAME=servas
APP_ENV=production
APP_KEY=
APP_DEBUG=false
APP_URL=https://0.0.0.0

SERVAS_ENABLE_REGISTRATION=true
SERVAS_SHOW_APP_VERSION=true

# SQLite
DB_CONNECTION=sqlite
DB_DATABASE=/app/database/database.sqlite
DB_FOREIGN_KEYS=true 

*save and exit nano

exit
docker exec -it servas php artisan key:generate --force
docker exec -it servas php artisan config:cache
docker restart servas

Firefox:
http://0.0.0.0:8080 The login and registration both worked.

@beromir Thank you very much for the great product!

rax-oro-rax avatar Jul 20 '25 16:07 rax-oro-rax

I still got the same 500 Internal Server Error. Tried it with SQLite and tried it with the APP_URL set to the docker ip too. The 14 other docker containers run without any problems.

underwoodblog avatar Jul 21 '25 05:07 underwoodblog

a much cleaner way and also inspiration for running it on k8s (database.sqlite in dedicated folder which will be a mounted PV) mount a local-folder to /app/database/db/ and point DB_DATABASE there:

.env

APP_NAME=Servas
APP_ENV=production
APP_DEBUG=false
APP_URL=https://127.0.0.1
APP_KEY=

SERVAS_ENABLE_REGISTRATION=true
SERVAS_SHOW_APP_VERSION=false

# SQLite
DB_CONNECTION=sqlite
DB_DATABASE=/app/database/db/database.sqlite
DB_FOREIGN_KEYS=true

compose.yaml

services:
  servas:
    image: beromir/servas
    container_name: servas
    restart: unless-stopped
    ports:
      - "8080:80"
    volumes:
      - ./.env:/app/.env
      - ./db:/app/database/db

then

mkdir db
docker compose up -d
docker exec -it servas php artisan key:generate --force
docker compose down

# check
grep base64 .env
# should get you something like: APP_KEY=base64:........=

docker compose up -d

then you should go there: http://127.0.0.1:8080/login or http://127.0.0.1:8080/register

.... worked for me. i'll post my k8s yamls as soon i have time to create them

btw: if something goes wrong you can see logs with

docker exec -it servas tail -f /app/storage/logs/laravel.log

toastbrotch avatar Aug 03 '25 20:08 toastbrotch

I had the same issue and after spending some time searching in the issues and trial and error I figured the issue is stemming from the fact that the database is not generated automatically and you have to create it before hand touch database.sqlite provide it in the compose.yaml file. Following is my compose.yaml file:

services:
  servas:
    image: beromir/servas
    container_name: servas
    restart: unless-stopped
    ports:
      - "8573:80"
    volumes:
      - ./.env:/app/.env
      - /apps/docker/servas/servas-db-sqlite/database.sqlite:/app/database/database.sqlite

volumes:
  servas-db-sqlite:

AuthorShin avatar Aug 26 '25 20:08 AuthorShin

tried it all. ERR 500 still here.

edit nov 2nd AuthorShin is right, it works now ! thanks !

gilluc avatar Oct 31 '25 15:10 gilluc

What error message do you get? https://servas.app/guides/application-error-log

beromir avatar Oct 31 '25 15:10 beromir

Hi henrik, Thank you for fast reply.

Because of the pain, I deleted all servas docker install... Sorry

Cordialement, Gilles @.*** 07 67 13 90 95

-------- Courriel initial -------- De : Henrik @.> Envoyé : 31 octobre 2025 16:51:33 GMT+01:00 À : beromir/Servas @.> Cc : gilluc @.>, Comment @.> Objet : Re: [beromir/Servas] 500 Internal Server Error (Issue #118)

beromir left a comment (beromir/Servas#118)

What error message do you get? https://servas.app/guides/application-error-log

-- Reply to this email directly or view it on GitHub: https://github.com/beromir/Servas/issues/118#issuecomment-3473720090 You are receiving this because you commented.

Message ID: @.***>

gilluc avatar Oct 31 '25 16:10 gilluc