snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.08k stars 3.18k forks source link

Backup failed #14450

Closed mauro-miatello closed 7 months ago

mauro-miatello commented 7 months ago

Debug mode

Describe the bug

I've this error when trying to run backup:

Backup failed because The dump process failed with exitcode 2 : Misuse of shell builtins : mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need (at least one of) the RELOAD or FLUSH_TABLES privilege(s) for this operation (1227) .

it is an issue discussed also https://github.com/snipe/snipe-it/issues/12427 https://github.com/snipe/snipe-it/issues/12569 https://github.com/snipe/snipe-it/issues/13155

however, I use AWS RDS and I can't give my user (that is not the master user) the right privileges:

mysql> grant FLUSH on assets.* to 'assets'@'%'; ERROR 3619 (HY000): Illegal privilege level specified for FLUSH mysql> grant RELOAD on assets.* to 'assets'@'%'; ERROR 1221 (HY000): Incorrect usage of DB GRANT and GLOBAL PRIVILEGES

usually my script for backups in AWS are like the following: mysqldump -u backup -p -h host --set-gtid-purged=OFF --no-tablespaces

probably you use another system / mechanism / command. do you think this is solvible?

Reproduction steps

use an AWS RDS

Expected behavior

simple run backup from web ui

Screenshots

No response

Snipe-IT Version

v6.3.3 - build 12903

Operating System

ubuntu 20.04

Web Server

apache 2.4.58

PHP Version

8.0.30

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

Backup failed because The dump process failed with exitcode 2 : Misuse of shell builtins : mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need (at least one of) the RELOAD or FLUSH_TABLES privilege(s) for this operation (1227)

Additional context

No response

mauro-miatello commented 7 months ago

I've found https://github.com/spatie/laravel-backup/discussions/1635 my RDS is 8.0.35 I'll investigate

GitHub
Suddenly failing to backup on RDS with 1045 error (Couldn't execute 'FLUSH TABLES WITH READ LOCK':) · spatie laravel-backup · Discussion #1635
The main error Im consistently now getting is: mysqldump: Couldn't execute 'FLUSH TABLES WITH READ LOCK': Access denied for user 'user'@'%' (using password: YES) (1045) This was working perfectly u...
mauro-miatello commented 7 months ago

solved with echo "set-gtid-purged = off" >> /etc/mysql/conf.d/mysqldump.cnf