( ojs-3.3.0-8 ) PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

Description of issue or problem I’m having:

From the front end all the error message says is “http error”. (Production environment.)

Steps I took leading up to the issue:

We have gotten a few messages from some journals that there seems to be an issue with uploading files since the upgrade. There is an HTTP error message happening.

What I tried to resolve the issue:

I read this post but the code changes / fix has already been updated in our version /ojs-3.3.0-8 so I do not know what else to do. I am wondering if I should change permission on application folder to … below? Currently it is the original download default permission.

chmod -R 755 ojs-3.3.0-8

Application Version - e.g., OJS 3.1.2:

just upgraded from ojs-3.2.1-4 to ojs-3.3.0-8

Additional information, such as screenshots and error log messages if applicable:

[Mon Dec 20 19:24:46.094234 2021] [php7:error] [pid 56082] [client 136.159.96.252:38094] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘vovj15tv4tv5th9m6mtfb7ptht’ for key ‘sessions_pkey’ in /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115\nStack trace:\n#0 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute(NULL)\n#1 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(489): Doctrine\DBAL\Driver\PDOStatement->execute()\n#2 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}(‘INSERT INTO ses…’, Array)\n#3 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback(‘INSERT INTO ses…’, Array, Object(Closure))\n#4 /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel in /var/www/html/ojs-3.3.0-8/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671, referer: Clinical Practice and Clinical Supervision: Building a Firm Foundation | Canadian Journal of Counselling and Psychotherapy

Please also see attachments.

error_log

Thank you in advance!

Dung.

Hey @dung,

Probably you could create a SQL statement to backup and clean the sessions table which rows have a last_used value longer than X months.

Hello @henriqueramos ,

Can I just empty the sessions table?

Thank you!

Dung.

@dung

I think it’s good to do a backup before empty the tables.

Best regards,
Henrique

Hello @henriqueramos ,

I actually fortunately got help from other related issue that also resolved this issue of http error :smiley: So thank you so much anyhow. They are different error message but essentially due to a bad apache redirect configuration. The error LOG I gave you probably has been the wrong error.

BTW, emptying the “sessions” table does not have negative effect, it will be regenerated.

Best,

Dung.

The administration panel has:

Administrative Functions