-
-
Notifications
You must be signed in to change notification settings - Fork 443
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
[MySQL] Queuing database migration gives me "You cannot serialize or unserialize PDO instances" #273
Comments
Did you add any custom jobs? |
No, the creation code is the same, I just set |
What queue driver & database are you using? |
Am using the "database" driver, and the central/tenants database connection |
What database engine? |
InnoDB |
I know that this error message appears when you try to add another job to the queue chain and try to store That's weird, is that a fresh Laravel app? |
Not really, but I just updated to Laravel 6 couple days ago. |
I never had this issue w/ database queue driver, fresh L6 app and sqlite. |
I'm having the same problem here. How can we debug this? I have a job table. When I create a tenant, I get the error message "You cannot serialize or unserialize PDO instances". Is there something specific to do? |
If i comment |
Of course, because that cancels the DB creation. Can you try to This will result in DB migration & seeding not being done automatically after tenant DB creation. If that makes the create DB job pass, the issue is with the migrate & seed jobs. You can also try to enable queued DB creation, but disable auto migration & auto seeding. |
But just to make sure, the variable |
Right before the line you sent, in DatabaseManager. |
Oh i see, alright sure, i will try it and post the result back. By the way, I already tried to enable queued DB creation, but disable auto migration & auto seeding, the error was still there. I will try your suggestion and revert back |
Hi, sorry for late reply, i tried your suggestion.
I wonder if it's related to PHP version or Database? I'm using MariaDB. |
@TamkeenLMS , have you been able to figure this out? |
@kevin-ian Actually no. |
I think it's trying to serialize this PDO instance. But I have no clue how to prevent that. |
Oh that makes sense. I was definitely unable to reproduce this issue before and now I have no issues with SQLite, but the MySQLDatabaseManager now stores the connection (to get config like charset, collation, etc). Can you try switching to SQLite and seeing if the bug persists? |
@stancl , Tested with SQLite, and it works. The job is being created in the The bug is still present for the MySQL Manager. Any clue ? |
Thanks for reporting, I'll try to reproduce & fix this as soon as possible. |
@stancl thanks for taking this into consideration. I'd be glad to help (debugging, testing etc...) if needed. |
@stancl Any updates regarding this bug? |
@kevin-ian I hope to fix it in the next few days. Maybe today, maybe on Saturday. I'll see when I get to it. I'll try to find some time today. |
I assume the fix is to store a string (connection name) and resolve it using the Illuminate DatabaseManager, instead of storing the connection instance itself - on TenantDatabaseManagers: https://github.com/stancl/tenancy/pull/244/files#diff-3705ef5100e6ec06b1d60e715a84a742R23-R27 But before I push that fix I need to reproduce this and verify that things work. I think I could get this done today. |
Try
If that fixes this for you, I'll merge #289. |
@stancl , now it saves the information in the jobs table and the database is created when i run the job. Thanks for this fix |
Alright, I'm merging the PR. You should now run this to change your version constraint back to the 2.x release, so that you get future updates.
|
Reading your comments on #270 I thought I should queue the database migration, but after setting
queue_database_creation
to true inconfig/tenancy.php
I get this error:Comming from
src\Illuminate\Queue\Queue.php:139
.This is my configuration:
The text was updated successfully, but these errors were encountered: