Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate backup #12427

Closed
2 tasks done
cookierun22 opened this issue Jan 28, 2023 · 32 comments
Closed
2 tasks done

Unable to generate backup #12427

cookierun22 opened this issue Jan 28, 2023 · 32 comments
Assignees

Comments

@cookierun22
Copy link

Debug mode

Describe the bug

Error 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) . #0 /var/www/snipe-it/vendor/spatie/db-dumper/src/DbDumper.php(263): Spatie\DbDumper\Exceptions\DumpFailed::processDidNotEndSuccessfully() #1 /var/www/snipe-it/vendor/spatie/db-dumper/src/Databases/MySql.php(203): Spatie\DbDumper\DbDumper->checkIfDumpWasSuccessFul() #2 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(260): Spatie\DbDumper\Databases\MySql->dumpToFile() #3 [internal function]: Spatie\Backup\Tasks\Backup\BackupJob->Spatie\Backup\Tasks\Backup{closure}() #4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(695): array_map() #5 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(263): Illuminate\Support\Collection->map() #6 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(171): Spatie\Backup\Tasks\Backup\BackupJob->dumpDatabases() #7 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(147): Spatie\Backup\Tasks\Backup\BackupJob->createBackupManifest() #8 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Commands/BackupCommand.php(56): Spatie\Backup\Tasks\Backup\BackupJob->run() #9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Spatie\Backup\Commands\BackupCommand->handle() #10 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() #11 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #12 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod() #13 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call() #14 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Container\Container->call() #15 /var/www/snipe-it/vendor/symfony/console/Command/Command.php(298): Illuminate\Console\Command->execute() #16 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run() #17 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Commands/BaseCommand.php(16): Illuminate\Console\Command->run() #18 /var/www/snipe-it/vendor/symfony/console/Application.php(1024): Spatie\Backup\Commands\BaseCommand->run() #19 /var/www/snipe-it/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand() #20 /var/www/snipe-it/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun() #21 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Application.php(94): Symfony\Component\Console\Application->run() #22 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Application.php(186): Illuminate\Console\Application->run() #23 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(263): Illuminate\Console\Application->call() #24 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Foundation\Console\Kernel->call() #25 /var/www/snipe-it/app/Http/Controllers/SettingsController.php(1110): Illuminate\Support\Facades\Facade::__callStatic() #26 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\SettingsController->postBackups() #27 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction() #28 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch() #29 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController() #30 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\Routing\Route->run() #31 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing{closure}() #32 /var/www/snipe-it/app/Http/Middleware/CheckPermissions.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #33 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckPermissions->handle() #34 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php(58): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #35 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\AuthenticateSession->handle() #36 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #37 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Auth\Middleware\Authenticate->handle() #38 /var/www/snipe-it/app/Http/Middleware/AssetCountForSidebar.php(55): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #39 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\AssetCountForSidebar->handle() #40 /var/www/snipe-it/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #41 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\Passport\Http\Middleware\CreateFreshApiToken->handle() #42 /var/www/snipe-it/app/Http/Middleware/CheckForTwoFactor.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #43 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForTwoFactor->handle() #44 /var/www/snipe-it/app/Http/Middleware/CheckUserIsActivated.php(47): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #45 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckUserIsActivated->handle() #46 /var/www/snipe-it/app/Http/Middleware/CheckLocale.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #47 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckLocale->handle() #48 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #49 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle() #50 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #51 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle() #52 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #53 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle() #54 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #55 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\Pipeline\Pipeline->then() #56 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\Routing\Router->runRouteWithinStack() #57 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRoute() #58 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\Routing\Router->dispatchToRoute() #59 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch() #60 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}() #61 /var/www/snipe-it/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #62 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Livewire\DisableBrowserCache->handle() #63 /var/www/snipe-it/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #64 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle() #65 /var/www/snipe-it/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #66 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle() #67 /var/www/snipe-it/app/Http/Middleware/PreventBackHistory.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #68 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\PreventBackHistory->handle() #69 /var/www/snipe-it/app/Http/Middleware/SecurityHeaders.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #70 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\SecurityHeaders->handle() #71 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #72 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() #73 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle() #74 /var/www/snipe-it/app/Http/Middleware/CheckForDebug.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #75 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForDebug->handle() #76 /var/www/snipe-it/app/Http/Middleware/CheckForSetup.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #77 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForSetup->handle() #78 /var/www/snipe-it/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #79 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle() #80 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #81 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle() #82 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #83 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest() #84 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle() #85 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #86 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle() #87 /var/www/snipe-it/app/Http/Middleware/NoSessionStore.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #88 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\NoSessionStore->handle() #89 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}() #90 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then() #91 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() #92 /var/www/snipe-it/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle() #93 {main} 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) .

