You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We configured a read replica database, but this causes login issues when there's some lag in syncing with the master db.
At these moments we are unable to login. We don't get a clear error and we are just redirected back to the login page.
In our logs we see the following warning:
web yii\web\User::renewAuthStatus [WARNING] Invalid session auth key attempted for user
Looks like the record isn't in the replica yet due to the lag. When we disable the replica, it all works fine.
Maybe this query should always be executed on the master db?
Craft CMS version
4.8.5
PHP version
8.2.13
Operating system and version
No response
Database type and version
MySQL 8.0.36 (AWS RDS)
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
What happened?
Description
We configured a read replica database, but this causes login issues when there's some lag in syncing with the master db.
At these moments we are unable to login. We don't get a clear error and we are just redirected back to the login page.
In our logs we see the following warning:
web yii\web\User::renewAuthStatus [WARNING] Invalid session auth key attempted for user
Which I can resolve to this line:
https://github.com/craftcms/cms/blob/4.x/src/elements/User.php#L1049
Looks like the record isn't in the replica yet due to the lag. When we disable the replica, it all works fine.
Maybe this query should always be executed on the master db?
Craft CMS version
4.8.5
PHP version
8.2.13
Operating system and version
No response
Database type and version
MySQL 8.0.36 (AWS RDS)
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: