Exception: SQLSTATE[HY000] [2002] Connection refused

Open source password manager for teams

Healthcheck shell

Environment

[PASS] PHP version 7.0.33-0+deb9u7.
[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.
[PASS] The logs directory and its content are writable.
[PASS] GD or Imagick extension is installed.
[PASS] Intl extension is installed.
[PASS] Mbstring extension is installed.

Config files

[PASS] The application config file is present
[PASS] The passbolt config file is present

Core config

[PASS] Debug mode is off.
[PASS] Cache is working.
[PASS] Unique value set for security.salt
[PASS] Full base url is set to https://pwd.lxxx.fr
[PASS] App.fullBaseUrl validation OK.
[FAIL] Could not reach the /healthcheck/status with the url specified in App.fullBaseUrl
[HELP] Check that the domain name is correct in config/passbolt.php
[HELP] Check the network settings

SSL Certificate

[FAIL] SSL peer certificate does not validate
[FAIL] Hostname does not match when validating certificates.
[WARN] Using a self-signed certificate

Database

[PASS] The application is able to connect to the database
[PASS] 24 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 environment variable GNUPGHOME is set to /var/www/.gnupg.
[PASS] The directory /var/www/.gnupg containing the keyring is writable by the webserver user.
[PASS] The server gpg key is not the default one
[PASS] The public key file is defined in config/passbolt.php and readable.
[PASS] The private key file is defined in config/passbolt.php and readable.
[PASS] The server key fingerprint matches the one defined in config/passbolt.php.
[PASS] The server public key defined in the config/passbolt.php (or environment variables) 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 a message.
[PASS] The private key can be used to sign a message.
[PASS] The public and private keys can be used to encrypt and sign a message.
[PASS] The private key can be used to decrypt a message.
[PASS] The private key can be used to decrypt and verify a message.
[PASS] The public key can be used to verify a signature.

Application configuration

[PASS] Using latest passbolt version (2.12.1).
[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.

3 error(s) found. Hang in there!

Hi all,

I’ve installed Passbolt in 2018 from 1.0.12 on a Debian 9, and followed the life project till 2.12.1 …

The system works perfectly, a real pleasure to use. Didn’t find any problem during the use, but, since severals weeks, i receive mail notifications from my Passbolt Server
(su -c “/var/www/passbolt/bin/cake EmailQueue.sender >> /var/log/passbolt.log” -s /bin/bash www-data):

Exception: SQLSTATE[HY000] [2002] Connection refused in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 92]
su: Cannot make/remove an entry for the specified session    

I don’t understand why, and what are the consequences ?

Could you please give me some help ?

Best regards

1 Like

Hi @vig

Thanks for your kind words about passbolt! We really appreciate them.

Let me understand one thing about your message. The error you posted comes from manually executing su -c “/var/www/passbolt/bin/cake EmailQueue.sender >> /var/log/passbolt.log” -s /bin/bash www-data ?

Hi Diego,

Thank you for your quick reply,

this command is executed by a cron every minute to send mail.

Sorry I think there is a misunderstanding. What I meant is have you tried to run that command manually and check if you get an error?

Considering the healthcheck log you posted where the database connection seems to work it looks like the environment when executing the cron job has some problems.

oh sorry,

yes i tried to run it manually, and didn’t get any error. It appear only with Cron.

Do you think this is a False Positive error message ?

Hi @vig,

Which user is running the cron job?

Hi Diego,

This is ROOT Cron job.

Considering the su message you see let’s try try the following:

Define a system wide cron job in /etc/crontab like this:

* * * * * www-data /var/www/passbolt/bin/cake EmailQueue.sender

Of course disable your old cron job :smiley:

Thank you very Much for your help Dear Diego.

I’m going to test this solution.

I will keep you in touch.

Cheers

1 Like

Hi,

so, i did the modification with www-data cron job.

Now i’m getting this error :

PHP Notice:  PDO::__construct(): send of 119 bytes failed with errno=32 Broken pipe in /var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php on line 92
Exception: SQLSTATE[HY000] [2006] MySQL server has gone away in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 92]

Regards

It is a bit weird your issue,

Could it be there is no enough memory on the server for your setup?
Do you have any mysql error log?

The server is big enough, with 8 Go of Memory and huge free disk space.

About MySQL Error, nothing .

Which user is supposed to own Driver.php ?

If you run on debian nginx and apache should use www-data as user to run. So the www-data user should be able to read and execute most of the passbolt files.
Some of these files www-data requires permission to write such as the files under the /var/www/passbolt/tmp directory, the logs and the public images directory /var/www/passbolt/webroot/img/public

Easiest solution is to make www-data owner of all the passbolt files.

Hi Diego,

How are you doing ?

So i’ve check permission, everything is ok, files are owned by www-data.

Still have 3 or 4 error messages per day.

Warning Error: PDO::beginTransaction(): MySQL server has gone away in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 184]

 2020-04-29 23:25:37 Warning: Warning (2): PDO::beginTransaction(): MySQL server has gone away in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 184]


Warning Error: PDO::beginTransaction(): Error reading result set's header in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 184]

2020-04-29 23:25:41 Warning: Warning (2): PDO::beginTransaction(): Error reading result set's header in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 184]


Exception: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in [/var/www/passbolt/vendor/cakephp/cakephp/src/Database/Driver.php, line 184]

There is no error in mariadb logs.

I don’t have any idea.

Could it be your datbase server having issues?

https://dev.mysql.com/doc/refman/8.0/en/gone-away.html

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