Error Upgrade 2.4.8.2 to 3.1.0

Hi @bozana,
thank you.

I’m fixing the bugs according to your tips.
About installDefaultNavigationMenus errors, in the DB table site its has just: 'en_US:es_ES:pt_BR:fr_FR' in the column supported_locales. Is there something wrong?

Hi @Adriano_Jose,
Hmmm… no that looks good…
Hmmm… :thinking:

Hi
I’m upgrading OJS 2.4.6 to OJS 3.1.0-1 and when I run “php tools/upgrade.php upgrade” always return such error

PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /ojs_v3.1.0_1/classes/install/Upgrade.inc.php:1103
Stack trace:
#0 /ojs_v3.1.0_1/lib/pkp/classes/install/Installer.inc.php(415): Upgrade->convertSupplementaryFiles(Object(Upgrade), Array)
#1 /ojs_v3.1.0_1/lib/pkp/classes/install/Installer.inc.php(265): Installer->executeAction(Array)
#2 /ojs_v3.1.0_1/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#3 /ojs_v3.1.0_1/lib/pkp/classes/cliTool/UpgradeTool.inc.php(88): Installer->execute()
#4 /ojs_v3.1.0_1/lib/pkp/classes/cliTool/UpgradeTool.inc.php(64): UpgradeTool->upgrade()
#5 /ojs_v3.1.0_1/tools/upgrade.php(34): UpgradeTool->execute()
#6 {main}
thrown in /ojs_v3.1.0_1/classes/install/Upgrade.inc.php on line 1103

My system consists of the following:

PHP 7.0
MySQL 5.7.21
Apache 2.4.18

I don’t know how could i solve that?

Hi @Adriano_Jose and @bozana
Do you know how I can find all the files with the same problem where you comment that?

Every week I starting a new process upgrade with new id error:
ERROR: Upgrade failed: DB: ERROR: null value in column "review_round_id

I have more than 200 journals.

Regards,
xavi

Hi @xavi

Could you maybe explain a little bit more what is exactly happening in your upgrade? – Could you post the steps that are done and where it stops (i.e. the output you get when you start the upgrade via CLI with “php tools/upgarede.php upgrade”)?
Also, what were the earlier steps, for earlier upgrade attempts, that you did?

Best,
Bozana

Oh, OK, now I see the other post: Upgrade to OJS 3.0 from 2.4.8.0 - Error while converting supplementary files - #72 by xavi

I am not sure if I am thinking right, but could you execute this SQL on your 2.4.x DB:
SELECT ra.review_id, ra.submission_id, ra.reviewer_file_id FROM review_assignments ra WHERE ra.reviewer_file_id IS NOT NULL AND ra.reviewer_file_id NOT IN (SELECT file_id FROM article_files)
to see if a reviewer file is missing in the article_files table.

EDIT: maybe also this SQL:
SELECT DISTINCT ra.submission_id, ra.round, af.revision FROM review_assignments ra, article_files af, articles a WHERE (ra.submission_id, ra.round) NOT IN (SELECT rr.submission_id, rr.round FROM review_rounds rr) AND a.article_id = ra.submission_id AND af.article_id = a.article_id AND af.file_id = a.review_file_id AND af.round = ra.round
to see if eventually a review round entry is missing in the DB.

Best,
Bozana

HI @bozana,
I executed this query:
SELECT DISTINCT ra.submission_id, ra.round, af.revision FROM review_assignments ra, article_files af, articles a WHERE (ra.submission_id, ra.round) NOT IN (SELECT rr.submission_id, rr.round FROM review_rounds rr) AND a.article_id = ra.submission_id AND af.article_id = a.article_id AND af.file_id = a.review_file_id AND af.round = ra.round;

I look this:

| submission_id| round | revision |
|261823| 1| 1|
|267199| 1| 1|


With the first query:

SELECT ra.review_id, ra.submission_id, ra.reviewer_file_id FROM review_assignments ra WHERE ra.reviewer_file_id IS NOT NULL AND ra.reviewer_file_id NOT IN (SELECT file_id FROM article_files)

I can see this:

|review_id|submission_id|reviewer_file_id|
|568 | 305936 | 435326 |

I will wait to next week to checked if my upgrade process is fail about some submission_id appear from this query.

Regards,
xavi.

Hi @xavi

Hmmm… If I understand it correctly, there are a few problems in your 2.4.x DB:

  1. Two entries in the DB table review_rounds are missing for two articles that are/were already assigned to a reviewer. These are articles 261823 and 267199. Could you double check those articles as editor via GUI, to see their review workflow step – are/were they assigned to a reviewer and what is their current status?
    Eventually you would then need to insert an entry in the DB manually, but lets first see what you see via GUI and if there is anything suspicious with those two articles…
  2. The reviewer file with the id 435326 from the article 305936 seems not to exist in the DB table article_files. Could you please double check that? Also, could you see if there is a file with the name something like “305936-435326-…-RV…” in your files folder, for that article 305936?

Best,
Bozana

Hi @bozana,

The file 305936-435326-…-RV is not exists.

  • I checked the history from GUI and I can see:
  • The round 3 review by XXXX for submission 305936 has been cleared.
  • The submission 305936 has been archived.
    It’s not result with this query

    SELECT * FROM article_files WHERE article_id=305936 AND file_id=435326


Article: 261823:
The article was publicated with QuickSubmit and this article has 3 reviewers:

  • First reviewer not recomendations
  • Second reviewer Not accepted
  • Third reviewer was deleted
  • This article was archived

Article: 267199:

  • Added a new PDF and assigned a reviewer but it didn’t something.
  • Archived article.
  • It could be a testing process in OJS

I'm not sure about this problems, I can delete the last Article (267199)

Regards,
xavi,

HI @bozana,
my upgrade is failed again but with different submission_id
The error log:
mysql): SELECT * FROM submission_file_settings WHERE file_id = ‘486099’

(mysql): SELECT	s.*, ps.date_published,
				COALESCE(stl.setting_value, stpl.setting_value) AS section_title,
			COALESCE(sal.setting_value, sapl.setting_value) AS section_abbrev
			FROM	submissions s
				LEFT JOIN published_submissions ps ON (s.submission_id = ps.submission_id)
				JOIN sections se ON se.section_id = s.section_id
			LEFT JOIN section_settings stpl ON (se.section_id = stpl.section_id AND stpl.setting_name = 'title' AND stpl.locale = 'en_US')
			LEFT JOIN section_settings stl ON (se.section_id = stl.section_id AND stl.setting_name = 'title' AND stl.locale = 'en_US')
			LEFT JOIN section_settings sapl ON (se.section_id = sapl.section_id AND sapl.setting_name = 'abbrev' AND sapl.locale = 'en_US')
			LEFT JOIN section_settings sal ON (se.section_id = sal.section_id AND sal.setting_name = 'abbrev' AND sal.locale = 'en_US')
			WHERE	s.submission_id = 335770
				 
-----<hr>
(mysql): SELECT * FROM submission_settings WHERE submission_id = '335770' 

-----<hr>
(mysql): SELECT	s.*, ps.date_published,
				COALESCE(stl.setting_value, stpl.setting_value) AS section_title,
			COALESCE(sal.setting_value, sapl.setting_value) AS section_abbrev
			FROM	submissions s
				LEFT JOIN published_submissions ps ON (s.submission_id = ps.submission_id)
				JOIN sections se ON se.section_id = s.section_id
			LEFT JOIN section_settings stpl ON (se.section_id = stpl.section_id AND stpl.setting_name = 'title' AND stpl.locale = 'en_US')
			LEFT JOIN section_settings stl ON (se.section_id = stl.section_id AND stl.setting_name = 'title' AND stl.locale = 'en_US')
			LEFT JOIN section_settings sapl ON (se.section_id = sapl.section_id AND sapl.setting_name = 'abbrev' AND sapl.locale = 'en_US')
			LEFT JOIN section_settings sal ON (se.section_id = sal.section_id AND sal.setting_name = 'abbrev' AND sal.locale = 'en_US')
			WHERE	s.submission_id = 335770
				 
   
-----<hr>
-----<hr>
(mysql): SELECT * FROM submission_settings WHERE submission_id = '335770' 
   
-----<hr>
[code: Installer Installer::fixAuthorGroup]
-----<hr>
(mysql): SELECT a.author_id, s.context_id FROM authors a JOIN submissions s ON (a.submission_id = s.submission_id) JOIN user_groups g ON (a.user_group_id = g.user_group_id) WHERE g.context_id <> s.context_id 
   
-----<hr>
[data: dbscripts/xml/upgrade/3.0.0_reviewer_files.xml]
-----<hr>
(mysql): SELECT TABLE_NAME, CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=SCHEMA() 
   
-----<hr>
-----<hr>
(mysql): UPDATE submission_files sf, review_assignments ra SET sf.file_stage = 5, sf.assoc_type = 517, sf.assoc_id = ra.review_id WHERE ra.reviewer_file_id IS NOT NULL AND sf.file_id = ra.reviewer_file_id 
   
-----<hr>
-----<hr>
(mysql): INSERT INTO review_round_files (submission_id, review_round_id, stage_id, file_id, revision) SELECT ra.submission_id, ra.review_round_id, 3, ra.reviewer_file_id, sf.revision FROM review_assignments ra, submission_files sf WHERE ra.reviewer_file_id IS NOT NULL AND sf.file_id = ra.reviewer_file_id 
   
-----<hr>
1048: Column 'review_round_id' cannot be null
							ADOConnection._Execute(INSERT INTO review_round_files (submission_id, review_round_id, stage_id, file_id, revision) SELECT ra.submission_id, ra.review_..., false)% line 1051, file: ojs/lib/pkp/lib/adodb/adodb.inc.php
						ADOConnection.Execute(INSERT INTO review_round_files (submission_id, review_round_id, stage_id, file_id, revision) SELECT ra.submission_id, ra.review_...)% line  440, file: ojs/lib/pkp/classes/install/Installer.inc.php
					Installer.executeSQL(INSERT INTO review_round_files (submission_id, review_round_id, stage_id, file_id, revision) SELECT ra.submission_id, ra.review_...)% line  435, file: ojs/lib/pkp/classes/install/Installer.inc.php
				Installer.executeSQL(Array[3])% line  396, file: ojs/lib/pkp/classes/install/Installer.inc.php
			Installer.executeAction(Array[3])% line  265, file: ojs/lib/pkp/classes/install/Installer.inc.php
ERROR: Upgrade failed: DB: Column 'review_round_id' cannot be null

As you can see, I have a new submission_id=335770.
From database, I searched this article and the submission_file_id=483131
This file is not in my folders.

I attached a image with event log from GUI

screenshot_log_event335770

I checked files in folder:

ls -l files/journals/159/articles/335770/submission/review
total 2.4M
-rw-r–r-- 1 apache apache 292K Jul 26 22:57 335770-483136-2-RV.pdf
-rw-r–r-- 1 apache apache 292K Jul 26 22:58 335770-483136-3-RV.pdf
-rw-r–r-- 1 apache apache 928K Jul 26 22:58 335770-483136-4-RV.pdf
-rw-r–r-- 1 apache apache 885K Mar 19 2018 335770-829-483136-1-4-20180319.pdf
drwxr-xr-x 2 root root 4.0K Oct 18 23:05 attachment




