OJS migrate from 2.4.8-5 to any verson on 3.x.x returning error PHP Fatal error: Uncaught Error: Call to a member function getFileId() on null in

Application Version - 2.4.8-5 to OJS 3.1.2-4

I’m trying to upgrade from 2.4.8-5 to OJS 3.x I already tried all the released versions, nowadays I’m trying to upgrade to last stable, and its always returning the same error:

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: chmod(): Operation not permitted in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/file/FileManager.inc.php on line 518

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: Illegal string offset ‘pt_BR’ in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/core/DataObject.inc.php on line 133

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: Cannot assign an empty string to a string offset in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/core/DataObject.inc.php on line 133

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: Illegal string offset ‘pt_BR’ in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/core/DataObject.inc.php on line 133

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: Cannot assign an empty string to a string offset in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/core/DataObject.inc.php on line 133

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: Illegal string offset ‘pt_BR’ in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/core/DataObject.inc.php on line 133

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: Cannot assign an empty string to a string offset in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/core/DataObject.inc.php on line 133

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: Illegal string offset ‘pt_BR’ in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/core/DataObject.inc.php on line 133

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: Cannot assign an empty string to a string offset in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/core/DataObject.inc.php on line 133

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: chmod(): Operation not permitted in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/file/FileManager.inc.php on line 518

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to a member function getFileId() on null in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/file/SubmissionFileManager.inc.php:193

Stack trace:

#0 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/classes/install/Upgrade.inc.php(1477): SubmissionFileManager->copyFileToFileStage(‘15’, 1, 4, NULL, true)

#1 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/install/Installer.inc.php(421): Upgrade->provideSupplementaryFilesForReview(Object(Upgrade), Array)

#2 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/install/Installer.inc.php(265): Installer->executeAction(Array)

#3 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()

#4 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/install/form/UpgradeForm.inc.php(40): Installer->execute()

#5 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/p in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/file/SubmissionFileManager.inc.php on line 193

I don’t know what to do anymore. Does anyone have an idea what could be causing it?
And how can I solve this question?

I tried again whit debug = on returned:

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): select count(*) from submission_file_settings where file_id=‘19093’ and locale=‘pt_BR’ and setting_name=‘name’

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): INSERT INTO submission_file_settings (file_id,locale,setting_name,setting_type,setting_value) VALUES (‘19093’,‘pt_BR’,‘name’,‘string’,‘Outros, Instrumento de avaliação - RGO.doc’)

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): DELETE FROM submission_file_settings WHERE file_id = 19093 AND setting_name IN ( ‘creator’ ,‘subject’ ,‘description’ ,‘publisher’ ,‘sponsor’ ,‘source’ ,‘pub-id::publisher-id’ ,‘chapterId’ ,‘dateCreated’ ,‘language’ )

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): SELECT s., ps., s.submission_id AS submission_id,
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 = ‘pt_BR’)
LEFT JOIN section_settings stl ON (se.section_id = stl.section_id AND stl.setting_name = ‘title’ AND stl.locale = ‘pt_BR’)
LEFT JOIN section_settings sapl ON (se.section_id = sapl.section_id AND sapl.setting_name = ‘abbrev’ AND sapl.locale = ‘pt_BR’)
LEFT JOIN section_settings sal ON (se.section_id = sal.section_id AND sal.setting_name = ‘abbrev’ AND sal.locale = ‘pt_BR’)
WHERE s.submission_id = 4

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): SELECT * FROM submission_settings WHERE submission_id = ‘4’

[05-Feb-2020 13:26:51 Europe/Berlin] PHP Warning: chmod(): Operation not permitted in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/file/FileManager.inc.php on line 518
[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): DELETE FROM submission_files
WHERE file_id = 19093 AND revision = 1

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): SELECT * FROM submission_files WHERE file_id = 19093

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): DELETE FROM submission_file_settings WHERE file_id = 19093

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): DELETE FROM item_views WHERE assoc_type = 515 AND assoc_id = ‘19093-1’

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): SELECT s., ps., s.submission_id AS submission_id,
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 = ‘pt_BR’)
LEFT JOIN section_settings stl ON (se.section_id = stl.section_id AND stl.setting_name = ‘title’ AND stl.locale = ‘pt_BR’)
LEFT JOIN section_settings sapl ON (se.section_id = sapl.section_id AND sapl.setting_name = ‘abbrev’ AND sapl.locale = ‘pt_BR’)
LEFT JOIN section_settings sal ON (se.section_id = sal.section_id AND sal.setting_name = ‘abbrev’ AND sal.locale = ‘pt_BR’)
WHERE s.submission_id = 4

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): SELECT * FROM submission_settings WHERE submission_id = ‘4’

[05-Feb-2020 13:26:51 Europe/Berlin] PKP-Database-Logger 1580903599,4806:
(mysqli): DELETE FROM submission_supplementary_files
WHERE file_id = 19093 AND revision = 1

[05-Feb-2020 13:26:51 Europe/Berlin] PHP Fatal error: Uncaught Error: Call to a member function getFileId() on null in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/file/SubmissionFileManager.inc.php:193
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/classes/install/Upgrade.inc.php(1477): SubmissionFileManager->copyFileToFileStage(‘16’, 1, 4, NULL, true)
#1 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/install/Installer.inc.php(421): Upgrade->provideSupplementaryFilesForReview(Object(Upgrade), Array)
#2 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/install/Installer.inc.php(265): Installer->executeAction(Array)
#3 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#4 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/install/form/UpgradeForm.inc.php(40): Installer->execute()
#5 /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/p in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/file/SubmissionFileManager.inc.php on line 193

Hi @andrelzgava,

I see at least one case where file permissions are a problem:

[04-Feb-2020 20:39:56 Europe/Berlin] PHP Warning: chmod(): Operation not permitted in /Applications/XAMPP/xamppfiles/htdocs/revistas/public_html/lib/pkp/classes/file/FileManager.inc.php on line 518

File permission issues are known to cause this error, so I’d suggest starting by 1) restoring your database and files directory to their state before the upgrade was attempted, 2) correcting the file permissions so that PHP can fully administer all the contents of your files_dir, and 3) trying the upgrade script again.

Regards,
Alec Smecher
Public Knowledge Project Team