Comments (5)
I think its because that my .env file database_connection is set to database_name rather than landlord, and that the multitenancy.php config file is tenant_database_connection_name value is set to NULL. Changing .env database_connection to landlord and updating tenant_database_connection_name value to 'tenant' to check
from laravel-multitenancy.
i am sending to a fifo queue
Connection Name: Exception: PDOException: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected in /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php:416 Stack trace: #0 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(416): PDO->prepare('select * from ...') #1 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(788): Illuminate\Database\Connection->Illuminate\Database\{closure}('select * from ...', Array) #2 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(934): Illuminate\Database\Connection->runQueryCallback('select * from ...', Array, Object(Closure)) #3 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(914): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection(Object(Illuminate\Database\QueryException), 'select * from ...', Array, Object(Closure)) #4 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(758): Illuminate\Database\Connection->handleQueryException(Object(Illuminate\Database\QueryException), 'select * from ...', Array, Object(Closure)) #5 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(424): Illuminate\Database\Connection->run('select * from ...', Array, Object(Closure)) #6 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2736): Illuminate\Database\Connection->select('select * from
...', Array, true) #7 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2724): Illuminate\Database\Query\Builder->runSelect() #8 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3278): Illuminate\Database\Query\Builder->Illuminate\Database\Query{closure}() #9 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2725): Illuminate\Database\Query\Builder->onceWithColumns(Array, Object(Closure)) #10 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(717): Illuminate\Database\Query\Builder->get(Array) #11 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(701): Illuminate\Database\Eloquent\Builder->getModels(Array) #12 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(296): Illuminate\Database\Eloquent\Builder->get(Array) #13 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(443): Illuminate\Database\Eloquent\Builder->first(Array) #14 /var/app/current/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Illuminate\Database\Eloquent\Builder->find(3) #15 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2335): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), 'find', Array) #16 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2347): Illuminate\Database\Eloquent\Model->__call('find', Array) #17 /var/app/current/vendor/spatie/laravel-multitenancy/src/Actions/MakeQueueTenantAwareAction.php(105): Illuminate\Database\Eloquent\Model::__callStatic('find', Array) #18 /var/app/current/vendor/spatie/laravel-multitenancy/src/Actions/MakeQueueTenantAwareAction.php(132): Spatie\Multitenancy\Actions\MakeQueueTenantAwareAction->findTenant(Object(Illuminate\Queue\Events\JobProcessing)) #19 /var/app/current/vendor/spatie/laravel-multitenancy/src/Actions/MakeQueueTenantAwareAction.php(46): Spatie\Multitenancy\Actions\MakeQueueTenantAwareAction->bindOrForgetCurrentTenant(Object(Illuminate\Queue\Events\JobProcessing)) #20 /var/app/current/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(421): Spatie\Multitenancy\Actions\MakeQueueTenantAwareAction->Spatie\Multitenancy\Actions{closure}(Object(Illuminate\Queue\Events\JobProcessing)) #21 /var/app/current/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(249): Illuminate\Events\Dispatcher->Illuminate\Events{closure}('Illuminate\Queu...', Array) #22 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(653): Illuminate\Events\Dispatcher->dispatch('Illuminate\Queu...') #23 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(426): Illuminate\Queue\Worker->raiseBeforeJobEvent('sqs', Object(Illuminate\Queue\Jobs\SqsJob)) #24 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\Queue\Worker->process('sqs', Object(Illuminate\Queue\Jobs\SqsJob), Object(Illuminate\Queue\WorkerOptions)) #25 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\SqsJob), 'sqs', Object(Illuminate\Queue\WorkerOptions)) #26 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(138): Illuminate\Queue\Worker->daemon('sqs', 'mycarpass.fifo', Object(Illuminate\Queue\WorkerOptions)) #27 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(121): Illuminate\Queue\Console\WorkCommand->runWorker('sqs', 'mycarpass.fifo') #28 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle() #29 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() #30 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) #31 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) #32 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) #33 /var/app/current/vendor/laravel/framework/src/Illuminate/Console/Command.php(208): Illuminate\Container\Container->call(Array) #34 /var/app/current/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #35 /var/app/current/vendor/laravel/framework/src/Illuminate/Console/Command.php(178): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #36 /var/app/current/vendor/symfony/console/Application.php(1081): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #37 /var/app/current/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #38 /var/app/current/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #39 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(200): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #40 /var/app/current/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #41 {main}
Next Illuminate\Database\QueryException: SQLSTATE[3D000]: Invalid catalog name: 1046 No database selected (Connection: landlord, SQL: select * from tenants where tenants.id = 3 limit 1) in /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php:795 Stack trace: #0 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(934): Illuminate\Database\Connection->runQueryCallback('select * from ...', Array, Object(Closure)) #1 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(914): Illuminate\Database\Connection->tryAgainIfCausedByLostConnection(Object(Illuminate\Database\QueryException), 'select * from ...', Array, Object(Closure)) #2 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(758): Illuminate\Database\Connection->handleQueryException(Object(Illuminate\Database\QueryException), 'select * from ...', Array, Object(Closure)) #3 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Connection.php(424): Illuminate\Database\Connection->run('select * from ...', Array, Object(Closure)) #4 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2736): Illuminate\Database\Connection->select('select * from ...', Array, true) #5 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2724): Illuminate\Database\Query\Builder->runSelect() #6 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3278): Illuminate\Database\Query\Builder->Illuminate\Database\Query{closure}() #7 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(2725): Illuminate\Database\Query\Builder->onceWithColumns(Array, Object(Closure)) #8 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(717): Illuminate\Database\Query\Builder->get(Array) #9 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(701): Illuminate\Database\Eloquent\Builder->getModels(Array) #10 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(296): Illuminate\Database\Eloquent\Builder->get(Array) #11 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(443): Illuminate\Database\Eloquent\Builder->first(Array) #12 /var/app/current/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php(23): Illuminate\Database\Eloquent\Builder->find(3) #13 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2335): Illuminate\Database\Eloquent\Model->forwardCallTo(Object(Illuminate\Database\Eloquent\Builder), 'find', Array) #14 /var/app/current/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(2347): Illuminate\Database\Eloquent\Model->__call('find', Array) #15 /var/app/current/vendor/spatie/laravel-multitenancy/src/Actions/MakeQueueTenantAwareAction.php(105): Illuminate\Database\Eloquent\Model::__callStatic('find', Array) #16 /var/app/current/vendor/spatie/laravel-multitenancy/src/Actions/MakeQueueTenantAwareAction.php(132): Spatie\Multitenancy\Actions\MakeQueueTenantAwareAction->findTenant(Object(Illuminate\Queue\Events\JobProcessing)) #17 /var/app/current/vendor/spatie/laravel-multitenancy/src/Actions/MakeQueueTenantAwareAction.php(46): Spatie\Multitenancy\Actions\MakeQueueTenantAwareAction->bindOrForgetCurrentTenant(Object(Illuminate\Queue\Events\JobProcessing)) #18 /var/app/current/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(421): Spatie\Multitenancy\Actions\MakeQueueTenantAwareAction->Spatie\Multitenancy\Actions{closure}(Object(Illuminate\Queue\Events\JobProcessing)) #19 /var/app/current/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php(249): Illuminate\Events\Dispatcher->Illuminate\Events{closure}('Illuminate\Queu...', Array) #20 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(653): Illuminate\Events\Dispatcher->dispatch('Illuminate\Queu...') #21 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(426): Illuminate\Queue\Worker->raiseBeforeJobEvent('sqs', Object(Illuminate\Queue\Jobs\SqsJob)) #22 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(389): Illuminate\Queue\Worker->process('sqs', Object(Illuminate\Queue\Jobs\SqsJob), Object(Illuminate\Queue\WorkerOptions)) #23 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(176): Illuminate\Queue\Worker->runJob(Object(Illuminate\Queue\Jobs\SqsJob), 'sqs', Object(Illuminate\Queue\WorkerOptions)) #24 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(138): Illuminate\Queue\Worker->daemon('sqs', 'mycarpass.fifo', Object(Illuminate\Queue\WorkerOptions)) #25 /var/app/current/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(121): Illuminate\Queue\Console\WorkCommand->runWorker('sqs', 'mycarpass.fifo') #26 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Illuminate\Queue\Console\WorkCommand->handle() #27 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container{closure}() #28 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure(Object(Closure)) #29 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure)) #30 /var/app/current/vendor/laravel/framework/src/Illuminate/Container/Container.php(662): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL) #31 /var/app/current/vendor/laravel/framework/src/Illuminate/Console/Command.php(208): Illuminate\Container\Container->call(Array) #32 /var/app/current/vendor/symfony/console/Command/Command.php(326): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #33 /var/app/current/vendor/laravel/framework/src/Illuminate/Console/Command.php(178): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Illuminate\Console\OutputStyle)) #34 /var/app/current/vendor/symfony/console/Application.php(1081): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #35 /var/app/current/vendor/symfony/console/Application.php(320): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #36 /var/app/current/vendor/symfony/console/Application.php(174): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #37 /var/app/current/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(200): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #38 /var/app/current/artisan(37): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput)) #39 {main}
from laravel-multitenancy.
looks like theres an issue with supervisor loosing connection to the database, restarting supervisor seems to fix the issue and prevent this error from occurring
from laravel-multitenancy.
but also an issue with jobs failing and not knowing where the failed table is: my code is in the queue:
'failed' => [
'driver' => 'database-uuids',
'database' => 'landlord',
'table' => 'failed_jobs',
],
which is the root of the issue from the above error.
from laravel-multitenancy.
Duplicated #505
from laravel-multitenancy.
Related Issues (20)
- Current tenant not determined when dispatching queued closures HOT 6
- When dispatching a Tenant Aware Job in sync mode from a test, any prior/current DB transaction is cleared HOT 2
- Model ignore tenant when add Observer HOT 2
- Tenant password reset token is being stored on landlord password_reset_tokens table HOT 1
- Prefixing cache doesn't work fine with file-store HOT 3
- Conflict with Rabbitmq package from vyuldashev HOT 1
- Scheduler : Large (longer) jobs, multiple tenants, stops.
- Tenant-Aware Job Scheduling with Horizon HOT 4
- MakeQueueTenantAwareAction seems to break active requests when Queue Connection is sync HOT 4
- base table or view not found with AWS SQS queue for job TenantAware HOT 12
- Tenant Aware Queue Fails No Database Selected when running from supervisor in a multi tenant environment using AWS SQS FIFO HOT 2
- Update documentation at https://spatie.be to `v3` HOT 3
- in_array(): Argument #2 ($haystack) must be of type array, null given {"exception":"[object] (TypeError(code: 0): in_array(): Argument #2 ($haystack) must be of type array, null given at /spatie/laravel-multitenancy/src/Actions/MakeQueueTenantAwareAction.php:79) HOT 1
- Cache issue with spatie/laravel-permission in TenantAware Command HOT 5
- Issue with the has function on different connections HOT 1
- I want to Connect to mongo DB for some tables but it is giving "Database connection [mongodb] not configured.", exception: "InvalidArgumentException",…} error
- Custom cache driver missing when switching Tenant HOT 2
- Cannot schedule jobs in Laravel 11 HOT 3
- Can't make route not tenant aware
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-multitenancy.