Replies: 2 comments 1 reply
-
Forgot to comment. The cache is in database |
Beta Was this translation helpful? Give feedback.
-
As I'm running from the command line, the only message is the one I posted. When I use the command to generate seeder, which uses cached queries, the error also occurs Seeder example. Returns the error below: Running command for tenant
|
Beta Was this translation helpful? Give feedback.
-
I have multitenancy with multi-database.
When running the cache:clear command (both for a specific tenant or for all) I get the following error.
The same happens if I run one seeder with php artisan and it has cached queries.
Example:
php artisan tenants:artisan "cache:clear" --tenant=1
Running command for tenant
client one
(id: 1)...[2022-02-09T18:02:21.575521-03:00] local.ERROR: Call to a member function prepare() on null {"exception":"[object] (Error(code: 0): Call to a member function prepare() on null at /project/vendor/laravel/framework/src/Illuminate/Database/Connection.php:522)"} []
Error
Call to a member function prepare() on null
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:522
518▕
519▕ // For update or delete statements, we want to get the number of rows affected
520▕ // by the statement and return that back to the developer. We'll first need
521▕ // to execute the statement and then we'll use PDO to fetch the affected.
➜ 522▕ $statement = $this->getPdo()->prepare($query);
523▕
524▕ $this->bindValues($statement, $this->prepareBindings($bindings));
525▕
526▕ $statement->execute();
44 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Beta Was this translation helpful? Give feedback.
All reactions