passbolt / passbolt_docker

Get started with Passbolt CE using docker!
https://passbolt.com
GNU Affero General Public License v3.0
877 stars 193 forks source link

Fresh install using docker compose got missing migration error #170

Closed arcphysx closed 2 years ago

arcphysx commented 2 years ago

I just install passbolt using docker compose, and I got this migration missing error on the docker logs

|
|      ____                  __          ____
|     / __ \____  _____ ____/ /_  ____  / / /_
|    / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
|   / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
|  /_/    \__,_/____/____/_.___/\____/_/\__/
|
|  Open source password manager for teams
| -------------------------------------------------------------------------------
| -------------------------------------------------------------------------------
|  Running migration scripts.
| -------------------------------------------------------------------------------
| using migration paths
|  - /etc/passbolt/Migrations
| using seed paths
|  - /etc/passbolt/Seeds
| using environment default
| using adapter mysql
| using database passbolt
| ordering by creation time
|
|  == 20170830064410 V162InitialMigration: migrating
| Exception: Can not upgrade. Some tables are missing. in /etc/passbolt/Migrations/20170830064410_V162InitialMigration.php:48
| Stack trace:
| #0 /usr/share/php/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(111): V162InitialMigration->up()
| #1 /usr/share/php/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(376): Phinx\Migration\Manager\Environment->executeMigration()
| #2 /usr/share/php/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(351): Phinx\Migration\Manager->executeMigration()
| #3 /usr/share/php/passbolt/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(122): Phinx\Migration\Manager->migrate()
| #4 /usr/share/php/passbolt/vendor/cakephp/migrations/src/Command/Phinx/CommandTrait.php(37): Phinx\Console\Command\Migrate->execute()
| #5 /usr/share/php/passbolt/vendor/cakephp/migrations/src/Command/Phinx/Migrate.php(85): Migrations\Command\Phinx\Migrate->parentExecute()
| #6 /usr/share/php/passbolt/vendor/symfony/console/Command/Command.php(299): Migrations\Command\Phinx\Migrate->execute()
| #7 /usr/share/php/passbolt/vendor/symfony/console/Application.php(978): Symfony\Component\Console\Command\Command->run()
| #8 /usr/share/php/passbolt/vendor/symfony/console/Application.php(295): Symfony\Component\Console\Application->doRunCommand()
| #9 /usr/share/php/passbolt/vendor/symfony/console/Application.php(167): Symfony\Component\Console\Application->doRun()
| #10 /usr/share/php/passbolt/vendor/cakephp/migrations/src/Command/MigrationsCommand.php(126): Symfony\Component\Console\Application->run()
| #11 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/BaseCommand.php(179): Migrations\Command\MigrationsCommand->execute()
| #12 /usr/share/php/passbolt/vendor/cakephp/migrations/src/Command/MigrationsCommand.php(198): Cake\Console\BaseCommand->run()
| #13 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/BaseCommand.php(271): Migrations\Command\MigrationsCommand->run()
| #14 /usr/share/php/passbolt/src/Command/DatabaseAwareCommandTrait.php(62): Cake\Console\BaseCommand->executeCommand()
| #15 /usr/share/php/passbolt/src/Command/MigrateCommand.php(72): App\Command\MigrateCommand->runMigrationsMigrateCommand()
| #16 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/BaseCommand.php(179): App\Command\MigrateCommand->execute()
| #17 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/CommandRunner.php(336): Cake\Console\BaseCommand->run()
| #18 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/CommandRunner.php(172): Cake\Console\CommandRunner->runCommand()
| #19 /usr/share/php/passbolt/bin/cake.php(13): Cake\Console\CommandRunner->run()
| #20 {main}
| #13 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/BaseCommand.php(271): Migrations\Command\MigrationsCommand->run()
| #14 /usr/share/php/passbolt/src/Command/DatabaseAwareCommandTrait.php(62): Cake\Console\BaseCommand->executeCommand()
| #15 /usr/share/php/passbolt/src/Command/MigrateCommand.php(72): App\Command\MigrateCommand->runMigrationsMigrateCommand()
| #16 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/BaseCommand.php(179): App\Command\MigrateCommand->execute()
| #17 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/CommandRunner.php(336): Cake\Console\BaseCommand->run()
| #18 /usr/share/php/passbolt/vendor/cakephp/cakephp/src/Console/CommandRunner.php(172): Cake\Console\CommandRunner->runCommand()
| #19 /usr/share/php/passbolt/bin/cake.php(13): Cake\Console\CommandRunner->run()
| #20 {main}

And this is my docker-compose file

version: "3.7"
services:
  passbolt:
    image: "passbolt/passbolt:latest-ce"
    deploy:
      replicas: 2
    environment:
      - DATASOURCES_DEFAULT_HOST=some-db-host
      - DATASOURCES_DEFAULT_PORT=some-db-port
      - DATASOURCES_DEFAULT_USERNAME=some-db-username
      - DATASOURCES_DEFAULT_PASSWORD=some-db-password
      - DATASOURCES_DEFAULT_DATABASE=passbolt
    volumes:
      - gpg_volume:/etc/passbolt/gpg
      - images_volume:/usr/share/php/passbolt/webroot/img/public
    ports:
      - "8000:80"
volumes:
  gpg_volume:
  images_volume:

Anyone can help? Thanks in advance

AnatomicJC commented 2 years ago

I guess it is a duplicate of https://github.com/passbolt/passbolt_docker/issues/172

Check if ANSI_QUOTE SQL mode is on.

MySQL [passboltdb]> SELECT @@sql_mode;

If yes, remove it.

Cheers,