Hi,
I have the following error in my php error log. Please let me know what is this about and how to resolve this issue. I received this error for the first time.
OJS 3.3.0.3
PHP : 7.14
[20-Feb-2021 14:42:08 America/New_York] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[20-Feb-2021 14:42:09 America/New_York] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[20-Feb-2021 14:42:09 America/New_York] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[20-Feb-2021 14:42:09 America/New_York] PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'a26f4cc44a8a2557a28a3a8514688483' for key 'sessions_pkey' in /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:115
Stack trace:
#0 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(115): PDOStatement->execute(NULL)
#1 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(489): Doctrine\DBAL\Driver\PDOStatement->execute()
#2 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(664): Illuminate\Database\Connection->Illuminate\Database\{closure}('INSERT INTO ses...', Array)
#3 /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(631): Illuminate\Database\Connection->runQueryCallback('INSERT INTO ses...', Array, Object(Closure)) in /home/seisense/journal.seisense.com/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 671
For knowledge base!
I turned the session_check_ip from OFF to ON (into config.inc.php) and it seems that two problems are resolved with this:
1- This fatal error is not produced again
2- The number of Abstract views and pdf downloads were not updating since I upgraded to OJS 3.3.0.3. After turning session_check_ip =on, it just updated all the usage stats as well.
This error message seems truncated. Can you post the whole stack trace?
What are the steps to reproduce the error? Can you describe it in more details? e.g., does it occur under specific circumstances or randomly…
This is the completely random behavior and have no idea so far what is causing this error. I saw this error the first time on 20th feb and then yesterday 24th of feb.
I have cleared my php error log and I ll see if this happen again then I ll copy the complete stack trace (although I believe this was the complete stack trace and nothing after this line related to this error).
Is there anything suspicious in the server access log during those 2 times and in other cases when session_destroy() has failed? Is the user agent or IP identical for all the cases? Does it look like a bot?
I meant something like apache access log but finding those in the session table is also a solution. I don’t see anything special there, those look like real users, that aren’t logged in (user_id isn’t assigned).
I guess for those users it leads to an inability to load the page.
Did the error message appear for the first time only in OJS 3.3.0?
This doesn’t narrow the problem, not sure how to find the cause without reproducibility. According to the session_destroy function implementation, the session can’t be destroyed if the data regarding it is missing from the disk or the path is wrong. I would doubt that it’s OJS issue but will keep an eye on it.
I’ve explored the logs of a production OJS instance v 3.2.1 that uses apache+nginx as a server. I found several similar records ~ 20 for 1 month period. Half of them were caused by a bot, at least according to a log record. The other half of cases don’t have bot identification but also have bot traits - several server records from the same IP with an interval of less than a second.
But I never had this fatal error and session destroy errors before my update to OJS 3.3.0.3. If it is a bot causing error, is there any solution to it or steps we can take to solve this problem?
Thanks
@seisense, I wonder if PHP is generating/using session ID lengths that are longer than the sessions.session_id database column. Normally that should be 128 characters available in the column, and a normal PHP session ID should be shorter than that. Do you see anything unusual in that regard?
Regards,
Alec Smecher
Public Knowledge Project Team
Hi,
I have disabled the zlib.output_compression (PHP 7.4.16 - phpinfo()) yet in the last four hours php error log has produced this warning (see below).
[18-Mar-2021 08:07:56 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 08:11:51 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 08:22:37 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 08:37:15 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 08:39:46 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 08:39:46 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 08:40:00 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 08:43:20 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 08:43:40 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 08:50:07 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 08:52:24 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 09:22:47 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 09:25:43 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 09:33:47 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 09:44:47 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 09:50:36 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 09:51:22 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 09:54:20 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 11:04:47 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 11:06:33 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 11:07:09 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 11:07:42 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 11:08:22 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 11:26:28 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 11:53:56 Asia/Riyadh] ojs2: 404 Not Found
[18-Mar-2021 12:27:53 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 12:27:53 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 12:30:51 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
[18-Mar-2021 12:40:53 Asia/Riyadh] PHP Warning: session_destroy(): Session object destruction failed in /home/seisense/journal.seisense.com/lib/pkp/classes/session/SessionManager.inc.php on line 76
I am still struggling to see how the session management code, which has been stable and gone essentially unchanged for years, is behaving so differently on your system.
One thing to try: in lib/pkp/classes/session/SessionManager.inc.php, edit:
function destroy($sessionId) {
return (boolean) $this->sessionDao->deleteById($sessionId);
}
Change this to:
function destroy($sessionId) {
$this->sessionDao->deleteById($sessionId);
return true;
}
I am speculating here but it would be interesting to know if it resolves the warnings.
Regards,
Alec Smecher
Public Knowledge Project Team