Upgrading from OJS 2.4 to 3.2: Uncaught Error: Call to a member function getId()

Hello everyone,

I am upgrading from OJS 2.4 to the latest version OJS 3.2.0-3.
When I click on upgrade, it works (upgrading icon circulates) for about one minute, then I get a blank page with the 500 error.

Checking the error logs, I have these warnings/errors:

[18-Jun-2020 06:33:07 UTC] WARNING: Unable to find a match for “146-392-1-RV.docx” in “/home/journal1/private/files/journals/1//articles/146/”. Skipping this file.
[18-Jun-2020 06:33:07 UTC] WARNING: Unable to find a match for “154-460-1-RV.docx” in “/home/journal1/private/files/journals/1//articles/154/”. Skipping this file.
[18-Jun-2020 06:33:07 UTC] WARNING: Unable to find a match for “222-594-1-RV.pdf” in “/home/journal1/private/files/journals/1//articles/222/”. Skipping this file.
[18-Jun-2020 06:33:07 UTC] WARNING: Unable to find a match for “232-635-1-RV.docx” in “/home/journal1/private/files/journals/1//articles/232/”. Skipping this file.

//Many other warnings like these

[18-Jun-2020 06:33:32 UTC] WARNING: Unable to find a match for “306-823-1-SM.pdf” in “/home/journal1/private/files/journals/1//articles/306/”. Skipping this file.
[18-Jun-2020 06:33:32 UTC] WARNING: Unable to find a match for “306-826-1-SP.pdf” in “/home/journal1/private/files/journals/1//articles/306/”. Skipping this file.

[18-Jun-2020 06:33:32 UTC] PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /home/journal1/public_html/classes/install/Upgrade.inc.php:1053
Stack trace:
#0 /home/journal1/public_html/lib/pkp/classes/install/Installer.inc.php(417): Upgrade->convertSupplementaryFiles(Object(Upgrade), Array)
#1 /home/journal1/public_html/lib/pkp/classes/install/Installer.inc.php(263): Installer->executeAction(Array)
#2 /home/journal1/public_html/lib/pkp/classes/install/Installer.inc.php(186): Installer->executeInstaller()
#3 /home/journal1/public_html/lib/pkp/classes/install/form/UpgradeForm.inc.php(42): Installer->execute()
#4 /home/journal1/public_html/lib/pkp/pages/install/InstallHandler.inc.php(106): UpgradeForm->execute()
#5 /home/journal1/public_html/lib/pkp/classes/core/PKPRouter.inc.php(391): InstallHandler->installUpgrade(Array, Object(Request))
#6 /home/journal1/public_html/lib/pkp/classes/core/PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#7 /home/journal1/public_html in /home/journal1/public_html/classes/install/Upgrade.inc.php on line 1053

Please help, we have a new issue of this journal coming soon, I need to have it up and running as soon as possible.

Thanks in advance

Hi @Aleem,

Do you have a journal with nobody enrolled in the “Journal Manager”, “Journal Editor”, or “Production Editor” roles? I’d suggest making sure that each journal has at least one user enrolled in one of those groups.

(This error message is not very helpful and I’ve added some code to the next release to improve it.)

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you very much for your response.
Actually, I wasn’t involved with the admin of the journal website, and the person who was handling this system passed away.
I have no idea whether the there are journal managers or not, and the original web hosting (and the old ojs system) is not operational now.
I only have the backup of the website files and the database backup (.sql)
Meaning, I can’t check (via the system) if there are managers for the journal or not.
By the way, there is only one journal in my system.

Could you please show me how to check for journal manager issue in the database? and how to fix it?
Can I just use SQL queries to add the missing assignment of the journal manager?

Thanks again for your help.

Hi @Aleem,

I’m sorry to hear that!

You can check whether there are any journals without managers using the following database query (on your pre-upgrade database):

SELECT j.path, j.journal_id FROM journals j LEFT JOIN roles r ON (r.journal_id = j.journal_id AND r.role_id=16) GROUP BY j.journal_id HAVING count(r.role_id) = 0;

If any journals are listed, then they have no managers. You can correct this by choosing a user from the users table, and adding a new role with its user_id:

INSERT INTO roles (journal_id, user_id, role_id) VALUES (123, 456, 16);

…with the journal_id from the first query in place of 123, and the user_id of the person you want to designate as manager in place of 456.

Regards,
Alec Smecher
Public Knowledge Project Team

It worked. Thank you very much for your help.
The upgrade went well, except, I still receive the same warnings stated earlier, such as:

[18-Jun-2020 06:33:07 UTC] WARNING: Unable to find a match for “146-392-1-RV.docx” in “/home/journal1/private/files/journals/1//articles/146/”. Skipping this file.
[18-Jun-2020 06:33:07 UTC] WARNING: Unable to find a match for “154-460-1-RV.docx” in “/home/journal1/private/files/journals/1//articles/154/”. Skipping this file.