Reproduction steps

  1. Sign in to the admin user
  2. Go to the setting>backup
  3. Click on the generate backup
    ...

Expected behavior

The system able to generate the backup file

Screenshots

No response

Snipe-IT Version

v6.0.12

Operating System

Ubuntu

Web Server

Apache

PHP Version

8.1.10

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

Error 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) . #0 /var/www/snipe-it/vendor/spatie/db-dumper/src/DbDumper.php(263): Spatie\DbDumper\Exceptions\DumpFailed::processDidNotEndSuccessfully() #1 /var/www/snipe-it/vendor/spatie/db-dumper/src/Databases/MySql.php(203): Spatie\DbDumper\DbDumper->checkIfDumpWasSuccessFul() #2 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(260): Spatie\DbDumper\Databases\MySql->dumpToFile() #3 [internal function]: Spatie\Backup\Tasks\Backup\BackupJob->Spatie\Backup\Tasks\Backup\{closure}() #4 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(695): array_map() #5 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(263): Illuminate\Support\Collection->map() #6 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(171): Spatie\Backup\Tasks\Backup\BackupJob->dumpDatabases() #7 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Tasks/Backup/BackupJob.php(147): Spatie\Backup\Tasks\Backup\BackupJob->createBackupManifest() #8 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Commands/BackupCommand.php(56): Spatie\Backup\Tasks\Backup\BackupJob->run() #9 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Spatie\Backup\Commands\BackupCommand->handle() #10 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() #11 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure() #12 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod() #13 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call() #14 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Command.php(136): Illuminate\Container\Container->call() #15 /var/www/snipe-it/vendor/symfony/console/Command/Command.php(298): Illuminate\Console\Command->execute() #16 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Command.php(121): Symfony\Component\Console\Command\Command->run() #17 /var/www/snipe-it/vendor/spatie/laravel-backup/src/Commands/BaseCommand.php(16): Illuminate\Console\Command->run() #18 /var/www/snipe-it/vendor/symfony/console/Application.php(1024): Spatie\Backup\Commands\BaseCommand->run() #19 /var/www/snipe-it/vendor/symfony/console/Application.php(299): Symfony\Component\Console\Application->doRunCommand() #20 /var/www/snipe-it/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun() #21 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Application.php(94): Symfony\Component\Console\Application->run() #22 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Console/Application.php(186): Illuminate\Console\Application->run() #23 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(263): Illuminate\Console\Application->call() #24 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Foundation\Console\Kernel->call() #25 /var/www/snipe-it/app/Http/Controllers/SettingsController.php(1110): Illuminate\Support\Facades\Facade::__callStatic() #26 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\SettingsController->postBackups() #27 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction() #28 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch() #29 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController() #30 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(721): Illuminate\Routing\Route->run() #31 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}() #32 /var/www/snipe-it/app/Http/Middleware/CheckPermissions.php(24): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #33 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckPermissions->handle() #34 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/AuthenticateSession.php(58): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #35 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\AuthenticateSession->handle() #36 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Auth/Middleware/Authenticate.php(44): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #37 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Auth\Middleware\Authenticate->handle() #38 /var/www/snipe-it/app/Http/Middleware/AssetCountForSidebar.php(55): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #39 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\AssetCountForSidebar->handle() #40 /var/www/snipe-it/vendor/laravel/passport/src/Http/Middleware/CreateFreshApiToken.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #41 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\Passport\Http\Middleware\CreateFreshApiToken->handle() #42 /var/www/snipe-it/app/Http/Middleware/CheckForTwoFactor.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #43 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForTwoFactor->handle() #44 /var/www/snipe-it/app/Http/Middleware/CheckUserIsActivated.php(47): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #45 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckUserIsActivated->handle() #46 /var/www/snipe-it/app/Http/Middleware/CheckLocale.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #47 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckLocale->handle() #48 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #49 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle() #50 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #51 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle() #52 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #53 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Cookie\Middleware\EncryptCookies->handle() #54 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #55 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(723): Illuminate\Pipeline\Pipeline->then() #56 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(698): Illuminate\Routing\Router->runRouteWithinStack() #57 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(662): Illuminate\Routing\Router->runRoute() #58 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Routing/Router.php(651): Illuminate\Routing\Router->dispatchToRoute() #59 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(167): Illuminate\Routing\Router->dispatch() #60 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}() #61 /var/www/snipe-it/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #62 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Livewire\DisableBrowserCache->handle() #63 /var/www/snipe-it/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #64 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle() #65 /var/www/snipe-it/vendor/fruitcake/laravel-cors/src/HandleCors.php(38): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #66 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fruitcake\Cors\HandleCors->handle() #67 /var/www/snipe-it/app/Http/Middleware/PreventBackHistory.php(23): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #68 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\PreventBackHistory->handle() #69 /var/www/snipe-it/app/Http/Middleware/SecurityHeaders.php(26): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #70 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\SecurityHeaders->handle() #71 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #72 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle() #73 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle() #74 /var/www/snipe-it/app/Http/Middleware/CheckForDebug.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #75 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForDebug->handle() #76 /var/www/snipe-it/app/Http/Middleware/CheckForSetup.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #77 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\CheckForSetup->handle() #78 /var/www/snipe-it/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #79 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle() #80 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #81 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\View\Middleware\ShareErrorsFromSession->handle() #82 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #83 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\Session\Middleware\StartSession->handleStatefulRequest() #84 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Session\Middleware\StartSession->handle() #85 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #86 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle() #87 /var/www/snipe-it/app/Http/Middleware/NoSessionStore.php(28): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #88 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\NoSessionStore->handle() #89 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}() #90 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(142): Illuminate\Pipeline\Pipeline->then() #91 /var/www/snipe-it/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter() #92 /var/www/snipe-it/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle() #93 {main} 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

