OMP Upgrade from 3.1.2-4 to 3.2.0, fatal error on getSupportedFormLocales()

Hello, I’m trying to upgrade OMP from 3.1.2-4 to 3.2.0
I get this error, but I don’t have idea how to solve it:

[code: Installer Installer::migrateSubmissionCoverImages]
PHP Warning: copy(/{filesPath}/files/presses/0//monographs/1/simple/cover.jpg): failed to open stream: No such file or directory in /hosted/omp320/omp/www/lib/pkp/classes/file/FileManager.inc.php on line 181
PHP Warning: copy(/{filesPath}/files/presses/0//monographs/1/simple/thumbnail.jpg): failed to open stream: No such file or directory in /hosted/omp320/omp/www/lib/pkp/classes/file/FileManager.inc.php on line 181
PHP Fatal error: Uncaught Error: Call to a member function getSupportedFormLocales() on null in /hosted/omp320/omp/www/classes/install/Upgrade.inc.php:796
Stack trace:
#0 /hosted/omp320/omp/www/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->migrateSubmissionCoverImages()
#1 /hosted/omp320/omp/www/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction()
#2 /hosted/omp320/omp/www/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#3 /hosted/omp320/omp/www/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#4 /hosted/omp320/omp/www/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#5 /hosted/omp320/omp/www/tools/upgrade.php(22): UpgradeTool->execute()
#6 {main}
thrown in /hosted/omp320/omp/www/classes/install/Upgrade.inc.php on line 796

Hi @Alfredo_Cosco

I had this same issue about an year ago. It was caused by a data error (submissions that were in a non-existent press). Please, have a look at this Github issue with some queries to run against your pre-upgrade database:

Best,
Israel Cefrin
PKP Team

1 Like

Hello,
I launched the second query described in the @israel.cefrin link.
The query found some records, then I deleted them.
Now, if I try to upgrade I have this message:

[pre-install]
[load: upgrade.xml]
[version: 3.2.0.0]

[code: Installer Installer::checkPhpVersion]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_chapters.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_categories.xml (skipped)]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_pub_id.xml (skipped)]

[code: Installer Installer::migrateSubmissionCoverImages]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_email_templates.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_versioning_add_ps_seq.xml]
[data: dbscripts/xml/upgrade/3.2.0_preupdate_last_activity.xml]
[schema: lib/pkp/xml/schema/common.xml]
[schema: lib/pkp/xml/schema/scheduledTasks.xml]
[schema: lib/pkp/xml/schema/temporaryFiles.xml]
[schema: lib/pkp/xml/schema/log.xml]
[schema: lib/pkp/xml/schema/notes.xml]
[schema: lib/pkp/xml/schema/controlledVocab.xml]
[schema: lib/pkp/xml/schema/metadata.xml]
[schema: lib/pkp/xml/schema/announcements.xml]
[schema: lib/pkp/xml/schema/reviews.xml]
[schema: lib/pkp/xml/schema/reviewForms.xml]
[schema: lib/pkp/xml/schema/submissions.xml]
[schema: lib/pkp/xml/schema/submissionFiles.xml]
[schema: lib/pkp/xml/schema/tombstone.xml]
[schema: lib/pkp/xml/schema/genres.xml]
[schema: lib/pkp/xml/schema/libraryFiles.xml]
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml]
[schema: lib/pkp/xml/schema/views.xml]
[schema: lib/pkp/xml/schema/metrics.xml]
[schema: lib/pkp/xml/schema/navigationMenus.xml]
[schema: lib/pkp/xml/schema/categories.xml]
[schema: dbscripts/xml/omp_schema.xml]

[code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a Navi
gationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already
a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a Navi
gationMenu attached.

[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]

[code: Installer Installer::migrateUserAndAuthorNames (skipped)]
[data: dbscripts/xml/upgrade/3.2.0_update.xml]
[data: dbscripts/xml/upgrade/3.2.0_stylesheet.xml]
[data: dbscripts/xml/upgrade/3.2.0_navigation_menu_items_locale_change.xml]

[code: Installer Installer::migrateSiteLocales]

[code: Installer Installer::migrateSidebarBlocks]
PHP Notice: Array to string conversion in /mypath/omp/www/lib/pkp/classes/install/Installer.inc.php on line 828

[code: Installer Installer::migrateMetadataSettings]

[code: Installer Installer::installEmailTemplate]

[code: Installer Installer::changeUserRolesAndStageAssignmentsForStagePermitSubmissionEdit]
[data: dbscripts/xml/upgrade/3.2.0_versioning.xml]
ERROR: Upgrade failed: DB: Column ‘publication_id’ cannot be null

Hi @Alfredo_Cosco

Have you checked your publications table for NULL values in the collum publication_id ?

Best,
Israel

1 Like

Hi all, Hello @israel.cefrin,

I found this thread in GitHub:

That’s about my issue.

I tried the suggested query:

SELECT COUNT(*) FROM authors a LEFT JOIN submissions s ON (a.submission_id = s.submission_id) WHERE s.submission_id IS NULL;

suggested by @asmecher but the result is: 0

Don’t know what to do … :expressionless:

Hi @Alfredo_Cosco

Did you restore your original database and run those queries?

Best,
Israel

1 Like

Hello,
I made all the process from beginning.

  1. I cleaned the DB
  2. I moved from 3.1.1 to 3.1.2-4 whithout troubles
  3. then I tryed to upgrate to 3.2.0 with the sql debugger option on and the result is always the same:
UPDATE publication_formats as pf
      SET publication_id = (
            SELECT s.current_publication_id
            FROM temp_publication_formats as tpf
            LEFT JOIN submissions as s
             ON (tpf.submission_id = s.submission_id)
             WHERE pf.publication_format_id = tpf.publication_format_id
            )
          failed. Column 'publication_id' cannot be null

Looking at the error, I tryed to extract from publication_formats values with submission_id = NULL
Then I deleted the result records:

SELECT pf.publication_format_id FROM publication_formats pf LEFT JOIN submissions s ON (pf.submissioion_id = s.submission_id) WHERE s.submission_id IS NULL;         

DELETE FROM publication_formats pf WHERE pf.publication_format_id = (int);

So it worked!!! :smiley: I sucessfully upgraded to 3.2.0.

Now starts the climb to the 3.3

2 Likes