[OJS 3.1.1-4 --> 3.1.2] DB Error: Column 'locale' cannot be null

Hi! Trying to upgrade to 3.1.2 we got something like this:

root@ojs-test:/var/www/ojs-3.1.2# php tools/upgrade.php upgrade
[pre-install]
[load: upgrade.xml]
[version: 3.1.2.0]
[code: Installer Installer::checkPhpVersion]
[data: dbscripts/xml/upgrade/3.1.2_preupdate_user_author_names.xml]
[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]
WARNING: The NavigationMenu (ContextId: 25, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 25, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 24, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 24, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 23, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 23, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 22, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 22, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 20, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 20, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 19, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 19, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 18, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 18, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 17, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 17, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 16, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 16, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 15, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 15, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 14, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 14, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 12, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 12, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 11, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 11, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 10, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 10, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 9, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 9, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 8, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 8, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 7, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 7, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 6, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 6, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 5, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 5, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 4, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 4, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 3, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 3, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 2, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 2, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 13, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 13, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 21, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 21, 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 NavigationMenu attached.
[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
WARNING: The StaticPage "Контакты и адрес" uses a path (address) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage "ПУБЛИКАЦИОННАЯ ЭТИКА" uses a path (ethics) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage "Подача и прохождение рукописей" uses a path (regulations) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
WARNING: The StaticPage "English selection" uses a path (english_selection) that conflicts with an existing Custom Navigation Menu Item path. Skipping this StaticPage.
[code: Installer Installer::migrateSRLocale]
[code: Installer Installer::migrateUserAndAuthorNames]
**<h1>DB Error: Column 'locale' cannot be null</h1>ojs2: DB Error: Column 'locale' cannot be null**

What might we have done wrong?)

You should go through that function.

The first calls where it uses locales are here:

There missing locales can be due to 1) the site is missing a primary locale (unlikely) or 2) a single submission is missing a locale (more likely). So check that your site and all the submissions have a locale set in the db.

1 Like

Hi @ajnyga,
Thank you! We’ve tried to run the migration once more (without changing anything else). And now we have this:

[code: Installer Installer::migrateSRLocale]

[code: Installer Installer::migrateUserAndAuthorNames]

DB Error: Duplicate entry '1-ru_RU-givenName-0-0' for key 'user_settings_pkey'

ojs2: DB Error: Duplicate entry '1-ru_RU-givenName-0-0' for key 'user_settings_pkey'

I suspect that you need to start from a fresh backup. The upgrade process probably already did some changes to the database. If you now try to run an upgrade again using that same db it will try to do the same conversions again you probably end up with duplicate key errors because of that.

Yes, but we are at a loss with that first error. Since:

mysql> select * from user_settings where locale is null;
Empty set (0.00 sec)
mysql> select * from author_settings where locale is null;
Empty set (0.00 sec)
mysql> select * from user_group_settings where locale is null;
Empty set (0.00 sec)
select * from citation_settings where locale is null;
Empty set (0.00 sec)

So I suspect we might get it again…

See my previous post.

The null value might come from the submissions table or the site primary locale settings. If the error occurs in the sql’s I linked above.

1 Like

@ajnyga, Thank you so much, you were right. Those NULL values come from the submissions table:

mysql> select * from submissions where locale is null;
+---------------+--------+------------+------------+----------+-----------+----------------+---------------------+----------------------+--------+---------------------+-------+-------------+----------+
| submission_id | locale | context_id | section_id | language | citations | date_submitted | last_modified       | date_status_modified | status | submission_progress | pages | hide_author | stage_id |
+---------------+--------+------------+------------+----------+-----------+----------------+---------------------+----------------------+--------+---------------------+-------+-------------+----------+
|          2840 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-01-23 22:39:57 | 2017-01-23 22:39:57  |      1 |                   1 | NULL  |           0 |        1 |
|          2841 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-01-23 22:40:42 | 2017-01-23 22:40:42  |      1 |                   1 | NULL  |           0 |        1 |
|          2863 | NULL   |         14 |       NULL | NULL     | NULL      | NULL           | 2017-01-27 16:22:13 | 2017-01-27 16:22:13  |      1 |                   1 | NULL  |           0 |        1 |
|          2864 | NULL   |         14 |       NULL | NULL     | NULL      | NULL           | 2017-01-27 16:22:29 | 2017-01-27 16:22:29  |      1 |                   1 | NULL  |           0 |        1 |
|          2870 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-01 13:28:21 | 2017-02-01 13:28:21  |      1 |                   1 | NULL  |           0 |        1 |
|          2881 | NULL   |         14 |        153 | NULL     | NULL      | NULL           | 2017-02-06 14:05:23 | 2017-02-06 14:05:23  |      1 |                   1 | NULL  |           0 |        1 |
|          2883 | NULL   |          2 |          2 | NULL     | NULL      | NULL           | 2017-02-07 13:14:28 | 2017-02-07 13:14:28  |      1 |                   1 | NULL  |           0 |        1 |
|          2894 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-02-12 00:36:57 | 2017-02-12 00:36:57  |      1 |                   1 | NULL  |           0 |        1 |
|          2904 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-16 15:03:46 | 2017-02-16 15:03:46  |      1 |                   1 | NULL  |           0 |        1 |
|          3145 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-16 16:05:53 | 2017-02-16 16:05:53  |      1 |                   1 | NULL  |           0 |        1 |
|          3146 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-16 16:08:09 | 2017-02-16 16:08:09  |      1 |                   1 | NULL  |           0 |        1 |
|          3147 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-16 16:08:17 | 2017-02-16 16:08:17  |      1 |                   1 | NULL  |           0 |        1 |
|          3148 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-16 16:08:24 | 2017-02-16 16:08:24  |      1 |                   1 | NULL  |           0 |        1 |
|          3156 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-16 18:03:28 | 2017-02-16 18:03:28  |      1 |                   1 | NULL  |           0 |        1 |
|          3160 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-16 18:10:04 | 2017-02-16 18:10:04  |      1 |                   1 | NULL  |           0 |        1 |
|          3161 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-16 18:25:57 | 2017-02-16 18:25:57  |      1 |                   1 | NULL  |           0 |        1 |
|          3162 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-17 10:32:35 | 2017-02-17 10:32:35  |      1 |                   1 | NULL  |           0 |        1 |
|          3165 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-02-17 13:50:56 | 2017-02-17 13:50:56  |      1 |                   1 | NULL  |           0 |        1 |
|          3166 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-02-17 13:52:04 | 2017-02-17 13:52:04  |      1 |                   1 | NULL  |           0 |        1 |
|          3168 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-02-17 14:02:23 | 2017-02-17 14:02:23  |      1 |                   1 | NULL  |           0 |        1 |
|          3169 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-17 15:08:08 | 2017-02-17 15:08:08  |      1 |                   1 | NULL  |           0 |        1 |
|          3170 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-02-17 15:35:46 | 2017-02-17 15:35:46  |      1 |                   1 | NULL  |           0 |        1 |
|          3199 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-02-20 12:10:46 | 2017-02-20 12:10:46  |      1 |                   1 | NULL  |           0 |        1 |
|          3200 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-02-20 15:37:30 | 2017-02-20 15:37:30  |      1 |                   1 | NULL  |           0 |        1 |
|          3201 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-21 16:46:37 | 2017-02-21 16:46:37  |      1 |                   1 | NULL  |           0 |        1 |
|          3202 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-02-21 16:47:04 | 2017-02-21 16:47:04  |      1 |                   1 | NULL  |           0 |        1 |
|          3211 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-02-22 21:28:56 | 2017-02-22 21:28:56  |      1 |                   1 | NULL  |           0 |        1 |
|          3217 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-03-01 20:43:08 | 2017-03-01 20:43:08  |      1 |                   1 | NULL  |           0 |        1 |
|          3222 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-03-02 14:06:22 | 2017-03-02 14:06:22  |      1 |                   1 | NULL  |           0 |        1 |
|          3223 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-03-02 14:06:26 | 2017-03-02 14:06:26  |      1 |                   1 | NULL  |           0 |        1 |
|          3224 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-03-02 15:29:43 | 2017-03-02 15:29:43  |      1 |                   1 | NULL  |           0 |        1 |
|          3225 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-03-02 15:30:28 | 2017-03-02 15:30:28  |      1 |                   1 | NULL  |           0 |        1 |
|          3227 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-03-02 15:45:24 | 2017-03-02 15:45:24  |      1 |                   1 | NULL  |           0 |        1 |
|          3234 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-03-14 20:29:21 | 2017-03-14 20:29:21  |      1 |                   1 | NULL  |           0 |        1 |
|          4415 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-03-31 22:47:45 | 2017-03-31 22:47:29  |      1 |                   1 | NULL  |           0 |        1 |
|          4416 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-03-31 22:48:45 | 2017-03-31 22:48:33  |      1 |                   1 | NULL  |           0 |        1 |
|          4417 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-03-31 22:56:30 | 2017-03-31 22:56:30  |      1 |                   1 | NULL  |           0 |        1 |
|          4419 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-03-31 23:06:52 | 2017-03-31 23:06:24  |      1 |                   1 | NULL  |           0 |        1 |
|          4483 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-04-12 11:47:50 | 2017-04-12 11:47:50  |      1 |                   1 | NULL  |           0 |        1 |
|          4857 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-04-20 13:11:58 | 2017-04-20 13:11:58  |      1 |                   1 | NULL  |           0 |        1 |
|          4861 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-04-20 14:02:21 | 2017-04-20 14:02:21  |      1 |                   1 | NULL  |           0 |        1 |
|          4862 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-04-20 14:18:57 | 2017-04-20 14:18:57  |      1 |                   1 | NULL  |           0 |        1 |
|          4865 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-04-20 14:44:47 | 2017-04-20 14:44:47  |      1 |                   1 | NULL  |           0 |        1 |
|          5554 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-05-16 18:38:44 | 2017-05-16 18:38:44  |      1 |                   1 | NULL  |           0 |        1 |
|          6473 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-05-31 18:17:59 | 2017-05-31 18:17:59  |      1 |                   1 | NULL  |           0 |        1 |
|          6475 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-05-31 18:48:01 | 2017-05-31 18:48:01  |      1 |                   1 | NULL  |           0 |        1 |
|          6493 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-06-03 23:18:27 | 2017-06-03 23:18:27  |      1 |                   1 | NULL  |           0 |        1 |
|          6494 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-06-03 23:18:32 | 2017-06-03 23:18:32  |      1 |                   1 | NULL  |           0 |        1 |
|          6503 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-06-04 00:39:06 | 2017-06-04 00:39:06  |      1 |                   1 | NULL  |           0 |        1 |
|          6504 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-06-04 00:39:38 | 2017-06-04 00:39:38  |      1 |                   1 | NULL  |           0 |        1 |
|          6519 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-06-06 20:51:39 | 2017-06-06 20:51:39  |      1 |                   1 | NULL  |           0 |        1 |
|          6520 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-06-06 20:58:52 | 2017-06-06 20:58:52  |      1 |                   1 | NULL  |           0 |        1 |
|          6525 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-06-09 17:59:11 | 2017-06-09 17:59:11  |      1 |                   1 | NULL  |           0 |        1 |
|          6526 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-06-09 17:59:52 | 2017-06-09 17:59:52  |      1 |                   1 | NULL  |           0 |        1 |
|          6527 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-06-09 18:00:08 | 2017-06-09 18:00:08  |      1 |                   1 | NULL  |           0 |        1 |
|          6776 | NULL   |         20 |        427 | NULL     | NULL      | NULL           | 2017-06-14 21:18:53 | 2017-06-14 21:18:53  |      1 |                   1 | NULL  |           0 |        1 |
|          6792 | NULL   |         18 |        358 | NULL     | NULL      | NULL           | 2017-06-16 13:14:03 | 2017-06-16 13:14:03  |      1 |                   1 | NULL  |           0 |        1 |
|          6833 | NULL   |          1 |       NULL | NULL     | NULL      | NULL           | 2017-06-26 13:13:44 | 2017-06-26 13:13:44  |      1 |                   1 | NULL  |           0 |        1 |
|          6871 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-06-30 18:40:16 | 2017-06-30 18:40:16  |      1 |                   1 | NULL  |           0 |        1 |
|          6873 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-06-30 18:49:18 | 2017-06-30 18:49:18  |      1 |                   1 | NULL  |           0 |        1 |
|          6884 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-06-30 19:36:02 | 2017-06-30 19:36:02  |      1 |                   1 | NULL  |           0 |        1 |
|          6886 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-06-30 21:43:13 | 2017-06-30 21:43:13  |      1 |                   1 | NULL  |           0 |        1 |
|          6903 | NULL   |         19 |       NULL | NULL     | NULL      | NULL           | 2017-07-13 14:57:02 | 2017-07-13 14:57:02  |      1 |                   1 | NULL  |           0 |        1 |
|          6905 | NULL   |         19 |       NULL | NULL     | NULL      | NULL           | 2017-07-13 15:37:36 | 2017-07-13 15:37:36  |      1 |                   1 | NULL  |           0 |        1 |
|          6911 | NULL   |         19 |        405 | NULL     | NULL      | NULL           | 2017-07-14 13:37:57 | 2017-07-14 13:37:19  |      1 |                   1 | NULL  |           0 |        1 |
|          6914 | NULL   |         19 |        405 | NULL     | NULL      | NULL           | 2017-07-14 14:05:51 | 2017-07-14 14:05:51  |      1 |                   1 | NULL  |           0 |        1 |
|          7033 | NULL   |         18 |        358 | NULL     | NULL      | NULL           | 2017-09-25 00:59:34 | 2017-09-25 00:59:34  |      1 |                   1 | NULL  |           0 |        1 |
|          7052 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-09-27 14:44:24 | 2017-09-27 14:41:36  |      1 |                   1 | NULL  |           0 |        1 |
|          7054 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-09-27 14:59:40 | 2017-09-27 14:59:40  |      1 |                   1 | NULL  |           0 |        1 |
|          7055 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-09-27 15:00:18 | 2017-09-27 15:00:18  |      1 |                   1 | NULL  |           0 |        1 |
|          7056 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-09-27 15:00:25 | 2017-09-27 15:00:25  |      1 |                   1 | NULL  |           0 |        1 |
|          7057 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-09-27 15:00:36 | 2017-09-27 15:00:36  |      1 |                   1 | NULL  |           0 |        1 |
|          7058 | NULL   |          5 |         30 | NULL     | NULL      | NULL           | 2017-09-27 15:04:16 | 2017-09-27 15:04:16  |      1 |                   1 | NULL  |           0 |        1 |
|          7076 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-10-05 15:11:51 | 2017-10-05 15:11:51  |      1 |                   1 | NULL  |           0 |        1 |
|          7077 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-10-05 15:28:55 | 2017-10-05 15:28:55  |      1 |                   1 | NULL  |           0 |        1 |
|          7079 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-10-05 16:15:31 | 2017-10-05 16:15:31  |      1 |                   1 | NULL  |           0 |        1 |
|          7080 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-10-06 12:07:20 | 2017-10-06 12:07:20  |      1 |                   1 | NULL  |           0 |        1 |
|          7097 | NULL   |         20 |        439 | NULL     | NULL      | NULL           | 2017-10-09 21:52:58 | 2017-10-09 21:52:58  |      1 |                   1 | NULL  |           0 |        1 |
|          7109 | NULL   |         20 |        439 | NULL     | NULL      | NULL           | 2017-10-13 17:29:30 | 2017-10-13 17:29:30  |      1 |                   1 | NULL  |           0 |        1 |
|          7110 | NULL   |         20 |        439 | NULL     | NULL      | NULL           | 2017-10-13 17:30:26 | 2017-10-13 17:30:26  |      1 |                   1 | NULL  |           0 |        1 |
|          7111 | NULL   |         20 |        439 | NULL     | NULL      | NULL           | 2017-10-13 17:30:42 | 2017-10-13 17:30:42  |      1 |                   1 | NULL  |           0 |        1 |
|          7113 | NULL   |         20 |        439 | NULL     | NULL      | NULL           | 2017-10-13 19:16:08 | 2017-10-13 19:16:08  |      1 |                   1 | NULL  |           0 |        1 |
|          7114 | NULL   |         20 |        439 | NULL     | NULL      | NULL           | 2017-10-13 19:17:07 | 2017-10-13 19:17:07  |      1 |                   1 | NULL  |           0 |        1 |
|          7179 | NULL   |         11 |        137 | NULL     | NULL      | NULL           | 2017-12-01 12:02:14 | 2017-12-01 12:02:14  |      1 |                   1 | NULL  |           0 |        1 |
|          7284 | NULL   |         14 |        153 | NULL     | NULL      | NULL           | 2017-12-13 10:07:55 | 2017-12-13 10:07:55  |      1 |                   1 | NULL  |           0 |        1 |
|          7358 | NULL   |          8 |        314 | NULL     | NULL      | NULL           | 2017-12-30 17:22:43 | 2017-12-30 17:22:43  |      1 |                   1 | NULL  |           0 |        1 |
+---------------+--------+------------+------------+----------+-----------+----------------+---------------------+----------------------+--------+---------------------+-------+-------------+----------+
86 rows in set (0.01 sec)

The question now is how is it crucial during the upgrade process? And should we change this somehow before the upgrade?

Now that in 3.1.2 author names can be localised you need to define what locale the original author name uses. And the upgrade script is trying to fetch that data using the submission locale, but since that is missing, you get an error in the sql above.

@asmecher I think this is a bug in the upgrade code. I think the locale should fallback to the context primary locale, if the submission does not have a locale set.

1 Like

Dear @ajnyga,
I’m really thankful for your help. We’ve changed those NULL values to the default locale. And now the upgrade process has gone through without ‘DB errors’.

I do agree, this might be filed as a bug. However, since all of those submissions took place in 2017, I suspect those NULL values might have slipped in there with some first versions of the QuickSubmit plugin. E.g., the Submission Language field might not have been set as mandatory.

Hi

yes probably that is the case. The way article locales are handled changed a couple of years ago, but a lot of older journals are bound to have those null values there as well, so adding a fallback value might be a good idea there. An easy fallback would be the journal primary locale.

Hi all,

The locale column of the submissions / articles table was introduced way back with OJS 2.3.2, and that commit includes a script to introduce a locale for existing content based on the journal’s primary language. I’ve operated since then on the assumption that a valid submission locale will be set. Do you have any information on how you came to have submissions without a valid locale? I’d view that as a data error (and one that I’d expect would cause problems elsewhere).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
We started using OJS from 3.0.1. So it could not come from OJS 2.*.
As I’ve mentioned above the only hypothesis is it might be related to some earlier versions of the QuickSumit plugin.