Besides, I received the following warnings/errors:
[20-Jun-2020 17:43:44 UTC] WARNING: Unable to find a match for “304-821-1-SM.pdf” in “/home/journal1/private/files/journals/1//articles/304/”. Skipping this file.

[20-Jun-2020 17:43:44 UTC] WARNING: Unable to find a match for "306-823-1-SM.pdf" in "/home/journal1/private/files/journals/1//articles/306/". Skipping this file.

[20-Jun-2020 17:43:44 UTC] WARNING: Unable to find a match for "306-826-1-SP.pdf" in "/home/journal1/private/files/journals/1//articles/306/". Skipping this file.

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/64/attachment/64-1-257-1-13-20180314.pdf): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/92/attachment/92-1-289-1-13-20180429.docx): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/94/attachment/94-1-294-1-13-20180430.docx): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/96/attachment/96-1-299-1-13-20180430.docx): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/187/attachment/187-1-544-1-13-20190613.pdf): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/226/attachment/226-1-600-1-13-20190620.pdf): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/256/attachment/256-1-746-1-13-20191126.pdf): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/280/attachment/280-1-791-1-13-20200607.docx): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:44 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/306/attachment/306-1-826-1-13-20200612.pdf): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:45 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/64/submission/proof/64-2-257-1-10-20180314.pdf): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:45 UTC] WARNING: Unable to copy article_suppementary_files entry with file_id 257 to review stage! Skipping this file.

[20-Jun-2020 17:43:45 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/92/submission/92-2-289-1-2-20180429.docx): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:45 UTC] WARNING: Unable to copy article_suppementary_files entry with file_id 289 to review stage! Skipping this file.

[20-Jun-2020 17:43:45 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/94/submission/94-2-294-1-2-20180430.docx): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:45 UTC] WARNING: Unable to copy article_suppementary_files entry with file_id 294 to review stage! Skipping this file.

