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

[8.x] Fix retry command for encrypted jobs #36334

Merged

Conversation

willbrowningme
Copy link
Contributor

@willbrowningme willbrowningme commented Feb 21, 2021

When using the new Illuminate\Contracts\Queue\ShouldBeEncrypted interface on a job if you run the php aritsan queue:retry command you get the following error:

unserialize(): Error at offset 0 of x bytes

This is because the job's command is not decrypted before being unserialized.

Steps to reproduce:

  1. Create any queable job that implements the ShouldBeEncrypted interface
  2. Call $this->fail() inside the job
  3. Run php artisan queue:retry <job-id>

This pull request fixes the issue by checking if the payload's command is encrypted before trying to unserialize it.

The code is taken from the getCommand(array $data) method in Illuminate\Queue\CallQueuedHandler.php

@taylorotwell taylorotwell merged commit 0dc9d84 into laravel:8.x Feb 21, 2021
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

Successfully merging this pull request may close these issues.

2 participants