Closed bandgeekndb closed 2 years ago
have you tried running ‘composer update’? I had the same issue and updating dependencies fixed it
Think you'll need to update your dependencies indeed to pull in laravel/serializable-closure.
I believe I have the necessary updated dependencies though. I'm running laravel/framework v9.7.0, which includes the laravel/serializable-closure package.
I can confirm this by running composer show laravel/serializable-closure and it tells me I have v1.1.1 installed. I can also confirm the serializable-closure package is installed in my app's vendor directory.
Is there some other dependency that I need to update? Thanks!
Heya, thanks for reporting.
We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as separate commits on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
laravel new bug-report --github="--public"
Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.
Thanks!
Hi Dries! So, in attempting to reproduce this in a separate repository, I actually found the root cause. When upgrading an app that has batches in the job_batches table, they have references to Illuminate\Queue\SerializableClosure in the options field in the database. This class doesn't exist in L9, and any new batches have references to the new Laravel\SerializableClosure.
I believe this is because I'm using the then() method after batching like this:
$batch = Bus::batch([
new FancyQueuedJob();
])->then(function (Batch $batch) {
//this closure here is what gets serialized and causes issues after the L9 upgrade
})->name('Fancy Queued Job Name')->allowFailures(true)->onQueue('webhooks')->dispatch();
Is there any way this can be aliased for backwards compatibility, or will it just be mandatory to flush the batches table when upgrading to Laravel 9?
We'll try to check into making this a bit smoother. Unfortunately we cannot give a time frame for this right now. For now, it's best that you clear this table before migrating.
Understood, thanks for following up! At this point, I just want to make sure if it's a breaking change, it makes it into docs / upgrade guide so it doesn't surprise anyone else.
Hi there, since this is an edge case really and we only have gotten one report for this we're going to close this one now. Thanks for reporting this but right now we don't feel it's wanted to dedicate a lot of time to this. We would accept a note to the upgrade guide though so people know to process all of their batches before upgrading. Thanks
@driesvints Faced the same issue.
We're currently not going to invest time into solving this sorry. Please clear your batches before upgrading.
If you can, a PR is appreciated.
@driesvints actually it is not solving even after clearing batches.
Description:
When calling Bus::findBatch to find a batch by ID, after upgrading to Laravel 9 and PHP 8.1 (previously Laravel 8 and PHP 7.4), I now get
Class __PHP_Incomplete_Class has no unserializer
when callingunserialize()
on the DatabaseBatchRepository class.Steps To Reproduce: