DB: Unknow column 'Array' - OJS 2.4.8-2 to 3.0.2 Upgrade

Hello.

Trying to upgrade from 2.2 to 3.0.2.

The first upgrade, from 2.2 to 2.4.8-2 went ok(after i did a manual upgrade action in the review_rounds table).

During the second upgrade, from 2.4.8-2 to 3.0.2 , i got the following error:

[code: Installer Installer::migrateFiles]

[code: Installer Installer::convertSupplementaryFiles]

DB Error: Unknown column 'Array' in 'field list'

Stack Trace:

File: C:\www\mercator\classes\article\ArticleGalleyDAO.inc.php line 249
Function: DAO->update("INSERT INTO submission_galleys (submission_id, label, locale...", Array(6))

File: C:\www\mercator\classes\install\Upgrade.inc.php line 1343
Function: ArticleGalleyDAO->insertObject(Object(ArticleGalley))

File: (unknown) line (unknown)
Function: Upgrade->convertSupplementaryFiles(Object(Upgrade), Array(1))

File: C:\www\mercator\lib\pkp\classes\install\Installer.inc.php line 415
Function: call_user_func(Array(2), Object(Upgrade), Array(1))

File: C:\www\mercator\lib\pkp\classes\install\Installer.inc.php line 265
Function: Installer->executeAction(Array(3))

File: C:\www\mercator\lib\pkp\classes\install\Installer.inc.php line 186
Function: Installer->executeInstaller()

File: C:\www\mercator\lib\pkp\classes\cliTool\UpgradeTool.inc.php line 88
Function: Installer->execute()

File: C:\www\mercator\lib\pkp\classes\cliTool\UpgradeTool.inc.php line 64
Function: UpgradeTool->upgrade()

File: C:\www\mercator\tools\upgrade.php line 34
Function: UpgradeTool->execute()

Any ideas on how to solve this?

Thanks in advance.

Hi @Zetsaika,

Hmm, strange – are there any differences between your classes/article/ArticleGalleyDAO.inc.php and the stock (OJS 3.0.2) version?

Regards,
Alec Smecher
Public Knowledge Project Team

@asmecher

No, i am went from stock 2.2 to stock 2.4.8-2 to stock 3.0.2.
Any file i can upload to help?

Thanks.

Hi @Zetsaika,

What are the contents of your insertObject function in classes\article\ArticleGalleyDAO.inc.php?

Regards,
Alec Smecher
Public Knowledge Project Team

Here it is. @asmecher

function insertObject($galley) {
	$this->update(
		'INSERT INTO submission_galleys
			(submission_id, label, locale, seq, remote_url, file_id)
			VALUES
			(?, ?, ?, ?, ?, ?)',
		array(
			(int) $galley->getSubmissionId(),
			$galley->getLabel(),
			$galley->getLocale(),
			$galley->getSequence() == null ? $this->getNextGalleySequence($galley->getSubmissionId()) : $galley->getSequence(),
			$galley->getRemoteURL(),
			$galley->getFileId(),
		)
	);
	$galley->setId($this->getInsertId());
	$this->updateLocaleFields($galley);

	HookRegistry::call('ArticleGalleyDAO::insertNewGalley', array(&$galley, $galley->getId()));

	return $galley->getId();
}

Thanks for the attention.

Hi @Zetsaika,

Hmm, I’m afraid I can’t see how that code would result in that error message. If I were debugging this further, I’d try to capture the SQL statement that’s being executed in full and dump it out to the error log e.g. using error_log, or by configuring a MySQL query log.

Regards,
Alec Smecher
Public Knowledge Project Team

Here it goes, @asmecher:

INSERT INTO submission_galleys (submission_id, label, locale, seq, remote_url, file_id) VALUES (118, Array, NULL, 1, NULL, 389)

Hi @Zetsaika,

That helps. Hmm, I suspect a data error; can you try executing in your OJS 2.x install:

select * from articles where locale is null;
select * from articles where locale = '';

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher.

Managed to get the updated rolling past this part by editing all locales that were null.
But now i have stumbled into another problem.

[code: Installer Installer::convertSupplementaryFiles]

There are no readable files in this directory tree. Are safe mode or open_basedir active?

Stack Trace:

File: C:\www\mercator\lib\pkp\classes\file\FileManager.inc.php line 157
Function: FileManager->mkdirtree("")

File: C:\www\mercator\lib\pkp\classes\submission\PKPSubmissionFileDAO.inc.php line 383
Function: FileManager->copyFile(Null, Null)

File: C:\www\mercator\classes\install\Upgrade.inc.php line 1269
Function: PKPSubmissionFileDAO->updateObject(Object(SubmissionFile))

File: (unknown) line (unknown)
Function: Upgrade->convertSupplementaryFiles(Object(Upgrade), Array(1))

File: C:\www\mercator\lib\pkp\classes\install\Installer.inc.php line 415
Function: call_user_func(Array(2), Object(Upgrade), Array(1))

