Backup database error

First of all, I wanted to say that Passbolt is one hell of a application. It works beautifully, great support and very clear documentation. Despite that I do run into a issue, but I think it’s something that I’m not getting, haha.

I want to backup the database only to a remote location. I followed this: https://help.passbolt.com/hosting/backup/package.html. I copied the command from the above linkt, but even though it says it’s a success, I get the following error every time:

mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces

I think it has something to do with the WEB_SERVER_USER that you need to enter, but no matter what user I put in, the error remains. This is the list of users I tried:

  • root
  • passbolt_db_user
  • nginx
  • passbolt
  • mysql

When I use the user mysql or passbolt, I got the following error:

PHP Warning:  require(/etc/passbolt/requirements.php): Failed to open stream: Permission denied in /usr/share/php/passbolt/bin/cake.php on line 4
PHP Fatal error:  Uncaught Error: Failed opening required '/etc/passbolt/requirements.php' (include_path='.:/usr/share/php') in /usr/share/php/passbolt/bin/cake.php:4
Stack trace:
#0 {main}
  thrown in /usr/share/php/passbolt/bin/cake.php on line 4

What am I missing or can I exclude tablespaces like I can if I used the mysqldump command? I already searched the forum, but couldn’t find a similar issue.

P.S. I’m connected to my server as root

2 Likes

Hello @Salazar, thanks for your kind message, it means a lot to all of our community!

Since you tried nginx as the webserver user, can you confirm that you are using a rpm distribution? Also, could you share a screenshot from the output where it says “success” after running the command?

Hi antony,

I’m not sure how I can confirm that. I’m using Unbuntu 22.04-3 as my distro and I installed Passbolt via apt install.

Here’s the screenshot:

Thanks for the screenshot!

Since you are using ubuntu, nginx’s webserver username should be www-data, could you try to run:

su -s /bin/bash -c "/usr/share/php/passbolt/bin/cake passbolt mysql_export" www-data

I get the same error when I use your suggestion:

I guess you are running MySQL > 5.7.31, just to confirm could you run:

mysql --version

Have you configured tablespaces in your MySQL database?

  • Yes → You should add the process privilege, however it’s important to note that there is no tablespaces configured by default in the passbolt database
  • No → You could run the mysqldump command with the --no-tablespaces option
    • mysqldump -u [passbolt_db_user] -p --no-tablespaces [passbolt_db_name] > [output_file.sql]

In the meantime, I’m pretty sure that this blog article will make your life easier :wink:

Finally, even if it displays an error, the file containing the data should still be accessible in the outputed path.

1 Like

I’m running this version:

Thank you for that link. It will certainly make my life a lot easier, hehe. :wink:

Hello,

unfortunately this not a solution to the problem itself, but rather the error output is “hidden” in the more verbose output of the script. Under the hood, the backup script executes the exact same command that leads to the same behavior. See the output of the backup script:

$ sudo ./backup.sh 
+------------------------------------------------------------------------------------------+
Docker not detected
+------------------------------------------------------------------------------------------+
Taking database backup and storing in /tmp/backup-2023-11-13--06-15-26
+------------------------------------------------------------------------------------------+

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

 Open source password manager for teams
-------------------------------------------------------------------------------
Saving backup file: /tmp/backup-2023-11-13--06-15-26/backup_1699856126.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
Success: the database was saved on file!
+------------------------------------------------------------------------------------------+
Copying /etc/passbolt/passbolt.php to /tmp/backup-2023-11-13--06-15-26
+------------------------------------------------------------------------------------------+
Copying /etc/passbolt/gpg/serverkey_private.asc to /tmp/backup-2023-11-13--06-15-26
+------------------------------------------------------------------------------------------+
Copying /etc/passbolt/gpg/serverkey.asc to /tmp/backup-2023-11-13--06-15-26
+------------------------------------------------------------------------------------------+
Creating archive of /tmp/backup-2023-11-13--06-15-26
+------------------------------------------------------------------------------------------+
./
./passbolt.php
./serverkey.asc
./backup_1699856126.sql
./serverkey_private.asc
+------------------------------------------------------------------------------------------+
Cleaning up /tmp
+------------------------------------------------------------------------------------------+
Backup completed you can find the file as /tmp/backup-2023-11-13--06-15-26.tar.gz
+------------------------------------------------------------------------------------------+

My system is similar to the OP’s one, I installed on a Ubuntu 22 server with the deb installation method, and I let the installer create the db tables as well as the user for me. I would prefer to not manually change settings that the installer chose for me; I’d expect it to end in a consistent state.

To my understanding, the error itself is not related to the webserver user, but rather to the tablespaces options, see https://dba.stackexchange.com/questions/271981/access-denied-you-need-at-least-one-of-the-process-privileges-for-this-ope

So I’d expect

  • either the installer to assign correct permissions to the db user
  • or the backup routine to pass the parameter if this feature is not required

Unfortunately, from the Github tour document (https://github.com/passbolt) it is not clear to me in which repository to file an issue for that, because there is none mentioned that is responsible for the deb package creation. Some help here would be appreciated.

Regards

I came along the same error message and created a GitHub issue: Error message with mysql backup task · Issue #502 · passbolt/passbolt_api · GitHub

I encountered the same error and then I had to add authorization to passboltdb’s database account.

GRANT PROCESS ON *. * TO 'passboltadmin'@'localhost';
FLUSH PRIVILEGES;

That will clear the error from appearing but that permission isn’t required for passbolt to function properly so I would recommend against that to keep with the principle of least privilege.

The backup will still be what you need despite that error message appearing