Gnupg issue following install (500 server error)

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

  • Passbolt Version: Latest Git
  • Platform and Target:
    – Operating system: Ubuntu Server 20.04
    – PHP: 8.0.5
    – Web server: Apache
    – Database server: MariaDB

What you did

Ran through entire installation process. Everything installed without errors.

(was using tutorial from LB How to Install Passbolt Password Manager on Ubuntu 20.04 Server - Don’t use docker and was the most complete LAMP tutorial and the official tutorial uses nginx)

What happened

However, on visiting the domain I am getting http error 500

image

Apache error log is showing:

[Fri May 28 20:09:24.849966 2021] [mpm_prefork:notice] [pid 25589] AH00169: caught SIGTERM, shutting down
[Fri May 28 20:09:24.974736 2021] [mpm_prefork:notice] [pid 29763] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Fri May 28 20:09:24.974781 2021] [core:notice] [pid 29763] AH00094: Command line: '/usr/sbin/apache2'
[Fri May 28 20:09:38.736439 2021] [proxy_fcgi:error] [pid 29768] [client 141.101.104.159:65304] AH01071: Got error 'PHP message: PHP Fatal error:  You must enable the gnupg extension to use Passbolt. in /var/www/passbolt/config/requirements.php on line 31'
[Fri May 28 20:09:41.853819 2021] [proxy_fcgi:error] [pid 29769] [client 141.101.104.159:14128] AH01071: Got error 'PHP message: PHP Fatal error:  You must enable the gnupg extension to use Passbolt. in /var/www/passbolt/config/requirements.php on line 31'

However,

php --info | grep 'gnupg support'

is returning

gnupg support => enabled

I have checked that

extension=gnupg.so

is present in both /etc/php/8.0/apache2/php.ini and /etc/php/8.0/cli/php.ini

Edit: also /etc/php/8.0/fpm/php.ini as thats where phpini says its using

i have also tried replacing that with

extension=/usr/lib/php/20200930/gnupg.so

Just as a test i commented out the gnupg line in requirements.php just to see if everything else was working and passbolt loaded with the install process but of course jammed when it came to…

image

So everything has installed ok and is working as it should except for gnupg.

Also checked extension directory

php -r "print phpinfo();" | grep "extension_dir"

which results in

extension_dir => /usr/lib/php/20200930 => /usr/lib/php/20200930
sqlite3.extension_dir => no value => no value

Its present there

image

Healthcheck

The only errors in the healthcheck look to be caused by the http 500 error as healthcheck cannot connect to the installation. All the gpg stuff is fine.

Environment

 [PASS] PHP version 8.0.5.
 [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://url-removed
 [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] 25 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 (3.1.0).
 [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!

Finally, gnupg is NOT appearing as active on phpinfo

<?php phpinfo(); ?>

but

php -r 'var_dump(function_exists("gnupg_decrypt"));';

returns

bool(true)

ive also tried fully reinstalling both php-gnupg from apt, and gnupg via pecl

Build process completed successfully
Installing '/usr/lib/php/20200930/gnupg.so'
install ok: channel://pecl.php.net/gnupg-1.5.0
configuration option "php_ini" is not set to php.ini location
You should add "extension=gnupg.so" to php.ini

ok, I have no idea what I have done, but somehow by smacking this hard enough and for long enough, It is actually loading…

The last thing i did was reinstalling apache-fpm and forcibly re-enabling it and it was shortly after that things started working, so possibly somehow fpm related :S

1 Like