Update passbolt

Hello,

I tried to update passbolt today and an error has occured :

PHP version : 7.3
OS : CentOS 7 x86_64

root@src-coffre:/var/www/passbolt# sudo -H -u nginx bash -c “./bin/cake passbolt migrate”

using migration paths

  • /var/www/passbolt/config/Migrations
    using seed paths
  • /var/www/passbolt/config/Seeds
    using environment default
    using adapter mysql
    using database passbolt
    ordering by creation time

== 20220809190030 V372ImproveFoldersRelationsIndexesAddItemsToUserTreePerformance: migrating

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1280 Incorrect index name ‘foreign_id’ in /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php:193
Stack trace:
#0 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(193): PDO->exec()
#1 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Util/AlterInstructions.php(108): Phinx\Db\Adapter\PdoAdapter->execute()
#2 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(611): Phinx\Db\Util\AlterInstructions->execute()
#3 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php(972): Phinx\Db\Adapter\PdoAdapter->executeAlterSteps()
#4 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(484): Phinx\Db\Adapter\PdoAdapter->executeActions()
#5 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/TimedOutputAdapter.php(420): Phinx\Db\Adapter\AdapterWrapper->executeActions()
#6 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/AdapterWrapper.php(484): Phinx\Db\Adapter\TimedOutputAdapter->executeActions()
#7 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Plan/Plan.php(151): Phinx\Db\Adapter\AdapterWrapper->executeActions()
#8 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(715): Phinx\Db\Plan\Plan->execute()
#9 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(623): Phinx\Db\Table->executeActions()
#10 /var/www/passbolt/vendor/cakephp/migrations/src/Table.php(152): Phinx\Db\Table->update()
#11 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Table.php(682): Migrations\Table->update()
#12 /var/www/passbolt/config/Migrations/20220809190030_V372ImproveFoldersRelationsIndexesAddItemsToUserTreePerformance.php(41): Phinx\Db\Table->save()
#13 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager/Environment.php(111): V372ImproveFoldersRelationsIndexesAddItemsToUserTreePerformance->up()
#14 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(385): Phinx\Migration\Manager\Environment->executeMigration()
#15 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Migration/Manager.php(359): Phinx\Migration\Manager->executeMigration()
#16 /var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Console/Command/Migrate.php(122): Phinx\Migration\Manager->migrate()
#17 /var/www/passbolt/vendor/cakephp/migrations/src/Command/Phinx/CommandTrait.php(37): Phinx\Console\Command\Migrate->execute()
#18 /var/www/passbolt/vendor/cakephp/migrations/src/Command/Phinx/Migrate.php(85): Migrations\Command\Phinx\Migrate->parentExecute()
#19 /var/www/passbolt/vendor/symfony/console/Command/Command.php(298): Migrations\Command\Phinx\Migrate->execute()
#20 /var/www/passbolt/vendor/symfony/console/Application.php(1028): Symfony\Component\Console\Command\Command->run()
#21 /var/www/passbolt/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand()
#22 /var/www/passbolt/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#23 /var/www/passbolt/vendor/cakephp/migrations/src/Command/MigrationsCommand.php(126): Symfony\Component\Console\Application->run()
#24 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/BaseCommand.php(179): Migrations\Command\MigrationsCommand->execute()
#25 /var/www/passbolt/vendor/cakephp/migrations/src/Command/MigrationsCommand.php(198): Cake\Console\BaseCommand->run()
#26 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/BaseCommand.php(271): Migrations\Command\MigrationsCommand->run()
#27 /var/www/passbolt/src/Command/DatabaseAwareCommandTrait.php(62): Cake\Console\BaseCommand->executeCommand()
#28 /var/www/passbolt/src/Command/MigrateCommand.php(82): App\Command\MigrateCommand->runMigrationsMigrateCommand()
#29 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/BaseCommand.php(179): App\Command\MigrateCommand->execute()
#30 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/CommandRunner.php(334): Cake\Console\BaseCommand->run()
#31 /var/www/passbolt/vendor/cakephp/cakephp/src/Console/CommandRunner.php(172): Cake\Console\CommandRunner->runCommand()
#32 /var/www/passbolt/bin/cake.php(12): Cake\Console\CommandRunner->run()
#33 {main}

Do you have any idea to find an issue ?

Thanks for advance,

Regards,

Quentin

Hey @q.prestavoine welcome to the community forum!

Based on the table in question it looks like you have the Pro version of Passbolt. If you’ve got a valid subscription and you’d like to you can contact us directly at support@passbolt.com to work with you on this.

Just to collect a bit more information on this could you let me know which version of MySQL/MariaDB you are using for this?

Also, what is the output of running SHOW INDEX FROM folders_relations; on the database?

Hello @clayton,

Spoke with @q.prestavoine and we got through this migration and update. Posting the steps below just so anyone who searches this out can see what was done.

First step was

git pull origin master

on the passbolt directory
Then edited the Migrations/20220809190030_V372ImproveFoldersRelationsIndexesAddItemsToUserTreePerformance.php file to remove the migrations that were stuck, in this case it was lines 17 through 41

Then did the migrations manually by running the following in MySQL on the passbolt database:

DROP INDEX foreign_id ON folders_relations;
DROP INDEX foreign_id_2 ON folders_relations;
CREATE INDEX foreign_id ON folders_relations (foreign_id, folder_parent_id, created);

Then proceeded with the update instructions from here

1 Like