# Backup database error

**URL:** <https://community.passbolt.com/t/backup-database-error/8646>\
**Category:** Installation Issues\
**Created:** [October 13, 2023, 8:03am UTC](https://community.passbolt.com/t/backup-database-error/8646 "2023-10-13T08:03:18Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salazar](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Salazar](https://community.passbolt.com/u/Salazar)\
**Post date:** [October 13, 2023, 8:03am UTC](https://community.passbolt.com/t/backup-database-error/8646/1 "2023-10-13T08:03:18Z")

</div>

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](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:

```auto
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

---

<div class="post-metadata">

**Author:** ![antony](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/antony/32/3130_2.png) [@antony](https://community.passbolt.com/u/antony)\
**Post date:** [October 13, 2023, 8:08am UTC](https://community.passbolt.com/t/backup-database-error/8646/2 "2023-10-13T08:08:53Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Salazar](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Salazar](https://community.passbolt.com/u/Salazar)\
**Post date:** [October 13, 2023, 8:13am UTC](https://community.passbolt.com/t/backup-database-error/8646/3 "2023-10-13T08:13:35Z")

</div>

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:

 ![001](https://canada1.discourse-cdn.com/flex031/uploads/passbolt/original/2X/4/4fec37dd306ce6d8790d32b1d74549e5017cfd0c.png)

---

<div class="post-metadata">

**Author:** ![antony](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/antony/32/3130_2.png) [@antony](https://community.passbolt.com/u/antony)\
**Post date:** [October 13, 2023, 8:14am UTC](https://community.passbolt.com/t/backup-database-error/8646/4 "2023-10-13T08:14:41Z")

</div>

Thanks for the screenshot!

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

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

```

---

<div class="post-metadata">

**Author:** ![Salazar](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Salazar](https://community.passbolt.com/u/Salazar)\
**Post date:** [October 13, 2023, 8:18am UTC](https://community.passbolt.com/t/backup-database-error/8646/5 "2023-10-13T08:18:45Z")

</div>

I get the same error when I use your suggestion:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/passbolt/original/2X/3/3477e41e504a19d40e600161103434e5a5866552.png)

---

<div class="post-metadata">

**Author:** ![antony](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/antony/32/3130_2.png) [@antony](https://community.passbolt.com/u/antony)\
**Post date:** [October 13, 2023, 8:44am UTC](https://community.passbolt.com/t/backup-database-error/8646/6 "2023-10-13T08:44:04Z")

</div>

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

```auto
mysql --version

```

Have you configured tablespaces in your MySQL database?

- Yes → You should add the [process](https://dev.mysql.com/doc/refman/8.0/en/privileges-provided.html#priv_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](https://www.passbolt.com/blog/backup-using-bash) will make your life easier 😉

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

---

<div class="post-metadata">

**Author:** ![Salazar](https://avatars.discourse-cdn.com/v4/letter/s/bbce88/32.png) [@Salazar](https://community.passbolt.com/u/Salazar)\
**Post date:** [October 13, 2023, 8:57am UTC](https://community.passbolt.com/t/backup-database-error/8646/7 "2023-10-13T08:57:26Z")

</div>

I’m running this version:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/passbolt/original/2X/9/9888d334d45ebff156ffef5491c8d3d78daea134.png)

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

---

<div class="post-metadata">

**Author:** ![cefotetan](https://avatars.discourse-cdn.com/v4/letter/c/51bf81/32.png) [@cefotetan](https://community.passbolt.com/u/cefotetan)\
**Post date:** [November 13, 2023, 6:13am UTC](https://community.passbolt.com/t/backup-database-error/8646/8 "2023-11-13T06:13:26Z")

</div>

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:

```auto
$ 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](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](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

---

<div class="post-metadata">

**Author:** ![m.grosshauser](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@m.grosshauser](https://community.passbolt.com/u/m.grosshauser)\
**Post date:** [December 5, 2023, 12:55pm UTC](https://community.passbolt.com/t/backup-database-error/8646/9 "2023-12-05T12:55:06Z")

</div>

I came along the same error message and created a GitHub issue: [Error message with mysql backup task · Issue #502 · passbolt/passbolt\_api · GitHub](https://github.com/passbolt/passbolt_api/issues/502)

---

<div class="post-metadata">

**Author:** ![LeXwDeX](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.passbolt.com/lexwdex/32/3737_2.png) [@LeXwDeX](https://community.passbolt.com/u/LeXwDeX)\
**Post date:** [February 27, 2024, 1:51pm UTC](https://community.passbolt.com/t/backup-database-error/8646/10 "2024-02-27T13:51:44Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![clayton](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@clayton](https://community.passbolt.com/u/clayton)\
**Post date:** [February 28, 2024, 7:27am UTC](https://community.passbolt.com/t/backup-database-error/8646/11 "2024-02-28T07:27:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![looserouting](https://avatars.discourse-cdn.com/v4/letter/l/7bcc69/32.png) [@looserouting](https://community.passbolt.com/u/looserouting)\
**Post date:** [June 28, 2024, 10:48am UTC](https://community.passbolt.com/t/backup-database-error/8646/12 "2024-06-28T10:48:12Z")

</div>

If don’t need to dump tablespaces, there is --no-tablespaces option which could be used
