Currently trying to start up the docker compose version.
Sadly it fails when starting up the passbolt container declaring
“Exception: There was a problem connecting to the database: SQLSTATE[HY000] [2006] MySQL server has gone away in [/var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php, line 127]”
This is literally a fresh version of passbolt (2.11 pb db 10.3).
Currently not sure how to resolve this:
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Using Linux native AIO
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Uses event mutexes
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Number of pools: 1
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Using SSE2 crc32 instructions
passbolt_1 | wait-for.sh: waiting 15 seconds for db:3306
passbolt_1 | wait-for.sh: db:3306 is available after 0 seconds
passbolt_1 | gpg: directory '/home/www-data/.gnupg' created
passbolt_1 | gpg: keybox '/home/www-data/.gnupg/pubring.kbx' created
passbolt_1 | gpg: /home/www-data/.gnupg/trustdb.gpg: trustdb created
passbolt_1 | gpg: key B25645F68E67FDD0: public key "Passbolt default user <passbolt@yourdomain.com>" imported
passbolt_1 | gpg: Total number processed: 1
passbolt_1 | gpg: imported: 1
passbolt_1 | gpg: key B25645F68E67FDD0: "Passbolt default user <passbolt@yourdomain.com>" not changed
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
passbolt_1 | gpg: key B25645F68E67FDD0: secret key imported
passbolt_1 | gpg: Total number processed: 1
passbolt_1 | gpg: unchanged: 1
passbolt_1 | gpg: secret keys read: 1
passbolt_1 | gpg: secret keys imported: 1
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Completed initialization of buffer pool
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Creating shared tablespace for temporary tables
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Waiting for purge to start
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: 10.3.18 started; log sequence number 10563611; transaction id 9125
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
db_1 | 2019-09-24 12:49:30 0 [Note] Plugin 'FEEDBACK' is disabled.
db_1 | 2019-09-24 12:49:30 0 [Note] Server socket created on IP: '::'.
db_1 | 2019-09-24 12:49:30 0 [Warning] 'user' entry 'root@40e0d9d08697' ignored in --skip-name-resolve mode.
db_1 | 2019-09-24 12:49:30 0 [Warning] 'user' entry '@40e0d9d08697' ignored in --skip-name-resolve mode.
db_1 | 2019-09-24 12:49:30 0 [Warning] 'proxies_priv' entry '@% root@40e0d9d08697' ignored in --skip-name-resolve mode.
db_1 | 2019-09-24 12:49:30 0 [Note] Reading of all Master_info entries succeeded
db_1 | 2019-09-24 12:49:30 0 [Note] Added new Master_info '' to hash table
db_1 | 2019-09-24 12:49:30 0 [Note] mysqld: ready for connections.
db_1 | Version: '10.3.18-MariaDB-1:10.3.18+maria~bionic' socket: '/var/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
db_1 | 2019-09-24 12:49:30 0 [Note] InnoDB: Buffer pool(s) load completed at 190924 12:49:30
passbolt_1 | Generating a RSA private key
passbolt_1 | ..........................................................................................++++
passbolt_1 | ............................................................++++
passbolt_1 | writing new private key to '/etc/ssl/certs/certificate.key'
passbolt_1 | -----
passbolt_1 |
passbolt_1 | ____ __ ____
passbolt_1 | / __ \____ _____ ____/ /_ ____ / / /_
passbolt_1 | / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
passbolt_1 | / ____/ /_/ (__ |__ ) /_/ / /_/ / / /
passbolt_1 | /_/ \__,_/____/____/_.___/\____/_/\__/
passbolt_1 |
passbolt_1 | Open source password manager for teams
passbolt_1 | ---------------------------------------------------------------
passbolt_1 |
passbolt_1 | Running baseline checks, please wait...
passbolt_1 | Exception: SQLSTATE[HY000] [2006] MySQL server has gone away in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 92]
passbolt_1 |
passbolt_1 | ____ __ ____
passbolt_1 | / __ \____ _____ ____/ /_ ____ / / /_
passbolt_1 | / /_/ / __ `/ ___/ ___/ __ \/ __ \/ / __/
passbolt_1 | / ____/ /_/ (__ |__ ) /_/ / /_/ / / /
passbolt_1 | /_/ \__,_/____/____/_.___/\____/_/\__/
passbolt_1 |
passbolt_1 | Open source password manager for teams
passbolt_1 | ---------------------------------------------------------------
passbolt_1 | Running migration scripts.
passbolt_1 | ---------------------------------------------------------------
passbolt_1 | using migration paths
passbolt_1 | - /var/www/passbolt/config/Migrations
passbolt_1 | using seed paths
passbolt_1 | - /var/www/passbolt/config/Seeds
passbolt_1 | Exception: There was a problem connecting to the database: SQLSTATE[HY000] [2006] MySQL server has gone away in [/var/www/passbolt/vendor/robmorgan/phinx/src/Phinx/Db/Adapter/MysqlAdapter.php, line 127]
passbolt_docker_passbolt_1 exited with code 1
Obviously it’s to do with the DB, but as all I have installed is rng-tools and run the docker compose file I expected it to just work
Hi @diego done a complete systems clean. Removed the repo did a fresh pull, did a full systems prune (docker system prune -af) and removed all volumes. So have a completely clean docker system now. Still get the same problem, also just to note do have instaled rng-tools.
Still able to reproduce it using “docker system prune -af --volume”. However if I also add restart: always, it does now get into the right state (same as you said earlier, first time it fails second time it works).
This wasn’t the case previously but for a temporary measure this works, going to mess with the sleep time see if I can get it building first time.
Let me know if you require any further information.
restart: always works on my side, it fails contacting the db but it restarts and works.
Looks to me that all this is boiling down to wait-for not identifying correctly that mariadb is ready.
This has been a discussion in the docker github repo https://github.com/passbolt/passbolt_docker/pull/123
As mentioned on the PR I kind of like more the approach of letting the containers to fail and restart until the system reaches a ready state. Considering that one of the first checks the passbolt container does is trying to connect with the DB seems reasonable for me.
Last check:
add restart: always to passbolt container on docker-compose.yml and remove command: section from passbolt container
Yea works currently with “restart: always” just the same as you, fails to find the db, then recovers.
Personally much prefer it to not fail at all, but know the fun of trying to have a db ready can be a pain. Either way thanks for helping to get it rolling.
I think this would qualify as a enhancement to say the least on the passbolt_docker repo. Would you mind to create an issue so I can tackle it when there is some bandwidth?
At least this way users could come to this thread and find some solutions on the meantime.
Would be nice also to able to use the installation wizard inside the container as makes my life easier rather than using having to remember to have env vars set.
For others finding this post use the below compose file to get passbolt to work with docker compose: