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

snapshot tool throws exception on load action if there are snapshot files from removed plan #5

Open
ivanmarchenko83 opened this issue Sep 13, 2024 · 0 comments

Comments

@ivanmarchenko83
Copy link

To reproduce do this:

  1. Create new snapshot plan configuration with name daily-v8 (assuming you already had daily with generated snapshots)
  2. Generate a few snapshots for new plan
  3. Remove daily-v8 plan configuration
  4. Try to load snapshot fir the pan which left (i.e. daily) and see the error:
Unexpected data found.
Trailing data {"exception":"[object] (Carbon\\Exceptions\\InvalidFormatException(code: 0): Unexpected data found.
Unexpected data found.
Trailing data at /app/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php:690)

here is a stack trace:

[stacktrace]
#0 /app/vendor/nesbot/carbon/src/Carbon/Traits/Creator.php(713): Carbon\\Carbon::rawCreateFromFormat()
#1 /app/vendor/ziffmedia/laravel-mysql-snapshots/src/SnapshotPlan.php(286): Carbon\\Carbon::createFromFormat()
#2 /app/vendor/ziffmedia/laravel-mysql-snapshots/src/SnapshotPlan.php(291): ZiffMedia\\LaravelMysqlSnapshots\\SnapshotPlan->matchFileAndDate()
#3 /app/vendor/ziffmedia/laravel-mysql-snapshots/src/SnapshotPlan.php(84): ZiffMedia\\LaravelMysqlSnapshots\\SnapshotPlan->accept()
#4 /app/vendor/ziffmedia/laravel-mysql-snapshots/src/Commands/LoadCommand.php(26): ZiffMedia\\LaravelMysqlSnapshots\\SnapshotPlan::all()
#5 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): ZiffMedia\\LaravelMysqlSnapshots\\Commands\\LoadCommand->handle()
#6 /app/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}()
#7 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure()
#8 /app/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\\Container\\BoundMethod::callBoundMethod()
#9 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(661): Illuminate\\Container\\BoundMethod::call()
#10 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(183): Illuminate\\Container\\Container->call()
#11 /app/vendor/symfony/console/Command/Command.php(326): Illuminate\\Console\\Command->execute()
#12 /app/vendor/laravel/framework/src/Illuminate/Console/Command.php(152): Symfony\\Component\\Console\\Command\\Command->run()
#13 /app/vendor/symfony/console/Application.php(1078): Illuminate\\Console\\Command->run()
#14 /app/vendor/symfony/console/Application.php(324): Symfony\\Component\\Console\\Application->doRunCommand()
#15 /app/vendor/symfony/console/Application.php(175): Symfony\\Component\\Console\\Application->doRun()
#16 /app/vendor/laravel/framework/src/Illuminate/Console/Application.php(102): Symfony\\Component\\Console\\Application->run()
#17 /app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(155): Illuminate\\Console\\Application->run()
#18 /app/artisan(35): Illuminate\\Foundation\\Console\\Kernel->handle()
#19 {main}
"} 

looks like the error happens in SnapshotPlan.accept(.....) method when Carbon::createFromFormat is called

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

1 participant