File: C:\www\mercator\lib\pkp\classes\install\Installer.inc.php line 265
Function: Installer->executeAction(Array(3))

File: C:\www\mercator\lib\pkp\classes\install\Installer.inc.php line 186
Function: Installer->executeInstaller()

File: C:\www\mercator\lib\pkp\classes\cliTool\UpgradeTool.inc.php line 88
Function: Installer->execute()

File: C:\www\mercator\lib\pkp\classes\cliTool\UpgradeTool.inc.php line 64
Function: UpgradeTool->upgrade()

File: C:\www\mercator\tools\upgrade.php line 34
Function: UpgradeTool->execute()

Sounds like there might be another null value that shouldn’t be at the “article_supplementary_files” table. Saw a couple of entries with “file_id” 0 and thought it was that, but no luck.

This was a 9 year old-ish instalation that i was asked to work on. At this point, after seeing some damage in the database, do you think it is still worth/possible to try and salvage? Or should i just get a fresh install and go for the XML Export/Import of Articles and Users?

Thanks for all the help.

Hi @Zetsaika,

There are a few other threads with fairly simple resolutions for this message – e.g. Upgrade from OJS 2.4.7 to 3.0.1 fails - #18 by asmecher.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher.

In addition to your solution, i needed to edit ojs_schema.xml in order to change the size limit of “submission_galleys.label”.

With that, the upgrade process was successful.

Now, i encountered some other problems related to supplementary files.
All of them are now galleys, is that intended?

And i can’t edit(send another file) any of them. PHP gives this error:

ojs2: Invalid revised file id!, referer: http://localhost/mercator/index.php/mercator/workflow/index/902/4

Another problem i found is that the Editorial History for any submission never stops loading. Notes tab works fine though and no PHP errors are reported.

Thanks for all the help.

Hi @Zetsaika,

Let’s pick these off a few at a time:

  • Supplementary files/galleys. The presentation of all supplementary files is intentional; many users didn’t realize that uploading supplementary files published them, but even in OJS 2.x that was the case. There’s some coding going on at the moment to better present primary vs. supplementary content in the front end, as currently they’re all listed together. This will be released in OJS 3.1.
  • Submission history tab not loading: Check your PHP error log.
  • Invalid revised file ID! message: Could you turn on your show_stacktrace option in config.inc.php?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher.

  • Supplementary files/galleys: Got it, thanks.
  • Submission history tab: No error log is generated. It just says loading.
  • Invalid revised file ID! message: Stacktrace was/is on during those tests. It is not firing.

Thanks.

Hi @Zetsaika,

Are you sure you’re checking your PHP error log? 99% of the time, an endless spinner corresponds to a more detailed message in the log.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

Yes, its the PHP error log. No errors. Maybe this deprecation/strict messages can help?

[24-Aug-2017 02:28:15 Europe/Paris] PHP Strict Standards:  Declaration of InformationCenterHandler::authorize() should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in C:\www\mercator\lib\pkp\controllers\informationCenter\InformationCenterHandler.inc.php on line 20

[24-Aug-2017 02:28:15 Europe/Paris] PHP Deprecated:  Non-static method Request::getContext() should not be called statically, assuming $this from incompatible context in C:\www\mercator\lib\pkp\classes\plugins\ThemePlugin.inc.php on line 409

[24-Aug-2017 02:28:15 Europe/Paris] PHP Deprecated:  Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in C:\www\mercator\classes\core\Request.inc.php on line 68

[24-Aug-2017 02:28:15 Europe/Paris] PHP Strict Standards:  Declaration of InformationCenterHandler::authorize() should be compatible with PKPHandler::authorize($request, &$args, $roleAssignments, $enforceRestrictedSite = true) in C:\www\mercator\lib\pkp\controllers\informationCenter\InformationCenterHandler.inc.php on line 20

[24-Aug-2017 02:28:15 Europe/Paris] PHP Deprecated:  Non-static method Request::getContext() should not be called statically, assuming $this from incompatible context in C:\www\mercator\lib\pkp\classes\plugins\ThemePlugin.inc.php on line 409

[24-Aug-2017 02:28:15 Europe/Paris] PHP Deprecated:  Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in C:\www\mercator\classes\core\Request.inc.php on line 68

Thanks.

Hi @asmecher, any news on the Editorial History infinite loading?

Tried with different servers, different php versions and with fresh install / upgrades. No luck with it working or making it produce error logs.
I also have noted that it wasn’t only the editorial history, but every type of history(file, editorial, etc) is stuck on loading.

Tried to search around the source code generated and found this:
image

Maybe it’s malformed in some way that helps identifying the problem?

Thanks.

Hi @Zetsaika,

I still think you’ll find something in the PHP error log. It may contain a lot of deprecation warnings that hide the relevant message (which should contain the word “Error”, rather than e.g. “Warning”). Note that these warnings are mostly resolved in OJS 3.1.0, which we recently released.

Regards,
Alec Smecher
Public Knowledge Project Team