I’ve been trying to upgrade our OJS from 2.4.7-1 to 3 for some time now, and every time I get some error that stops the upgrade.
Some weeks ago I was able to finish the upgrade going from 2.4.7-1 to 3.0.2 and then to 3.1.1-4, because trying to go from 2.4.7-1 to 3.1.1-4 in one step gave me an “Call to a member function getFileId() on null” error with no more information.
Now I’m trying again, in a new server with PHP 7 and OJS 3.1.2. This time the error is a bit different:
\[code: Installer Installer::provideSupplementaryFilesForReview]
PHP Warning: copy(/home/ojs/rc-3.1.2_files/journals/5//articles/2037/submission/2037-48-8681-1-2-20081201.jpg): failed to open stream: No such file or directory in /home/ojs/rc-3.1.2/lib/pkp/classes/file/FileManager.inc.php on line 162
PHP Fatal error: Uncaught Error: Call to a member function getFileId() on null in /home/ojs/rc-3.1.2/lib/pkp/classes/file/SubmissionFileManager.inc.php:184
Stack trace:
#0 /home/ojs/rc-3.1.2/classes/install/Upgrade.inc.php(1476): SubmissionFileManager->copyFileToFileStage('8681', 1, 4, NULL, true)
#1 /home/ojs/rc-3.1.2/lib/pkp/classes/install/Installer.inc.php(421): Upgrade->provideSupplementaryFilesForReview(Object(Upgrade), Array)
#2 /home/ojs/rc-3.1.2/lib/pkp/classes/install/Installer.inc.php(265): Installer->executeAction(Array)
#3 /home/ojs/rc-3.1.2/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#4 /home/ojs/rc-3.1.2/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#5 /home/ojs/rc-3.1.2/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#6 /home/ojs/rc-3.1.2/tools/upgrade.php(34): UpgradeTool->execute()
#7 {main}
thrown in /home/ojs/rc-3.1.2/lib/pkp/classes/file/SubmissionFileManager.inc.php on line 184
If you’re running 2.4.7, can you try going to 2.4.8 first and let us know how that goes? Then you can go from 2.4.8 to 3. I’d probably go to 3.1.1-4 first, and then from 3.1.1-4 to 3.1.2. That last one is straight forward if you’ve got a clean installation.
From my previous tests I know that going from 2.4.7 to 3.0.2 and then to 3.1.1-4 works. I was just trying to avoid a 2 step upgrade, but it seems to be the best solution.
There where some references in article_supplementary_files and article_files to files that no longer exist. Using the file_id mentioned in the error message it was easy to find them. Removing the missing files from the submissions solved the problem.
I believe this generally happened when a file was missing in the files_dir, though the error message is pretty cryptic. I believe the error is now clearer since Make failures in provideSupplementaryFilesForReview more friendly · Issue #5689 · pkp/pkp-lib · GitHub, which is included in the latest OJS 3.2.x release rather than e.g. 3.1.2. You might consider upgrading to a newer release; we’re currently planning on releasing OJS 3.2.1 this Friday, incidentally.
Regards,
Alec Smecher
Public Knowledge Project Team
Hello, @asmecher,
I am converting from 2.4.8 to 3.2.1 directly. I had a great many errors which had to do with character set, I believe, and have solved that I think by converting database to utf8/utf8_general_ci before the upgrade.
However, even though the upgrade succeeds, there are still errors during execution, and they appear to have to do with locales.
We will only be using en_US locale - is there any way to set OJS to use this locale exclusively?
BTW, the error is coming up when going to the Administration Management page for Web settings (site.org/index.php/ijoc/management/settings/website), in lib/pkp/pages/management/ManagementHandler.inc.php, line 154 sets $supportedFormLocales to null, which causes array_map on line 158 to have null value. Eventually this causes a 500 error from the webserver.
Regards,
DJ Far
International Journal of Communications (ijoc.org)