[20-Jun-2020 17:43:45 UTC] PHP Warning: copy(/home/journal1/private/files/journals/1//articles/96/submission/proof/96-2-299-1-10-20180430.docx): failed to open stream: No such file or directory in /home/journal1/public_html/lib/pkp/classes/file/FileManager.inc.php on line 181

[20-Jun-2020 17:43:45 UTC] WARNING: Unable to copy article_suppementary_files entry with file_id 299 to review stage! Skipping this file.

[20-Jun-2020 17:43:46 UTC] PHP Warning: rename(/home/journal1/private/files/journals/1//articles/53/submission/review/53-1-194-1-4-20171207.docx,/home/journal1/private/files/journals/1//articles/53/submission/review/attachment/53-1-194-1-5-20171207.docx): No such file or directory in /home/journal1/public_html/classes/install/Upgrade.inc.php on line 2021

[20-Jun-2020 17:43:46 UTC] ERROR: Unable to move "/home/journal1/private/files/journals/1//articles/53/submission/review/53-1-194-1-4-20171207.docx" to "/home/journal1/private/files/journals/1//articles/53/submission/review/attachment/53-1-194-1-5-20171207.docx".

[20-Jun-2020 17:43:46 UTC] PHP Warning: rename(/home/journal1/private/files/journals/1//articles/72/submission/review/72-1-376-2-4-20180622.pdf,/home/journal1/private/files/journals/1//articles/72/submission/review/attachment/72-1-376-2-5-20180622.pdf): No such file or directory in /home/journal1/public_html/classes/install/Upgrade.inc.php on line 2021

[20-Jun-2020 17:43:46 UTC] ERROR: Unable to move "/home/journal1/private/files/journals/1//articles/72/submission/review/72-1-376-2-4-20180622.pdf" to "/home/journal1/private/files/journals/1//articles/72/submission/review/attachment/72-1-376-2-5-20180622.pdf".

[20-Jun-2020 17:43:46 UTC] PHP Warning: rename(/home/journal1/private/files/journals/1//articles/72/submission/review/72-1-376-1-4-20180622.pdf,/home/journal1/private/files/journals/1//articles/72/submission/review/attachment/72-1-376-1-5-20180622.pdf): No such file or directory in /home/journal1/public_html/classes/install/Upgrade.inc.php on line 2021

[20-Jun-2020 17:43:46 UTC] ERROR: Unable to move "/home/journal1/private/files/journals/1//articles/72/submission/review/72-1-376-1-4-20180622.pdf" to "/home/journal1/private/files/journals/1//articles/72/submission/review/attachment/72-1-376-1-5-20180622.pdf".

[20-Jun-2020 17:43:46 UTC] PHP Warning: rename(/home/journal1/private/files/journals/1//articles/116/submission/review/116-1-377-1-4-20180706.docx,/home/journal1/private/files/journals/1//articles/116/submission/review/attachment/116-1-377-1-5-20180706.docx): No such file or directory in /home/journal1/public_html/classes/install/Upgrade.inc.php on line 2021

[20-Jun-2020 17:43:46 UTC] ERROR: Unable to move "/home/journal1/private/files/journals/1//articles/116/submission/review/116-1-377-1-4-20180706.docx" to "/home/journal1/private/files/journals/1//articles/116/submission/review/attachment/116-1-377-1-5-20180706.docx".

[20-Jun-2020 17:43:46 UTC] PHP Warning: rename(/home/journal1/private/files/journals/1//articles/247/submission/review/247-1-763-1-4-20191207.docx,/home/journal1/private/files/journals/1//articles/247/submission/review/attachment/247-1-763-1-5-20191207.docx): No such file or directory in /home/journal1/public_html/classes/install/Upgrade.inc.php on line 2021

[20-Jun-2020 17:43:46 UTC] ERROR: Unable to move` /home/journal1/private/files/journals/1//articles/247/submission/review/247-1-763-1-4-20191207.docx" to "/home/journal1/private/files/journals/1//articles/247/submission/review/attachment/247-1-763-1-5-20191207.docx".

[20-Jun-2020 17:43:46 UTC] PHP Warning: rename(/home/journal1/private/files/journals/1//articles/250/submission/review/250-1-713-1-4-20190822.doc,/home/journal1/private/files/journals/1//articles/250/submission/review/attachment/250-1-713-1-5-20190822.doc): No such file or directory in /home/journal1/public_html/classes/install/Upgrade.inc.php on line 2021

[20-Jun-2020 17:43:46 UTC] ERROR: Unable to move "/home/journal1/private/files/journals/1//articles/250/submission/review/250-1-713-1-4-20190822.doc" to "/home/journal1/private/files/journals/1//articles/250/submission/review/attachment/250-1-713-1-5-20190822.doc".

[20-Jun-2020 17:43:46 UTC] PHP Warning: rename(/home/journal1/private/files/journals/1//articles/249/submission/review/249-1-718-1-4-20190827.docx,/home/journal1/private/files/journals/1//articles/249/submission/review/attachment/249-1-718-1-5-20190827.docx): No such file or directory in /home/journal1/public_html/classes/install/Upgrade.inc.php on line 2021

[20-Jun-2020 17:43:46 UTC] ERROR: Unable to move "/home/journal1/private/files/journals/1//articles/249/submission/review/249-1-718-1-4-20190827.docx" to "/home/journal1/private/files/journals/1//articles/249/submission/review/attachment/249-1-718-1-5-20190827.docx".

I have searched for every single file, and they all exist in the corresponding exact folders (inside sub-folders such as submission, original, copyedit, etc).

I copied each group of files that belong to a specific article from sub-folders into the main folder of the article,… I got the same warnings.
I changed the permissions of all files and folders to 777 and repeated the upgrade (with a fresh database and OJS files), but to no avail.

What can I do to ensure that all these files can be migrated smoothly with the upgrade to 3.2?
Will it be OK to proceed with the current upgrade (with these warnings), run the OJS system, and re-attach every one of these files to their corresponding articles via the OJS system?

Thanks again for your help.

Same problem, please help. upgradation from ojs-2.4.8-5 to ojs-3.2.1-4.

PHP Fatal error: Uncaught Error: Call to a member function getId() on null in C:\wamp64\www\ojs248\classes\install\Upgrade.inc.php:1051
Stack trace:
#0 C:\wamp64\www\ojs248\lib\pkp\classes\install\Installer.inc.php(417): Upgrade->convertSupplementaryFiles(Object(Upgrade), Array)
#1 C:\wamp64\www\ojs248\lib\pkp\classes\install\Installer.inc.php(263): Installer->executeAction(Array)
#2 C:\wamp64\www\ojs248\lib\pkp\classes\install\Installer.inc.php(186): Installer->executeInstaller()
#3 C:\wamp64\www\ojs248\lib\pkp\classes\install\form\UpgradeForm.inc.php(42): Installer->execute()
#4 C:\wamp64\www\ojs248\lib\pkp\pages\install\InstallHandler.inc.php(106): UpgradeForm->execute()
#5 C:\wamp64\www\ojs248\lib\pkp\classes\core\PKPRouter.inc.php(391): InstallHandler->installUpgrade(Array, Object(Request))
#6 C:\wamp64\www\ojs248\lib\pkp\classes\core\PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#7 C:\wamp64\www\ojs248\lib\pkp\classes\core\Dispatcher.inc.php(143): PKPPage in C:\wamp64\www\ojs248\classes\install\Upgrade.inc.php on line 1051

above mention sql command showing 0 result
ojs error