Migration error on upgrade from 1.6.10 to 2.0.7

Checklist
[x] I have read intro post: About the Installation Issues category
[x] I have read the tutorials, help and searched for similar issues
[x] I provide relevant information about my server (component names and versions, etc.)
[x] I provide a copy of my logs and healthcheck
[x] I describe the steps I have taken to trouble shoot the problem
[x] I describe the steps on how to reproduce the issue

System:
Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux
passbolt 1.6.10 with database schema 1.6.1 (./app/Console/cake Migrations.migration status)

www-data@passbolt:~/passbolt$ ./app/Console/cake Migrations.migration status
Cake Migration Shell
---------------------------------------------------------------
Application

Current version:
  #1498311597 1498311597_Migration_1.6.1
Latest version:
  #1498311597 1498311597_Migration_1.6.1
---------------------------------------------------------------
Migrations Plugin

Current version:
  #003 003_increase_class_name_length
Latest version:
  #003 003_increase_class_name_length
---------------------------------------------------------------

and

$ cat app/Config/version.php  | grep number
'number' => '1.6.10'

After upgrade following this directions (https://help.passbolt.com/hosting/upgrade/ce/upgrade-ce.html)
I got stuck in the migrate step with this error:

www-data@passbolt:~/passbolt$ ./bin/cake passbolt migrate

     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
---------------------------------------------------------------
 Running migration scripts.
---------------------------------------------------------------
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

 == 20180413171600 V202ForceColumnsCharset: migrating
Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'foreign_key' in 'comments' in [/var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/PdoAdapter.php, line 338]
2018-06-11 15:32:30 Warning: The connection is going to be closed but there is an active transaction.

Looks like some migration steps are missing. Is it okay that the database version of the tag1.6.10 is 1.6.1 in the first place?

This is the healthcheck of my 1.6.10 installation:

www-data@passbolt:~/passbolt$ ./app/Console/cake passbolt healthcheck
---------------------------------------------------------------
     ____                  __          ____
    / __ \____  _____ ____/ /_  ____  / / /_
   / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
  / ____/ /_/ (__  |__  ) /_/ / /_/ / / /
 /_/    \__,_/____/____/_.___/\____/_/\__/

 Open source password manager for teams
---------------------------------------------------------------
 Healthcheck shell
---------------------------------------------------------------

 Environment

 [PASS] PHP version 7.0.27-0+deb9u1
 [PASS] PCRE compiled with unicode support
 [PASS] The temporary directory and its content are writable
 [PASS] The public image directory and its content are writable

 Config files

 [PASS] The core config file is present
 [PASS] The database config file is present
 [PASS] The email config file is present
 [PASS] The application config file is present

 Core config

 [PASS] Debug mode is off.
 [PASS] Cache is working.
 [PASS] Unique value set for security.salt
 [PASS] Unique value set for security.cipherSeed
 [PASS] Full base url is set to https://passbolt.dienesgroup.local
 [PASS] App.fullBaseUrl validation OK.
 [PASS] /healthcheck/status is reachable.

 SSL Certificate

 [FAIL] SSL peer certificate does not validate
 [FAIL] Hostname does not match when validating certificates.
 [WARN] Using a self-signed certificate
  [HELP] stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
stream_socket_client(): Failed to enable crypto
stream_socket_client(): unable to connect to ssl://passbolt.dienesgroup.local:443 (Unknown error)

 Database

 [PASS] Configured to use a supported database backend
 [PASS] The application is able to connect to the database
 [PASS] Not using a prefix for database tables
 [PASS] 23 tables found
 [PASS] Some default content is present
 [PASS] The database schema up to date.

 GPG Configuration

 [PASS] PHP GPG Module is installed and loaded
 [PASS] The server gpg key is not the default one
 [PASS] The environment variable GNUPGHOME is set to /var/www/.gnupg
 [PASS] The directory /var/www/.gnupg containing the keyring is writable by the user the webserver is running as.
 [PASS] The public key file is defined in app/config.php and readable.
 [PASS] The private key file is defined in app/config.php and readable.
 [PASS] The server key fingerprint matches the one defined in app/config.php.
 [PASS] The server key defined in the app/Config.php is in the keyring.
 [PASS] There is a valid email id defined for the server key.
 [PASS] The public key can be used to encrypt and sign a message.
 [PASS] The private key can be used to decrypt a message.

 Application configuration

 [FAIL] This installation is not up to date. Currently using 1.6.10 and it should be v2.0.7.
  [HELP] See. https://www.passbolt.com/help/tech/update
 [PASS] Passbolt is configured to force SSL use
 [PASS] App.fullBaseUrl is set to HTTPS
 [PASS] Selenium API endpoints are disabled.
 [PASS] Search engine robots are told not to index content.
 [PASS] Registration is closed, only administrators can add users.
 [PASS] Serving the compiled version of the javascript app
 [PASS] All email notifications will be sent.

 Development Tools (optional)

 [PASS] Phpunit is installed
 [PASS] Phpunit version is 3.7.38

  3 error(s) found. Hang in there!

hello @saschaludwigdienes,

There is an issue indeed, as the migration process should not to start with the task

 == 20180413171600 V202ForceColumnsCharset: migrating

It should start with task 20170830064410_V162InitialMigration.php

So either the files in config/migrations are missing, or they cannot be run (or maybe you already ran them before with errors?). Check if the files are present, check the permissions, make sure there is nobody else connected to the db, try to revert to your original 1.6.10 database backup and run the migration scripts again.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.