ls -l files/journals/159/articles/335770/submission/editor
total 3552
-rw-r–r-- 1 apache apache 949726 Jul 20 17:19 335770-489146-1-ED.pdf
-rw-r–r-- 1 apache apache 68465 Jul 20 17:19 335770-489146-2-ED.tex
-rw-r–r-- 1 apache apache 732167 Jul 20 17:19 335770-489146-3-ED.rar
-rw-r–r-- 1 apache apache 8154 Jul 20 17:20 335770-489146-4-ED.rar
-rw-r–r-- 1 apache apache 298870 Jul 20 17:20 335770-489146-5-ED.pdf
-rw-r–r-- 1 apache apache 298870 Jul 26 22:57 335770-490069-1-ED.pdf
-rw-r–r-- 1 apache apache 298870 Jul 26 22:58 335770-490070-1-ED.pdf
-rw-r–r-- 1 apache apache 949726 Jul 26 22:58 335770-490070-2-ED.pdf



in folder: files/journals/159/articles/335770/submission

ls -lh files/journals/159/articles/335770/submission/
total 908K
-rw-r–r-- 1 apache apache 885K Mar 19 2018 335770-829-483131-1-2-20180319.pdf
drwxr-xr-x 2 apache apache 4.0K Jul 26 22:58 editor
drwxr-xr-x 2 apache apache 4.0K Oct 18 19:44 original
drwxr-xr-x 2 root root 4.0K Oct 18 20:08 proof
drwxr-xr-x 3 apache apache 4.0K Oct 18 23:05 review

Regards,
xavi.

Hi @xavi

So lets first solve the first 2 issues – then try a clean upgrade again and see further:
First please make the OJS 2.4.x full backup!!!
Then:

  1. Could you please manually insert two new entries/rows in your OJS 2.4.x DB table review_rounds: 1) withe the submission_id = 261823, round = 1, review_revision = 1, stage_id = NULL, status = NULL, and 2) with the submission_id = 267199, round = 1, review_revision = 1, stage_id = NULL, status = NULL.
    Then please do a DB backup again and keep it as well.

  2. Could you please do one more SQL:
    SELECT ra.review_id, ra.submission_id, ra.reviewer_file_id, ra.round FROM review_assignments ra WHERE ra.reviewer_file_id IS NOT NULL AND ra.reviewer_file_id NOT IN (SELECT file_id FROM article_files)
    To see the review round where from where that file is missing…

Thanks!
Bozana

1 Like

Hi @bozana,
About point 2 before the insert data in DB

SELECT ra.review_id, ra.submission_id, ra.reviewer_file_id, ra.round FROM review_assignments ra WHERE ra.reviewer_file_id IS NOT NULL AND ra.reviewer_file_id NOT IN (SELECT file_id FROM article_files);
+-----------+---------------+------------------+-------+
| review_id | submission_id | reviewer_file_id | round |
+-----------+---------------+------------------+-------+
|       568 |        305936 |           435326 |     2 |
+-----------+---------------+------------------+-------+

I’ll do the point 1.

Regards.
xavi.

Hi @xavi

So the reviewer file is missing for a review in the round 2 for that submission. Could you please take a look at that article, review round 2 and see if there is a link to a reviewer file, if its download fails, or what else do you see there?
Then maybe, either to remove that file via GUI and if you have the correct file to upload it via GUI at the correct place (probably as reviewer).

Thanks!
Bozana

I have an error message like

ERROR: Reviewer files with ID 145622 from review assignment 6309 could not be found in the database table submission_files

Is the way to fix this to delete a row, like this?:
Delete the entry from DB table review_assignments where review_file_id is 145622
or
where review_id is 6309

This is what bozana wrote in Nov. 2017. But did that fix that kind of error message? or instead is there something else that worked? It is difficult for me to follow, because this is a long thread.

Thanks for any assistance,
-Wilhelmina

Hi @bozana,

On my submission_id = 305936 I cannot see on my GUI this review_file_id = 435326 with round=2
I deleted this submission_id to continue with process upgrade but I don’t know if I need to update my database before.

Regards,
xavi

tks a lot! Its clear my way