-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Unserialize issue when Mailable is queued #22727
Comments
It sounds like the process running the queue does not have the $visible property. This happens if you havn't deployed to the queue server, or forgot to restart the worker after deploying. |
Hi @sisve how do you mean "deployed to the queue server" and I have run horizon:terminate and horizon:purge after deploying the application on the application server |
Ah, now I see that it's looking for Can you update your issue with a complete stack trace? |
done @sisve |
I can't replicate this, models are serialized and unserialized back properly when the mailable is queued, I think you'll need to investigate this more since you're the only one who can replicate. |
Hi! I faced the same problem and invistigate it it appears when i was tring to serialize($mailable), to save it into my log and after then The problem is in call serialize($mailable); coz it invoke SerializesModels::__sleep() wich in my case workaround is to call serialize(clone $mailable) |
Thanks @rusinov-artem for the feedback, what you said makes sense, if the instance is serialized already it'll cause the problem mentioned in this issue. |
@themsaid |
Description:
I have 3 separate servers (for reference):
I have created a mailable:
Which is fired thusly:
When the queue is processed I am seeing the following errors in Horizon:
Which is referring to this in the markdown view:
If I remove the ShouldQueue/Queueable portions and fire the email without queuing it works perfectly but as soon as I push it to the queue it fails.
I should also mention that I have another job that is fired by a model saving event that is queued and also passes a model instance in to a constructor and this works perfectly when queued and subsequently run.
Stack Trace
The text was updated successfully, but these errors were encountered: