Skip to content

Database exception using DbSession #13212

@puku

Description

@puku

What steps will reproduce the problem?

When I'm trying to login on the website, from time to time I'm receiving an error message.
After reloading of the page everything is ok.
YII_DEBUG is enabled, YII_ENV_DEV is set to true.

Maybe this issue is linked with this one

Stackoverflow question

What do you get instead?

Integrity constraint violation – yii\db\IntegrityException

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'
The SQL being executed was: UPDATE session SET id=0 WHERE id='3u5r7gq6pqh8s0gjrusfqpmni7'
Error Info: Array
(
[0] => 23000
[1] => 1062
[2] => Duplicate entry '0' for key 'PRIMARY'
)

Caused by: PDOException

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '0' for key 'PRIMARY'

in /var/www/develop/vendor/yiisoft/yii2/db/Command.php at line 844

Additional info

Q A
Yii version 2.0.10
PHP version 7.0
Operating system Ubuntu 14.04

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions