BUG after upgrade 3.0.2 to 3.1.0.1 (menu bar is missing)

Hi @asmecher,

I’ve forget to mention, this was what I’ve tried first

I’ve inserted the journals 2,3,4,5,7 using datagrip:

|2|teste1|70|pt_BR|0|
|3|teste2|71|pt_BR|0|
|4|teste3|72|pt_BR|0|
|5|teste4|73|pt_BR|0|
|7|teste5|74|pt_BR|0|

Then i’ve went to: [URL]index.php/index/admin/contexts on browser and removed teste1, teste2, teste3, teste4, teste5

But after that, when I run:

It still return the 96 entries.

Regards,
Rafael Mansilha

Hi @rafaelmansilha,

Hmm, odd. After you run your set of DELETE statements above, does the SELECT command return an empty set?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Yes, it did return a empty set.

Every time i’ve tried a new approaches i’ve start with a new backup from production server on a teste server

Regards,
Rafael Mansilha

Hi @asmecher,

I’ve noticed that different of [Solved] Upgrading 3.0.2 to 3.1.01 moveReviewerFiles fails O don’t has errors like on moveReviewerFiles function:

ERROR: Reviewer files with ID 6311 from review assignment 125 could not be found in the database table submission_files
PHP Warning:  rename(/var/www/server.fi/files/journals/30//articles/2545/submission/review/attachment/2545-121-6773-4-5-20100506.doc,/var/www/server.fi/files/journals/30//articles/2545/submission/review/attachment/2545-121-6773-4-5-20100506.doc): Tiedostoa tai hakemistoa ei ole in /var/www/server.fi/public_html/classes/install/Upgrade.inc.php on line 2003
ERROR: Unable to move "/var/www/server.fi/files/journals/30//articles/2545/submission/review/attachment/2545-121-6773-4-5-20100506.doc" to "/var/www/server.fi/files/journals/30//articles/2545/submission/review/attachment/2545-121-6773-4-5-20100506.doc".
ERROR: Reviewer files with ID 15845 from review assignment 716 could not be found in the database table submission_files
ERROR: Reviewer files with ID 16355 from review assignment 717 could not be found in the database table submission_files

Unlike the other post, it was like:

[homolog] < [code: Installer Installer::moveReviewerFiles]
[homolog] < <h1>There are no readable files in this directory tree. Are safe mode or open_basedir active?</h1>
[homolog] < ojs2: There are no readable files in this directory tree. Are safe mode or open_basedir active?

perhabs it’s not a missing file problem like the other post.

Regards,
Rafael Mansilha.

Hi!

By enabling debug (database) and show_stacktrace on config.inc.php, i’ve got this final output on database upgrade:
Last query command (that doesn’t returning nothing when I tried):

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

And the stacktrace:

[homolog] < <h1>There are no readable files in this directory tree. Are safe mode or open_basedir active?</h1><h4>Stack Trace:</h4>
[homolog] < <strong>File:</strong> /srv/www/periodicos/releases/21/classes/install/Upgrade.inc.php line 2009<br />
[homolog] < <strong>Function:</strong> FileManager->mkdirtree("")<br />
[homolog] < <br/>
[homolog] < <strong>File:</strong> (unknown) line (unknown)<br />
[homolog] < <strong>Function:</strong> Upgrade->moveReviewerFiles(Object(Upgrade), Array(1))<br />
[homolog] < <br/>
[homolog] < <strong>File:</strong> /srv/www/periodicos/releases/21/lib/pkp/classes/install/Installer.inc.php line 421<br />
[homolog] < <strong>Function:</strong> call_user_func(Array(2), Object(Upgrade), Array(1))<br />
[homolog] < <br/>
[homolog] < <strong>File:</strong> /srv/www/periodicos/releases/21/lib/pkp/classes/install/Installer.inc.php line 265<br />
[homolog] < <strong>Function:</strong> Installer->executeAction(Array(3))<br />
[homolog] < <br/>
[homolog] < <strong>File:</strong> /srv/www/periodicos/releases/21/lib/pkp/classes/install/Installer.inc.php line 186<br />
[homolog] < <strong>Function:</strong> Installer->executeInstaller()<br />
[homolog] < <br/>
[homolog] < <strong>File:</strong> /srv/www/periodicos/releases/21/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 88<br />
[homolog] < <strong>Function:</strong> Installer->execute()<br />
[homolog] < <br/>
[homolog] < <strong>File:</strong> /srv/www/periodicos/releases/21/lib/pkp/classes/cliTool/UpgradeTool.inc.php line 64<br />
[homolog] < <strong>Function:</strong> UpgradeTool->upgrade()<br />
[homolog] < <br/>
[homolog] < <strong>File:</strong> /srv/www/periodicos/releases/21/tools/upgrade.php line 34<br />
[homolog] < <strong>Function:</strong> UpgradeTool->execute()<br />
[homolog] < <br/>
[homolog] < ojs2: There are no readable files in this directory tree. Are safe mode or open_basedir active?

I’ve looked, and before I start the upgrade I run the following command on my deploy: run("sudo chown -R user:user {{deploy_path}}"); “user” is the same user that runs the command php {{release_path}}/tools/upgrade.php upgrade so it shouldn’t be a permission problem:

ls -lsa [OJS_Dir]/files/
Output:

total 264
  8 drwxrwxr-x+  9 user user   4096 Jun  8 16:11 .
  4 drwxrwxr-x   4 user user   4096 Jun  8 16:21 ..
  8 drwxrwxr-x+ 10 user user   4096 Jun  8 16:07 contexts
  8 drwxrwxr-x+  2 user user   4096 Jun  8 16:07 crossref
  8 drwxrwxr-x+  2 user user   4096 Jun  8 16:11 datacite
  8 drwxrwxr-x+ 31 user user   4096 Jun  8 16:11 journals
204 drwxrwxr-x+  2 user user 200704 Jun  8 16:11 scheduledTaskLogs
  8 drwxrwxr-x+ 10 user user  4096 Jun  8 16:07 temp
  8 drwxrwxr-x+  7 user user   4096 Jun  8 16:07 usageStats

Regards,
Rafael Mansilha.

Hi Everyone!

I finally managed to really upgrade OJS to 3.1.1.2 and getting Successfully upgraded to version 3.1.1.2 message with no errors.

If someone is experience this kinds of errors this is how i’ve managed to solve this:

First, as @asmecher showed to me, there were journals that were not completed removed from database:

So I’ve get the create database wuery and searched in it for all journals_ids and context_ids referrences of the deleted journals_id, so this was the tables that i’ve found and deleted the ocurrences: (NOTE! There are more tables with context, context_id and journal_id but this was the only ones that I’ve found references)

DELETE FROM roles WHERE journal_id IN (4,3,7,2,5);
DELETE FROM rt_versions WHERE journal_id IN (4,3,7,2,5);
DELETE FROM notification_subscription_settings WHERE context IN (4,3,7,2,5);
DELETE FROM metrics WHERE context_id IN (4,3,7,2,5);
DELETE FROM authors WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM edit_decisions WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM metrics WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM review_assignments WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM review_round_files WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM review_rounds WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM stage_assignments WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_comments WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_files WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_galleys WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submission_settings WHERE submission_id IN (SELECT submission_id FROM submissions WHERE context_id IN (4,3,7,2,5));
DELETE FROM submissions WHERE context_id IN (4,3,7,2,5);

In that case creating the journal reference on journals table and trying to remove it from UI doesn’t not work.

=====================================================================================

Other problem that I get on [code: Installer Installer::fixGenreIdInFileNames] that get this errors like (that didn’t broke the update, but created many errors):

[homolog] < PHP Warning:  rename(files/journals/20//articles/1705//submission/final/1705-1-15394-1-6-20151201.docx,files/journals/20//articles/1705//submission/final/1705-193-15394-1-6-20151201.docx): Arquivo ou diretório não encontrado in {baseURL}/classes/install/Upgrade.inc.php on line 2490
[homolog] < Unable to move "files/journals/20//articles/1705//submission/final/1705-1-15394-1-6-20151201.docx" to "files/journals/20//articles/1705//submission/final/1705-193-15394-1-6-20151201.docx".

To fix this, I’ve manged to extract the file_id and revision from the file name (example: 1705-193-15394-1-6-20151201) and deleted the occurrences:

DELETE FROM submission_files WHERE file_id IN (16615,21206,21187,20048,18931,18639,18279,17869,21925,17296,21922,21745) AND revision = 2;
DELETE FROM submission_files WHERE file_id = 16729 AND revision = 2 OR revision = 3;
DELETE FROM submission_files WHERE file_id = 24978 AND revision = 4;
DELETE FROM submission_files WHERE file_id = 21576 AND revision = 4 OR revision = 5;
DELETE FROM submission_files WHERE file_id IN (15394, 15421, 15014, 15015, 10551, 10552, 10553, 10563, 10710, 10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 10721, 10722, 10723, 10724, 10725, 13640, 13641,	13642, 13643, 13644, 13645, 15564, 14729, 14404, 14405, 15263, 11457, 11458, 1818, 15588, 10639, 10640, 10641, 11940, 11941, 11942, 15345, 15347, 15348, 15350, 15353, 11528, 14214, 10599, 10600, 12610, 15425, 15432, 15433, 15434, 15412, 15410, 2198, 14080, 14084, 14270, 14271, 14272, 14273, 14274, 14275, 14276, 14282, 14292, 14367);
DELETE FROM submission_file_settings WHERE file_id IN (15394, 15421, 15014, 15015, 10551, 10552, 10553, 10563, 10710, 10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 10721, 10722, 10723, 10724, 10725, 13640, 13641,	13642, 13643, 13644, 13645, 15564, 14729, 14404, 14405, 15263, 11457, 11458, 1818, 15588, 10639, 10640, 10641, 11940, 11941, 11942, 15345, 15347, 15348, 15350, 15353, 11528, 14214, 10599, 10600, 12610, 15425, 15432, 15433, 15434, 15412, 15410, 2198, 14080, 14084, 14270, 14271, 14272, 14273, 14274, 14275, 14276, 14282, 14292, 14367);
DELETE FROM submission_supplementary_files WHERE file_id IN (16615,21206,21187,20048,18931,18639,18279,17869,21925,17296,21922,21745) AND revision = 2;
DELETE FROM submission_supplementary_files WHERE file_id = 16729 AND revision = 2 OR revision = 3;
DELETE FROM submission_supplementary_files WHERE file_id = 24978 AND revision = 4;
DELETE FROM submission_supplementary_files WHERE file_id = 21576 AND revision = 4 OR revision = 5;
DELETE FROM submission_supplementary_files WHERE file_id IN (15394, 15421, 15014, 15015, 10551, 10552, 10553, 10563, 10710, 10711, 10712, 10713, 10714, 10715, 10716, 10717, 10718, 10719, 10720, 10721, 10722, 10723, 10724, 10725, 13640, 13641,	13642, 13643, 13644, 13645, 15564, 14729, 14404, 14405, 15263, 11457, 11458, 1818, 15588, 10639, 10640, 10641, 11940, 11941, 11942, 15345, 15347, 15348, 15350, 15353, 11528, 14214, 10599, 10600, 12610, 15425, 15432, 15433, 15434, 15412, 15410, 2198, 14080, 14084, 14270, 14271, 14272, 14273, 14274, 14275, 14276, 14282, 14292, 14367);

There were an occurrence that the file was there, but it was a .docx file and the update was trying to get a .txt file, so with this update the error message disappear:

UPDATE submission_files SET original_file_name = '3228-##_Resultados de pesquisa-16481-1-4-20170215.docx' WHERE file_id = 18743;

the original_file_name does not have .docx in the end (I just dont undestand why it just don’t get the extencion from file_type collum on submission_files)

=====================================================================================

For the errors on [code: Installer Installer::moveReviewerFiles] first I’ve to edit config.inc.php and enable the debug option on database and the stacktrace option. With that everytime that a error was found the upgrade stop, so i’ve changed the class from pkp-lib and removed the fatal_error and print the submission id on table.

With that I’ve got all the submissions with errors, and I’ve searched on UI and it appers it was “deleted” in some point, so i’ve removed all references that I’ve found from them and the errors messages desapear after that:

DELETE FROM authors WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM edit_decisions WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM metrics WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM published_submissions WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM review_assignments WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM review_round_files WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM review_rounds WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM stage_assignments WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM submission_comments WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM submission_files WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM submission_galleys WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM submissions WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM submission_settings WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);
DELETE FROM submission_search_objects WHERE submission_id IN (297,415,443,454,485,514,546,617,620,618,617,620,620,1401,1374,2039,2617,775,921,1759);

=====================================================================================

There was another error that I don’t remember where it come from but produced this message:

[homolog] < ERROR: Reviewer files with ID 1470 from review assignment 264 could not be found in the database table submission_files
[homolog] < ERROR: Reviewer files with ID 11424 from review assignment 1462 could not be found in the database table submission_files

And solved by removing this references:

DELETE FROM review_assignments WHERE review_id IN (264,1462);

Hope it can help someone.

Regards,
Rafael Mansilha.

Hi @rafaelmansilha,

Phew! Glad to hear the upgrade worked, and thanks for documenting the steps you needed to take.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

@rafaelmansilha Thanks for the detailed reply. I am going to try this now.