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

queue retry uses system db connection instead of tenant #1027

Open
jeremyj11 opened this issue Sep 30, 2022 · 0 comments
Open

queue retry uses system db connection instead of tenant #1027

jeremyj11 opened this issue Sep 30, 2022 · 0 comments

Comments

@jeremyj11
Copy link

Description

Retrying failed jobs via "php artisan queue:retry all" results in system database connection being used instead of tenant databse connection.


Actual behavior

Illuminate\Database\QueryException

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'SYSTEM.messages' doesn't exist (SQL: select * from messages where messages.id = 1554856 limit 1)

Expected behavior

The tenant databse connection should be used.
use Hyn\Tenancy\Traits\UsesTenantConnection is being ignored in the model.


Information

  • hyn/multi-tenant version: 5.8.0
  • laravel version: 8
  • database driver and version: mariadb
  • php version: 8.2

Error log

php artisan queue:retry all

Illuminate\Database\QueryException

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'sc4.messages' doesn't exist (SQL: select * from messages where messages.id = 1554856 limit 1)

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
708▕ // If an exception occurs when attempting to run a query, we'll format the error
709▕ // message to include the bindings with SQL, which will make this exception a
710▕ // lot more helpful to the developer instead of just the database's errors.
711▕ catch (Exception $e) {
➜ 712▕ throw new QueryException(
713▕ $query, $this->prepareBindings($bindings), $e
714▕ );
715▕ }
716▕ }

• A table was not found: You might have forgotten to run your migrations. You can run your migrations using php artisan migrate.
https://laravel.com/docs/master/migrations#running-migrations

1 [internal]:0
App\Jobs\SendMessage::__unserialize()

  +16 vendor frames 

18 [internal]:0
App\Jobs\SendMessage::__unserialize()

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

No branches or pull requests

1 participant