Connect wrong DB connection to query data when executing queue #45659
Unanswered
Twinkle0613
asked this question in
Q&A
Replies: 1 comment
-
Maybe you forgot to specify the connection in an conditionally executed statement? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version: 8.83.26
PHP Version: 7.4.33
Database Driver & Version: MySQL 5.7
Description:
In my Laravel application, I setup two DB ('base' and 'log') for storing operation data and log data as shown below.
Sometimes, during the execution queue, the system connects to the wrong database to execute the query. The exception generated is shown below. It won't happen in every queues.
By right, this query need to connect 'base'
"message": "SQLSTATE[42S02]: Base table or view not found: 1146 Table 'base.user_logs' doesn't exist (SQL: select * from 'user_logs' where 'user_id' = 1 and 'date' between 2023-01-16 02:11:03 and 2023-01-16 02:26:06 limit 100)"
config/database.php
For addition informations:
Anyone know how this error would occur with this system?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions