Upgrade on MariaDB

Hi,
We currently run OJS 2.4.5 on MariaDB and in the process of upgrading to OJS 2.4.7. I’m wondering if anybody has encountered a lost connection in the middle of the upgrade process. We are currently stumped on how to resolve and are looking at going back to MySQL instead of MariaDB. But it would be nice to figure out the problem.

The error is:

2013: Lost connection to MySQL server during query
ADOConnection._Execute(ALTER TABLE article_search_object_keywords ADD UNIQUE INDEX article_search_object_keyw ords_pkey (object_id, pos), false)% line 864, file: /usr/share/ejournals-ojs/lib/pkp/lib/adodb/adodb.inc.php
ADOConnection.Execute(ALTER TABLE article_search_object_keywords ADD UNIQUE INDEX article_search_object_keywords_pkey (object_id, pos))% line 452, file: /usr/share/ejournals-ojs/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(ALTER TABLE article_search_object_keywords ADD UNIQUE INDEX article_search_object_keywords_pkey (object _id, pos))% line 447, file: /usr/share/ejournals-ojs/lib/pkp/classes/install/Installer.inc.php
Installer.executeSQL(Array[399])% line 379, file: /usr/share/ejournals-ojs/lib/pkp/classes/install/Installer.inc.php
Installer.executeAction(Array[3])% line 269, file: /usr/share/ejournals-ojs/lib/pkp/classes/install/Installer.inc.php
ERROR: Upgrade failed: DB: Lost connection to MySQL server during query

Hi @jhennig,

I suspect you ran into a query time limit creating an index to the search index table – that can be quite a large table.

One option would be to truncate the contents of the related tables – submission_search_keyword_list, submission_search_objects, and submission_search_object_keywords – before running the upgrade, then use tools/rebuildSearchIndex.php to rebuild the search index after you’ve finished the upgrade.

Make sure to restore your database from backup before proceeding – after a failed upgrade your database will be somewhere between two versions of OJS, and cleaning that up can be difficult.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

I am trying to upgrade from the version 2.4.2 to the 2.4.8-2. I have made a copy of the running system (made it running without problems), unpackaged the 2.4.8-2 version, modified the config.php and using WEB to start the upgrade. I have tried several time and I always get “Server 500 error”. I have tried with truncated “article_search_…” tables (I guess in the answer above the “submission_search_…” is wrong) and the same. After about 15 minutes I get the error.

Unfortunately I can not find any useful error in the log files. Even more, one of my colleagues tried to help and also couldn’t find anything useful in the logs.

I am thinking about what is actually the upgrade process doing. Is that a set of SQL statements to be executed? If so, where can I find the SQL statements to execute them manually one by one?

Or and other idea?

Best regards, Primož

Hi @primozs,

A 500 error will always have something useful in the log – if you don’t see anything in the PHP error log, check if your server has a separate Apache error log. If your server imposes time limits on long requests, then it would be logged in the Apache log, for example.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asch

I am running on IIS and really found something in the log, but is not marked as error or something and I didn’t care about. Here it is:
imagedate time s-ip cs-method cs-uri-stem cs-uri-query s-port cs-username c-ip cs(User-Agent) cs(Referer) sc-status sc-substatus sc-win32-status time-taken
25.10.2017 14:29:26 77.94.150.148 GET /index.php/index/install - 80 - 89.212.4.67 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/62.0.3202.62+Safari/537.36 - 200 0 0 543
25.10.2017 14:29:32 77.94.150.148 GET /index.php/index/install/upgrade - 80 - 89.212.4.67 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/62.0.3202.62+Safari/537.36 http://peskovnik.infolab.si/index.php/index/install 200 0 0 466
25.10.2017 14:43:08 77.94.150.148 POST /index.php/index/install/installUpgrade - 80 - 89.212.4.67 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/62.0.3202.62+Safari/537.36 http://peskovnik.infolab.si/index.php/index/install/upgrade 500 0 258 808060

The red marked status 258 means “WAIT TIMEOUT” (The wait operation timed out). Any idea how to sort it out?

Best regards, Primož

Hi @primozs,

This sounds like a time limit for processing requests. It’ll be somewhere in your IIS configuration – however, I haven’t used IIS, so I can’t suggest specifics.

The upgrade process can take quite a while, so I’d suggest temporarily either disabling the timeout or extending it to something very long.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thank you for very prompt help and confirming my understandings. Unfortunately I am also not IIS expert and have no idea which timeout is it and how to extend it.

Yesterday I tried with the “script timeout”, but unsuccessful. Is here anyone with more IIS knowledge and can help?

Best regards, Primož

Some more info what I have done so far… I have found in the IIS log the timeout entry (sc-win32-status=258) with the execution time (time-taken) of 808060 ms (almost 15 minutes). I have tried different options to increase time limits, but unsuccessful:

IIS setting Idle Time-out set to -1
IIS setting Connection Time-out increased from 120 to 1200
IIS setting scriptTimeout increased from 1:30 to 25:30

Any idea what else can I try or how to get more info?

Hi @primozs,

I would recommend using the upgrade command-line script rather than the web interface.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,

Thank you very much the CLI solved the problem. The overall DB ugrade took about 45 minutes…

Best regards, Primož

1 Like