@RoyMOnZ
Copy link

RoyMOnZ commented Jan 28, 2023

We had same issue after mysql client update to 8.0.32 released January 17
My admin gave our database account reload rights and it worked again, so it's not a snipeit error

Beware, when assigned reload rights it reset all rights to only reload rights we had to assign all the deleted rights again

Hope it works out

@DaLLLi
Copy link

DaLLLi commented Jan 28, 2023

You need
Login

mysql -uroot -p
#then
GRANT FLUSH_TABLES, RELOAD on snipeit.* TO 'snipeit'@'%' WITH GRANT OPTION;
#then
FLUSH privileges;
EXIT;

@snipe snipe assigned uberbrady and jerm and unassigned jerm Jan 28, 2023
@InertiaImpact
Copy link

This was my issue as well, I am using MariaDB v10.6.10 in docker (external db option with the official snipeit docker)

I had to run a slightly different version below -

mysql -uroot -p

GRANT RELOAD ON . TO 'snipeit'@'%';

FLUSH privileges;
EXIT;

@cookierun22
Copy link
Author

May I know how you give the reloads rights? I already tried but it's not working

@DaLLLi
Copy link

DaLLLi commented Feb 1, 2023

IMPORTANT UPDATE:
After the update, the error reappeared.

Login as root and check your databases:

SHOW DATABASES;
Check users:
SELECT User,Host FROM mysql.user;
Inser correct name of user and database
GRANT FLUSH_TABLES, RELOAD on SnipeDatabase.* TO 'SnipeUser'@'%' WITH GRANT OPTION;

Its on mysql 8.0
I hope its help. But a newer version has already come out. Check to see if it has fixed this bug.
Regards

@krispykrunchychicken
Copy link

I have a similar issue and I'm trying to run

GRANT FLUSH_TABLES, RELOAD on SnipeDatabase.* TO 'SnipeUser'@'%' WITH GRANT OPTION;
but I get

ERROR 3619 (HY000): Illegal privilege level specified for FLUSH_TABLES

Do I need to be root for this?

@InertiaImpact
Copy link

InertiaImpact commented Feb 1, 2023

@chickendeathmetal
Replace snipeit with whatever your user is. Below has you logging in as root and running these commands as root.
If you don't know the user, run SELECT user FROM mysql.user;

mysql -uroot -p

GRANT ALL ON *.* TO 'snipeit'@'%';

FLUSH privileges;
EXIT;
You can also try swapping ALL for whatever perms you are having issues with.

@DaLLLi
Copy link

DaLLLi commented Feb 1, 2023

Please update snipeit for newest version.
Now everything works well.

@krispykrunchychicken
Copy link

@chickendeathmetal Replace snipeit with whatever your user is. Below has you logging in as root and running these commands as root. If you don't know the user, run SELECT user FROM mysql.user;

