Upgrade to OJS 3.0 from 2.4.8.0 - Error while converting supplementary files

@Tarcisio_Pereira, great!
@atarix, what exactly errors do you get?

That error.

I have already checked that every journal has more than one Journal Manager and deleted all article_supplementary_files with no real article_files, but still get the error.

@atarix

Do you also use PostgreSQL? Could you try with the change above – to add " order by user_group_id" to function UserGropuDAO::getByRoleId?

Thanks!
Bozana

1 Like

Yes I use postgres and I can try your changes.
I’ll post the result as soon as possible.

Thanks
Giuseppe

1 Like

Hi @atarix

I have made this:
ojs3/lib/pkp/classes/security/UserGroupDAO.inc.php

241 function getByRoleId($contextId, $roleId, $default = false, $dbResultRange = null) {
242 $params = array((int) $contextId, (int) $roleId);
243 if ($default) $params[] = 1; // true
244 $result = $this->retrieveRange(
245 ‘SELECT *
246 FROM user_groups
247 WHERE context_id = ? AND
248 role_id = ?
249 ’ . ($default?’ AND is_default = ?’:’’)
250 .’ ORDER BY user_group_id’,
251 $params,
252 $dbResultRange
253 );
254
255 return new DAOResultFactory($result, $this, ‘_returnFromRow’);
256 }

Regards,
Tarcisio Pereira.

@Tarcisio_Pereira thanks

@bozana I’ve applied changes and now the upgrade script finish Successfully, anyway It doesn’t seem to be all right.

I get several Warning message during script execution, like these:

PHP Warning:  Invalid argument supplied for foreach() in /path-to-ojs/classes/install/Upgrade.inc.php on line 1983
PHP Warning:  Cannot use a scalar value as an array in /path-to-ojs/lib/pkp/classes/core/DataObject.inc.php on line 133
PHP Warning:  Cannot use a scalar value as an array in /path-to-ojs/lib/pkp/classes/db/SettingsDAO.inc.php on line 41
PHP Warning:  Invalid argument supplied for foreach() in /path-to-ojs/classes/install/Upgrade.inc.php on line 2141

But the critical ones are these :

    PHP Warning:  rename(/path-to-ojs-files/journals/11//articles/2454//submission/original/2454-9209-1-SM.pdf,/path-to-ojs-files/journals/11//articles/2454//submission/2454-1-9209-1-2-20121019.pdf): Permission denied in /path-to-ojs/classes/install/Upgrade.inc.php on line 911
    Unable to move "/path-to-ojs-files/journals/11//articles/2454//submission/original/2454-9209-1-SM.pdf" to "/path-to-ojs-files/journals/11//articles/2454//submission/2454-1-9209-1-2-20121019.pdf".
    PHP Warning:  rename(/path-to-ojs-files/journals/11//articles/2454//submission/review/2454-9210-1-RV.pdf,/path-to-ojs-files/journals/11//articles/2454//submission/review/2454-1-9210-1-4-20121019.pdf): Permission denied in /path-to-ojs/classes/install/Upgrade.inc.php on line 911
    Unable to move "/path-to-ojs-files/journals/11//articles/2454//submission/review/2454-9210-1-RV.pdf" to "/path-to-ojs-files/test-ojs3-unimi/journals/11//articles/2454//submission/review/2454-1-9210-1-4-20121019.pdf".
    PHP Warning:  rename(/path-to-ojs-files/journals/11//articles/2454//submission/copyedit/2454-9211-1-CE.pdf,/path-to-ojs-files/journals/11//articles/2454//submission/copyedit/2454-1-9211-1-9-20121019.pdf): Permission denied in /path-to-ojs/classes/install/Upgrade.inc.php on line 911
    Unable to move "/path-to-ojs-files/journals/11//articles/2454//submission/copyedit/2454-9211-1-CE.pdf" to "/path-to-ojs-files/journals/11//articles/2454//submission/copyedit/2454-1-9211-1-9-20121019.pdf".
    PHP Warning:  mkdir(): Permission denied in /path-to-ojs/lib/pkp/classes/file/FileManager.inc.php on line 307
    Unable to make directory "/path-to-ojs-files/journals/11//articles/2454//submission/proof"
    PHP Warning:  rename(/path-to-ojs-files/journals/11//articles/2454//public/2454-9212-1-PB.pdf,/path-to-ojs-files/journals/11//articles/2454//submission/proof/2454-1-9212-1-10-20121019.pdf): No such file or directory in /path-to-ojs/classes/install/Upgrade.inc.php on line 911
    Unable to move "path-to-ojs-files/journals/11//articles/2454//public/2454-9212-1-PB.pdf" to "/path-to-ojs-files/journals/11//articles/2454//submission/proof/2454-1-9212-1-10-20121019.pdf".

It seems that there are too slashes in the file path.

Final result is that new installation doesn’t work properly, indeed when I try to view article page I get a white page.

Any suggestions?

Thanks
Giuseppe

Hi @atarix

The second messages mean that your files in the files folder could not be migrated to the right position – it seems that the access permissions are not right. Could you double check the permissions on your files folder – maybe allow everything for the moment you are upgrading – and try again, but do not forget to use your back-up i.e. original files folder (and not the one after an upgrade trial!).
For the first message: How does the code line 1983 and/or 2141 (the messages are pointing to) looks like in your installation? – I do not see that number here: ojs/Upgrade.inc.php at ojs-3_0_2-0 · pkp/ojs · GitHub :open_mouth:

Thanks!
Bozana

1 Like

Hi @bozana

Yes I’ll try again

This is the code :

		1982 $aboutJournal = array();
		1983 foreach ($supportedFormLocales as $locale) {
		1984	AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_GRID, $locale);
		1985	$aboutJournal[$locale] = '';

		2140 $masthead = array();
		2141 foreach ($supportedFormLocales as $locale) {
		2142	AppLocale::requireComponents(LOCALE_COMPONENT_APP_COMMON, LOCALE_COMPONENT_PKP_USER, $locale);
		2143	$masthead[$locale] = '';

Many thanks!!

1 Like

Hi @atarix

Hmmmm… For some reason the $supportedFormLocales seem not to be an array :open_mouth: Could you take a look in your DB table journal_settings, where setting_name = ‘supportedFormLocales’? Is setting_value an array for all journals there?

Thanks!
Bozana

1 Like

I’ve tried to give all permissions during upgrade process and now files have been migrated successfully.

I’ve checked and I have 4 journals where supportedFormLocales is not setted, so i think I just need to correct this setting to solve the problem.

Thank you very much for support!!! :slight_smile:

1 Like

Could I delete all these entries in article_supplementary_files with no real article_files in my database too?
Are not they needed?

@Adriano_Jose, it would be best if you could double check if they are needed and repair them correctly, i.e. either upload the correct files again or delete them using the web user interface – in order for all dependencies to be managed correctly.
How many files are missing?
S. the function that deletes supp files in OJS 2.4.8-2: ojs/LayoutEditorAction.inc.php at ojs-2_4_8-2 · pkp/ojs · GitHub. I.e. you would need to consider at least also the DB tables article_files and article_supp_file_settings. Also the search index should then be rebuild.

Best,
Bozana

Thanks @bozana, I will try before delete these records.

HI, I have the same error:
I am using mysql and I tried to upgrade ojs-2_4_8 to ojs-3_1_1-4
I checked permission files.

SELECT * FROM submission_settings WHERE submission_id = '321704' 
   
-----<hr>
PHP Warning:  assert(): Assertion failed in ojs/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 112

Warning: assert(): Assertion failed in ojs/lib/pkp/classes/submission/SubmissionFileDAODelegate.inc.php on line 112
PHP Warning:  copy(/files/journals/384//articles/321704/submission/review/321704-3004--1-4-20180406.doc): failed to open stream: No such file or directory in ojs/lib/pkp/classes/file/FileManager.inc.php on line 159

Warning: copy(/files/journals/384//articles/321704/submission/review/321704-3004--1-4-20180406.doc): failed to open stream: No such file or directory in ojs/lib/pkp/classes/file/FileManager.inc.php on line 159
-----<hr>
(mysql): DELETE FROM submission_files
			 WHERE file_id = 486631 AND revision = 1 
   
-----<hr>
-----<hr>
(mysql): SELECT * FROM submission_files WHERE file_id = 486631 
   
-----<hr>
-----<hr>
(mysql): DELETE FROM submission_file_settings WHERE file_id = 486631 
   
-----<hr>
-----<hr>
(mysql): DELETE FROM item_views WHERE assoc_type = 515 AND assoc_id = '486631-1' 
   
-----<hr>
-----<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 = 321704
				 
   
-----<hr>
-----<hr>
(mysql): SELECT * FROM submission_settings WHERE submission_id = '321704' 
   
-----<hr>
PHP Fatal error:  Call to a member function getFileId() on null in ojs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 1065

Fatal error: Call to a member function getFileId() on null in ojs/lib/pkp/classes/submission/PKPSubmissionFileDAO.inc.php on line 1065

I checked my log file:
grep “code: Installer Installer” /ojs/nohup.out

[code: Installer Installer::checkPhpVersion]
[code: Installer Installer::syncSeriesAssocType]
[code: Installer Installer::removeReviewEntries]
[code: Installer Installer::installDefaultNavigationMenus]
[code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
[code: Installer Installer::migrateSRLocale]
[code: Installer Installer::migrateNOLocale]
[code: Installer Installer::concatenateIntoAbout]
[code: Installer Installer::concatenateIntoMasthead]
[code: Installer Installer::migrateCounterPluginUsageStatistics (skipped)]
[code: Installer Installer::migrateTimedViewsUsageStatistics (skipped)]
[code: Installer Installer::migrateDefaultUsageStatistics (skipped)]
[code: Installer Installer::installDefaultGenres]
[code: Installer Installer::migrateArticleMetadata]
[code: Installer Installer::clearDataCache]
[code: Installer Installer::migrateUserRoles]
[code: Installer Installer::fixReviewForms]
[code: Installer Installer::htmlifyEmailTemplates]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::installEmailTemplate]
[code: Installer Installer::localizeCustomBlockSettings]
[code: Installer Installer::convertEditorDecisionNotes]
[code: Installer Installer::convertQueries]
[code: Installer Installer::migrateFiles]
[code: Installer Installer::convertSupplementaryFiles]
[code: Installer Installer::provideSupplementaryFilesForReview]

I don’t know why failed my upgrade.
Any help ??

Hi @xavi

Sorry for the late response – I was sick for a long time and first now back again…

Did you manage to fix the problem?
If not: lets start from beginning again: what error message do you exactly get during the upgrade?
Note: do not forget to restore the clean backup of your 2.4.x installation before trying an upgrade/each time you try/do the upgrade…

Best,
Bozana

Hi @bozana,don’t worries.
I am trying to upgrade from 2.4.8 to 3.1.0 and I have less errors.
The next week I will be send you the new errors with review_round.

Regards !!!

Hi @bozana,
I am using this branch “ojs-stable-3_1_0” to migration from 2.4.8.

I checked error log:

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 = 320427
				 
   
-----<hr>
-----<hr>
(mysql): SELECT * FROM submission_settings WHERE submission_id = '320427' 
   
-----<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

I checked:

  • The file exists.(Original and attachment).
  • On article review, Recommendation date later than due date for at least one reviewer.
    Could be any issue in upgrading process ?

Regards,
xavi.

I found a new conversation about my new problem with upgrading process:
DB: ERROR: null value in column “review_round_id”

Thanks.
xavi.

@xavi, is there a particular reason why you don’t use ojs-stable-3_1_1?

Hi @bozana, I am working in branch 3.1.0 because I had problems with the stable 3.1.1
I will check in database this queries, (thanks a lot !!!)
I referenced in this discussion:

I am not sure if it is a problem with branch. Currently I am working with this branch in upgrade process and I am implementing a new features in parallel in other host with fresh install in this branch.

Regards,
xavi.

1 Like