mondediefr / docker-flarum

:speech_balloon: :whale: Docker image of Flarum
https://hub.docker.com/r/mondedie/flarum
MIT License
507 stars 131 forks source link

Flarum encountered a boot error. Details have been logged to the Flarum log file. #107

Closed talesam closed 2 years ago

talesam commented 2 years ago

I already checked the log and there is nothing relevant and that. I saw a topic saying to restart the bank, but it's docker, I gave stop and start and nothing changed.

https://discuss.flarum.org/d/7585-free-flarum-hosting-on-an-expert-platform-by-freeflarum-com/2848

PHP Fatal error:  Uncaught PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name does not resolve in /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
Stack trace:
#0 /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(40): PDO->__construct()
#1 /flarum/app/vendor/illuminate/database/Connectors/Connector.php(67): Doctrine\DBAL\Driver\PDOConnection->__construct()
#2 /flarum/app/vendor/illuminate/database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()
#3 /flarum/app/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#4 /flarum/app/vendor/illuminate/database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#6 /flarum/app/vendor/illuminate/database/Connection.php(1064): call_user_func()
#7 /flarum/app/vendor/illuminate/database/Connection.php(1014): Illuminate\Database\Connection->getPdo()
#8 /flarum/app/vendor/illuminate/database/Connection.php(994): Illuminate\Database\Connection->getDoctrineConnection()
#9 /flarum/app/vendor/flarum/core/src/Database/Migrator.php(72): Illuminate\Database\Connection->getDoctrineSchemaManager()
#10 [internal function]: Flarum\Database\Migrator->__construct()
#11 /flarum/app/vendor/illuminate/container/Container.php(917): ReflectionClass->newInstanceArgs()
#12 /flarum/app/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build()
#13 /flarum/app/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve()
#14 /flarum/app/vendor/illuminate/container/Container.php(1027): Illuminate\Container\Container->make()
#15 /flarum/app/vendor/illuminate/container/Container.php(947): Illuminate\Container\Container->resolveClass()
#16 /flarum/app/vendor/illuminate/container/Container.php(908): Illuminate\Container\Container->resolveDependencies()
#17 /flarum/app/vendor/illuminate/container/Container.php(292): Illuminate\Container\Container->build()
#18 /flarum/app/vendor/illuminate/container/Container.php(873): Illuminate\Container\Container->Illuminate\Container\{closure}()
#19 /flarum/app/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build()
#20 /flarum/app/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve()
#21 /flarum/app/vendor/flarum/core/src/Extension/ExtensionServiceProvider.php(31): Illuminate\Container\Container->make()
#22 [internal function]: Flarum\Extension\ExtensionServiceProvider->Flarum\Extension\{closure}()
#23 /flarum/app/vendor/flarum/core/src/Foundation/Application.php(329): call_user_func()
#24 /flarum/app/vendor/flarum/core/src/Foundation/Application.php(270): Flarum\Foundation\Application->fireAppCallbacks()
#25 /flarum/app/vendor/flarum/core/src/Foundation/InstalledSite.php(151): Flarum\Foundation\Application->boot()
#26 /flarum/app/vendor/flarum/core/src/Foundation/InstalledSite.php(82): Flarum\Foundation\InstalledSite->bootLaravel()
#27 /flarum/app/vendor/flarum/core/src/Console/Server.php(32): Flarum\Foundation\InstalledSite->bootApp()
#28 /flarum/app/flarum(24): Flarum\Console\Server->listen()
#29 {main}

Next PDOException: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name does not resolve in /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40
Stack trace:
#0 /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(40): PDO->__construct()
#1 /flarum/app/vendor/illuminate/database/Connectors/Connector.php(67): Doctrine\DBAL\Driver\PDOConnection->__construct()
#2 /flarum/app/vendor/illuminate/database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()
#3 /flarum/app/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#4 /flarum/app/vendor/illuminate/database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#6 /flarum/app/vendor/illuminate/database/Connection.php(1064): call_user_func()
#7 /flarum/app/vendor/illuminate/database/Connection.php(1014): Illuminate\Database\Connection->getPdo()
#8 /flarum/app/vendor/illuminate/database/Connection.php(994): Illuminate\Database\Connection->getDoctrineConnection()
#9 /flarum/app/vendor/flarum/core/src/Database/Migrator.php(72): Illuminate\Database\Connection->getDoctrineSchemaManager()
#10 [internal function]: Flarum\Database\Migrator->__construct()
#11 /flarum/app/vendor/illuminate/container/Container.php(917): ReflectionClass->newInstanceArgs()
#12 /flarum/app/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build()
#13 /flarum/app/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve()
#14 /flarum/app/vendor/illuminate/container/Container.php(1027): Illuminate\Container\Container->make()
#15 /flarum/app/vendor/illuminate/container/Container.php(947): Illuminate\Container\Container->resolveClass()
#16 /flarum/app/vendor/illuminate/container/Container.php(908): Illuminate\Container\Container->resolveDependencies()
#17 /flarum/app/vendor/illuminate/container/Container.php(292): Illuminate\Container\Container->build()
#18 /flarum/app/vendor/illuminate/container/Container.php(873): Illuminate\Container\Container->Illuminate\Container\{closure}()
#19 /flarum/app/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build()
#20 /flarum/app/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve()
#21 /flarum/app/vendor/flarum/core/src/Extension/ExtensionServiceProvider.php(31): Illuminate\Container\Container->make()
#22 [internal function]: Flarum\Extension\ExtensionServiceProvider->Flarum\Extension\{closure}()
#23 /flarum/app/vendor/flarum/core/src/Foundation/Application.php(329): call_user_func()
#24 /flarum/app/vendor/flarum/core/src/Foundation/Application.php(270): Flarum\Foundation\Application->fireAppCallbacks()
#25 /flarum/app/vendor/flarum/core/src/Foundation/InstalledSite.php(151): Flarum\Foundation\Application->boot()
#26 /flarum/app/vendor/flarum/core/src/Foundation/InstalledSite.php(82): Flarum\Foundation\InstalledSite->bootLaravel()
#27 /flarum/app/vendor/flarum/core/src/Console/Server.php(32): Flarum\Foundation\InstalledSite->bootApp()
#28 /flarum/app/flarum(24): Flarum\Console\Server->listen()
#29 {main}

Next Doctrine\DBAL\Driver\PDO\Exception: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name does not resolve in /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php:18
Stack trace:
#0 /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(44): Doctrine\DBAL\Driver\PDO\Exception::new()
#1 /flarum/app/vendor/illuminate/database/Connectors/Connector.php(67): Doctrine\DBAL\Driver\PDOConnection->__construct()
#2 /flarum/app/vendor/illuminate/database/Connectors/Connector.php(46): Illuminate\Database\Connectors\Connector->createPdoConnection()
#3 /flarum/app/vendor/illuminate/database/Connectors/MySqlConnector.php(24): Illuminate\Database\Connectors\Connector->createConnection()
#4 /flarum/app/vendor/illuminate/database/Connectors/ConnectionFactory.php(184): Illuminate\Database\Connectors\MySqlConnector->connect()
#5 [internal function]: Illuminate\Database\Connectors\ConnectionFactory->Illuminate\Database\Connectors\{closure}()
#6 /flarum/app/vendor/illuminate/database/Connection.php(1064): call_user_func()
#7 /flarum/app/vendor/illuminate/database/Connection.php(1014): Illuminate\Database\Connection->getPdo()
#8 /flarum/app/vendor/illuminate/database/Connection.php(994): Illuminate\Database\Connection->getDoctrineConnection()
#9 /flarum/app/vendor/flarum/core/src/Database/Migrator.php(72): Illuminate\Database\Connection->getDoctrineSchemaManager()
#10 [internal function]: Flarum\Database\Migrator->__construct()
#11 /flarum/app/vendor/illuminate/container/Container.php(917): ReflectionClass->newInstanceArgs()
#12 /flarum/app/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build()
#13 /flarum/app/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve()
#14 /flarum/app/vendor/illuminate/container/Container.php(1027): Illuminate\Container\Container->make()
#15 /flarum/app/vendor/illuminate/container/Container.php(947): Illuminate\Container\Container->resolveClass()
#16 /flarum/app/vendor/illuminate/container/Container.php(908): Illuminate\Container\Container->resolveDependencies()
#17 /flarum/app/vendor/illuminate/container/Container.php(292): Illuminate\Container\Container->build()
#18 /flarum/app/vendor/illuminate/container/Container.php(873): Illuminate\Container\Container->Illuminate\Container\{closure}()
#19 /flarum/app/vendor/illuminate/container/Container.php(758): Illuminate\Container\Container->build()
#20 /flarum/app/vendor/illuminate/container/Container.php(694): Illuminate\Container\Container->resolve()
#21 /flarum/app/vendor/flarum/core/src/Extension/ExtensionServiceProvider.php(31): Illuminate\Container\Container->make()
#22 [internal function]: Flarum\Extension\ExtensionServiceProvider->Flarum\Extension\{closure}()
#23 /flarum/app/vendor/flarum/core/src/Foundation/Application.php(329): call_user_func()
#24 /flarum/app/vendor/flarum/core/src/Foundation/Application.php(270): Flarum\Foundation\Application->fireAppCallbacks()
#25 /flarum/app/vendor/flarum/core/src/Foundation/InstalledSite.php(151): Flarum\Foundation\Application->boot()
#26 /flarum/app/vendor/flarum/core/src/Foundation/InstalledSite.php(82): Flarum\Foundation\InstalledSite->bootLaravel()
#27 /flarum/app/vendor/flarum/core/src/Console/Server.php(32): Flarum\Foundation\InstalledSite->bootApp()
#28 /flarum/app/flarum(24): Flarum\Console\Server->listen()
#29 {main}
  thrown in /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDO/Exception.php on line 18
Hydrog3n commented 2 years ago

Hello @talesam The first line is quite relevant :

PHP Fatal error:  Uncaught PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name does not resolve in /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40

The container can't resolve the host you set for the DB.

talesam commented 2 years ago

Hello @talesam The first line is quite relevant :

PHP Fatal error:  Uncaught PDOException: PDO::__construct(): php_network_getaddresses: getaddrinfo failed: Name does not resolve in /flarum/app/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40

The container can't resolve the host you set for the DB.

I didn't understand why, I didn't arrive and change anything after I climbed the container.

version: "3.9"

services:
  forumbig_db:
    image: mariadb:10.5
    container_name: forumbig_db
    environment:
      - MYSQL_ROOT_PASSWORD=xxxxxxxxxxxxxxxxx
      - MYSQL_DATABASE=flarum
      - MYSQL_USER=flarum
      - MYSQL_PASSWORD=yyyyyyyyyyyyyyyyyy
    volumes:
      - /home/tales/Docker/Bigforum/mysql/db:/var/lib/mysql
    networks:
      t4l35-net:

  flarum_big:
    image: mondedie/flarum:stable
    container_name: flarum_big
    env_file:
      - .env
    volumes:
      - /home/tales/Docker/Bigforum/assets:/flarum/app/public/assets
      - /home/tales/Docker/Bigforum/extensions:/flarum/app/extensions
      - /home/tales/Docker/Bigforum/storage/logs:/flarum/app/storage/logs
      - /home/tales/Docker/Bigforum/nginx:/etc/nginx/flarum
    expose:
      - "8888"
    depends_on:
      - forumbig_db
    networks:
      t4l35-net:

networks:
  t4l35-net:
      name: t4l35-net
Hydrog3n commented 2 years ago

Ah it's after climbed the container ? Are you sure the two container are well in the same network ? Also check the DB name you use is flarumbig_db

talesam commented 2 years ago

I recreated the container and gave the same error.

DEBUG=false
FORUM_URL=https://forumdev.biglinux.com.br

# Database configuration
DB_HOST=mariadb
DB_NAME=flarum
DB_USER=flarum
DB_PASS=xxxxxxxxxxxxxxxxxxxxxxx
DB_PREF=flarum_
DB_PORT=3306

# User admin flarum (environment variable for first installation)
# /!\ admin password must contain at least 8 characters /!\
FLARUM_ADMIN_USER=admin
FLARUM_ADMIN_PASS=xxxxxxxxxxxxxxxxxxx
FLARUM_ADMIN_MAIL=my@mail.com
FLARUM_TITLE=Forum Biglinux

I had the forum up before and it was working, now it's not.

Hydrog3n commented 2 years ago

Ok you have mariadb has host it should be the same than the service in you compose file on the example should be forumbig_db

talesam commented 2 years ago

Wow, I didn't even see it, I must have changed it later, thanks!

Hydrog3n commented 2 years ago

No need to rename the issue I will just close it :)