mysql -uroot -p

GRANT ALL ON . TO 'snipeit'@'%';

FLUSH privileges;
EXIT;
You can also try swapping ALL for whatever perms you are having issues with.

It's fixed!

@cookierun22
Copy link
Author

IMPORTANT UPDATE: After the update, the error reappeared.

Login as root and check your databases:

SHOW DATABASES;
Check users:
SELECT User,Host FROM mysql.user;
Inser correct name of user and database
GRANT FLUSH_TABLES, RELOAD on SnipeDatabase.* TO 'SnipeUser'@'%' WITH GRANT OPTION;

Its on mysql 8.0 I hope its help. But a newer version has already come out. Check to see if it has fixed this bug. Regards

I have try the method but the keeps on prompt error "Access denied for user..........."

@cookierun22
Copy link
Author

Please update snipeit for newest version. Now everything works well.

Already updated to version 6.0.14 also, but the problem still appear

@cookierun22
Copy link
Author

@chickendeathmetal Replace snipeit with whatever your user is. Below has you logging in as root and running these commands as root. If you don't know the user, run SELECT user FROM mysql.user;

mysql -uroot -p

GRANT ALL ON . TO 'snipeit'@'%';

FLUSH privileges;
EXIT;
You can also try swapping ALL for whatever perms you are having issues with.

I also have try this method, but cannot works

@Tc-Yang0
Copy link

Tc-Yang0 commented Feb 2, 2023

Anyone else running into:
ERROR 3619 (HY000): Illegal privilege level specified for FLUSH_TABLES
ERROR 1410 (42000): You are not allowed to create a user with GRANT

SnipeIT works fine other than the backup feature.

v6.0.12
PHP 7.4.33
Laravel 8.83.26

@cookierun22
Copy link
Author

Anyone else running into: ERROR 3619 (HY000): Illegal privilege level specified for FLUSH_TABLES ERROR 1410 (42000): You are not allowed to create a user with GRANT

SnipeIT works fine other than the backup feature.

v6.0.12 PHP 7.4.33 Laravel 8.83.26

No, mine with the error:
ERROR 1045 (28000): Access denied for user 'snipeitadmin'@'localhost' (using password: YES)

@thanhtung08
Copy link

Anyone else running into: ERROR 3619 (HY000): Illegal privilege level specified for FLUSH_TABLES ERROR 1410 (42000): You are not allowed to create a user with GRANT

SnipeIT works fine other than the backup feature.

v6.0.12 PHP 7.4.33 Laravel 8.83.26

I got exactly the problem same as you have. I don't know what to do next.

@michael-zukrow-da
Copy link

adding that I'm experiencing the same thing

Is anyone else running any antivirus/security software on their host?

@michael-zukrow-da
Copy link

michael-zukrow-da commented Feb 6, 2023

Found a solution

Issue appears to be related to this: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/2003866

Fix is here: https://snapshooter.com/docs/fixing-mysqldump-couldn-t-execute-flush-tables-access-denied/

Launchpad
As of today, our dump script stopped working. During the night, unattended-upgrades upgraded from 5.7.40 to 5.7.41.

Same happened on 20.04, upgraded from 8.0.31 to 8.0.32.

The changelog doesn't mention any change in permissions handling.
https://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-41.html

Relevant discussion:
https://stackoverflow.com/a/75202033/738852

The error reported is:

mysqldump: Couldn't execute 'FLUSH TABLES': Access denied; you need (at least one of) the RELOAD priv...

SnapShooter
mysqldump upgrade broke mysqldump --single-tranactions backups

@technigogo
Copy link

I have the same issue as the OP. I am using MariaDB. I have tried the above suggestions but have had no joy. Any other ideas? When I try to add the permissions in SQL, I get the error code:
ERROR 1064 (42000): You have an error in your SQL syntax;

@michael-zukrow-da
Copy link

I have the same issue as the OP. I am using MariaDB. I have tried the above suggestions but have had no joy. Any other ideas? When I try to add the permissions in SQL, I get the error code: ERROR 1064 (42000): You have an error in your SQL syntax;

I'm not sure if Maria takes the exact same commands, please also make sure you have edited the user and db name to match your instance

@technigogo
Copy link

I'm not sure if Maria takes the exact same commands, please also make sure you have edited the user and db name to match your instance

I finally got the permissions to take the commands, and my snipeuser now has all prerequisite permissions (I think), but I still get the same issue when attempting to generate backup.

@antonc42
Copy link

