[Solved] OJS3 upgrade 3.0.0.0 - 3.1.2 ended up fatal error notification

Hi,
I am having a problem when upgrading OJS 3.0.0.0 to the latest version 3.1.2 (Downloaded from pkp.sfu.ca, not git).
I have tried updating on a local machine using several php versions:
-7.0.33
-7.1.26
-7.2.14
-7.3.1
but the same problem still appears as below:

$ ../../../../MAMP/bin/php/php7.3.1/bin/php upgrade.php upgrade

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; dbObject has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 106
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; dbTable has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 205
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; dbIndex has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 613
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; dbData has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 774
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; dbQuerySet has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 959
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; adoSchema has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb-xmlschema.inc.php on line 1217
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADODB_Cache_File has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb.inc.php on line 263
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADOConnection has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb.inc.php on line 359
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb.inc.php on line 2921
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet_array has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb.inc.php on line 3939
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/lib/adodb/adodb.inc.php on line 1003
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; CounterReport has a deprecated constructor in /Applications/MAMP/htdocs/ojs-3.1.2/plugins/reports/counter/classes/CounterReport.inc.php on line 33

[pre-install]
[load: upgrade.xml]
[version: 3.1.2.0]
[code: Installer Installer::checkPhpVersion]
[data: dbscripts/xml/upgrade/3.0.0_preupdate_commentsToEditor.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_review_assignments.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_notes.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.0_preupdate_payments.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.1_preupdate_citations.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml (skipped)]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/submissionFiles.xml]
[schema: lib/pkp/xml/schema/categories.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: lib/pkp/xml/schema/navigationMenus.xml]
[schema: dbscripts/xml/ojs_schema.xml]
[data: dbscripts/xml/indexes.xml]
[code: Installer Installer::installDefaultNavigationMenus]
[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[code: Installer Installer::migrateSRLocale]
[code: Installer Installer::migrateUserAndAuthorNames (skipped)]
[code: Installer Installer::setFileUploader]
[code: Installer Installer::setFileName]
[data: dbscripts/xml/upgrade/3.0.1_update.xml]
[data: dbscripts/xml/upgrade/3.0.0_postupgrade_galley_files.xml]
[data: dbscripts/xml/upgrade/3.0.0_postupgrade_metrics.xml]
[code: Installer Installer::localizeIssueCoverImages]
[code: Installer Installer::localizeArticleCoverImages]
[data: dbscripts/xml/upgrade/3.0.0_issue_settings.xml]
[data: dbscripts/xml/upgrade/3.0.0_submission_settings.xml]
[code: Installer Installer::installEmailTemplate]
[data: dbscripts/xml/upgrade/3.0.0_review_method.xml]
[data: dbscripts/xml/upgrade/3.0.0_stage_assignments.xml]
[data: dbscripts/xml/upgrade/3.0.0_edit_decisions.xml]
[code: Installer Installer::convertCommentsToEditor]

Fatal error: Uncaught Error: Call to a member function getId() on bool in /Applications/MAMP/htdocs/ojs-3.1.2/classes/install/Upgrade.inc.php:1721
Stack trace:
#0 /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/classes/install/Installer.inc.php(421): Upgrade->convertCommentsToEditor(Object(Upgrade), Array)
#1 /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/classes/install/Installer.inc.php(265): Installer->executeAction(Array)
#2 /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#3 /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#4 /Applications/MAMP/htdocs/ojs-3.1.2/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#5 /Applications/MAMP/htdocs/ojs-3.1.2/tools/upgrade.php(34): UpgradeTool->execute()
#6 {main}
  thrown in /Applications/MAMP/htdocs/ojs-3.1.2/classes/install/Upgrade.inc.php on line 1721

I’m not sure this is an issue with the PHP version. There seems to be a problem on convertCommentsToEditor section during the upgrade process. :thinking:

Does anyone experience the same problem? please let me know how to fix it

Thanks,

Actually i am not too familiar with PHP code, but I try to figured out again by take a closer look on stopped upgrade step.

Some steps that I have tried:

  1. Taking a look to Upgrade.inc.php file on line 1721, and i figured it out that this problem actually similar to this thread (i’m sorry not too deep search on this forum :see_no_evil: ). But i don’t see any matched solution for me from that thread. On my case, all journals listed on my existing OJS are also have Journal manager with role_id = 16

  2. Look for an upgrade script that contains convertCommentsToEditor or similar word and i found 3.0.0_preupdate_commentsToEditor.xml on ~/ojs/classes/install/ folder.
    It seems that the xml file is trying to copy several columns on submissions table to a temporary submissions_tmp table, but i think it just stopped by the fatal errror produced during the upgrade process . cmiiw :wink:

  3. Browse the submission_tmp table through phpmyadmin, and i found a submission_id = 328 with NULL value at date_submitted column.
    submissions_tmp
    I know that submissions_tmp table is just a temporary table during upgrade, so i can’t edit the value directly.
    So i managed to find submission_id = 328 on submissions table, and filled out the submitted_time with the closest(estimated) time based on other row value.
    submissions

  4. I deleted the submissions_tmp table because later when the upgrade process is running, this table will be regenerated with new data.

  5. Run the upgrade command from cli, and guess what, It WORKS! :grinning:
    I know it was a strange issue and i don’t have any idea with it, but at least this solution worked on my upgrade problem.
    successfully_upgraded

Thanks :slightly_smiling_face:

Hi @dnaite,

Looks like a data error to me – glad you resolved it!

Regards,
Alec Smecher
Public Knowledge Project Team