ah ok, I was remembered that the locale came much later.

Our database has 57 submissions with locale set to null. But I think that they are all submissions that have been left to the first step of the submission process.

And I think that is also the case with @Ph_We’s submissions. See above that all date_submitted fields are empty.

probably the user is added as the primary author of the submission to the moment the process starts. If the process is left to step 1, then no submission locale is set => the error occurs in the upgrade.

This will touch all journals with submissions left to step 1 so definitely needs fixing.

one more note: also my submissions are all from the year 2017. So it is a specific version of OJS that created those entries without a locale. The current versions most likely do not create this problem anymore.

As seen from the table above, our submissions are limited to the year 2017 too.

My locale=null submissions start with 3.0.2 (Feb 2017) but they end a couple of months before I upgraded to 3.1.0.1. It could be that I patched something before the upgrade that affected this.

I have a hunch that this has only happened to journals that use more than one submission language. In our case many journals use a combination of Finnish/English/Swedish. @Ph_We you have multiple languages in use as well I think?

But I think it is safe to say that many others are bound to have those null values as well.

Yes, we have multiple languages too. And here is our version history:

So yes, NULL values must have disappeared after upgrading to 3.1.0.1.

Hi,
I’m having the same issue, I start from OJS 3.0.2-0

upgrading from 3.0.2-0 to 3.1.0 worked
upgrading from 3.1.0 to 3.1.0-1 worked
upgrading from 3.1.0-1 to 3.1.1 worked
upgrading from 3.1.1 to 3.1.1-1 worked
upgrading from 3.1.1-1 to 3.1.1-2 worked

but upgrading from 3.1.1-2 to 3.1.1-4 leads to error.

"…
[data: dbscripts/xml/indexes.xml]

[code: Installer Installer::installDefaultNavigationMenus]
WARNING: The NavigationMenu (ContextId: 8, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 8, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 7, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 7, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 1, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu 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: 2, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 2, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 5, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 5, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 3, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 3, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 11, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 11, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 6, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 6, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 12, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 12, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 9, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
WARNING: The NavigationMenu (ContextId: 9, 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 NavigationMenu attached.

[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]

[code: Installer Installer::migrateSRLocale]

[code: Installer Installer::migrateUserAndAuthorNames]
ojs2: DB Error: Column ‘locale’ cannot be null

DB Error: Column 'locale' cannot be null

"

maybe a workarround could help… I need to get that OJS 3.0.2-0 to the last version…

thanks.
sds, Nicolás

My workarroud was:
mysql> update submissions set locale = ‘es_ES’ where locale is null;

it worked.

sds, Nicolás.