I finally got the permissions to take the commands, and my snipeuser now has all prerequisite permissions (I think), but I still get the same issue when attempting to generate backup.

Do your permissions look like this for the user you are using for Snipe-IT?

MariaDB [(none)]> select `User`,`HOST`, `Process_priv`,`Reload_priv` from mysql.user;
+-------------+-----------+--------------+-------------+
| User        | Host      | Process_priv | Reload_priv |
+-------------+-----------+--------------+-------------+
| snipeit     | %         | Y            | Y           |
+-------------+-----------+--------------+-------------+

Did you remember to do the "FLUSH PRIVILEGES;" step after granting the permissions?

MariaDB [(none)]> GRANT RELOAD,PROCESS ON *.* TO 'snipeit'@'%';
Query OK, 0 rows affected (0.004 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

Maybe try clearing the config and cache (I'm just guessing on this part)?

php artisan config:clear
php artisan cache:clear

Maybe try restarting the DB and Snipe-IT (Also just guessing here)?

@technigogo
Copy link

Here are the permissions:

image

I will try the other ideas you have now.

@technigogo
Copy link

I cleared cache - no joy
I restarted the server - no joy

I am running v6.0.14 build 9038. What if I update to the latest build like they have in the Demo? (v6.0.14 - build 9236)
a. Do you think that would help?
b. How do I do that? I have successfully run the php upgrade.php but it doesn't seem to update the build number since I am already on the latest "version".

@antonc42
Copy link

@technigogo
I have one more kinda wild idea. I noticed during one of my tests that when I set the env var "APP_DEBUG=true" and restarted Snipe-IT, I was able to do the backup. It kept working even when I set "APP_DEBUG=false" and restarted again. I know it sounds weird and I have no idea why it worked and I haven't replicated that behavior, but it might be worth a shot.

@technigogo
Copy link

@antonc42
That did not work for me. I did find something interesting, though. Take a look at this.

image

@antonc42
Copy link

Sorry, I'm out of ideas at this point. Hopefully someone else might know what those errors mean. You might want to post the debug output from when you try to backup.

@technigogo
Copy link

Sorry, I'm out of ideas at this point. Hopefully someone else might know what those errors mean. You might want to post the debug output from when you try to backup.

Thank you very much for your help!

@alaskafunman
Copy link

alaskafunman commented Feb 10, 2023

I was able to fix this issue by

`GRANT RELOAD ON *.* TO 'snipeit_user'@'localhost';`
then
` FLUSH privileges;` 
then
`GRANT ALL ON *.* TO 'snipeit_user'@'localhost';`
then
flush privileges;
then 
quit;
then 
sudo service mysql restart

After that, I was able to make a backup.

@technigogo
Copy link

@alaskafunman
Thanks for the info -- unfortunately, it did not solve it for me.

@karthik8223
Copy link

karthik8223 commented Feb 28, 2023

I just solved this today. have to find the correct username(registered early) for the DB

  1. Copy paste this code below to find/view list of users in mysql (https://snapshooter.com/docs/fixing-mysqldump-couldn-t-execute-flush-tables-access-denied/)
    a. select User,HOST, Process_priv,Reload_priv from mysql.user;
  2. found the correct user that I registered earlier
  3. GRANT ALL ON * . * TO 'dbadmin'@'localhost';
  4. Now backup is back to successful.

@SeniorSolutionArchitect
Copy link

Giving this permission to snipe-ut user as a global access right is not the right way to solve it.
This page has some good info.
https://anothercoffee.net/how-to-fix-the-mysqldump-access-denied-process-privilege-error/

@UrsaSolar
Copy link

Had a look at my backups and realized they'd been broken since we patched in February. The comments here are confusing and all over the place, especially the ones suggesting you give the user all privileges, so here is what is necessary to correct this breakage introduced in MySQL 8.0.32. For me, adding the FLUSH_TABLES permission threw an error, but the original error says it only needs one of the two between that and RELOAD, and I can confirm that adding RELOAD does allow for backups to be generated again.

On the system or container running MySQL, log in as root:
mysql -u root -p
Add the reload privileges to the snipeit user. Replace the user if you use a different one. This command adds the RELOAD privilege on alldatabases.alltables to snipeit@anyhost:
GRANT RELOAD ON *.* TO 'snipeit'@'%';
Close the privileges table and commit any changes:
FLUSH privileges;
Exit!
exit

Now restart your Snipe-IT stack and it should be working. This should be fixed in MySQL 8.0.33.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests