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

Please help

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

Upgrade.inc.php

1050 $journal = $journalDao->getById($row[‘context_id’]);
1051 $managerUserGroup = $userGroupDao->getDefaultByRoleId($journal->getId(), ROLE_ID_MANAGER);
1052 $managerUsers = $userGroupDao->getUsersById($managerUserGroup->getId(), $journal->getId());
1053 $managerUser = $managerUsers->next();

I have tried bellow but no result:

ojs error

Hi @shantanusingh,

Can you indicate what specific version of OJS that you’re trying to upgrade to (e.g. 3.2.1). And, could you elaborate, perhaps on how far along you’ve gotten in the upgrade process?

Thanks,

Roger
PKP Team

Thank you for your reply, I am trying to upgrade from ojs-2.4.8-5 to ojs-3.2.1-4 (DB size is 4GB).

I can not clearly define you the stage to which I have reached till now in the upgradation process. Instead I may inform you about the error that occurred before this error and the error was as follows:

Fatal error: Uncaught Exception: DB Error: Data too long for column ‘contents’ at row 1 Query: INSERT INTO notes (user_id, date_created, date_modified, title, contents, assoc_type, assoc_id) VALUES (?, ‘2021-02-10 18:36:25’, ‘2021-09-23 09:22:26’, ?, ?, ?, ?) in C:\wamp64\www\ojs248\lib\pkp\classes\db\DAO.inc.php:703
Stack trace:
#0 C:\wamp64\www\ojs248\lib\pkp\classes\db\DAO.inc.php(231): DAO->handleError(Object(ADODB_mysqli), ‘INSERT INTO not…’)
#1 C:\wamp64\www\ojs248\lib\pkp\classes\note\NoteDAO.inc.php(204): DAO->update(‘INSERT INTO not…’, Array)
#2 C:\wamp64\www\ojs248\classes\install\Upgrade.inc.php(1702): NoteDAO->insertObject(Object(Note))
#3 C:\wamp64\www\ojs248\lib\pkp\classes\install\Installer.inc.php(417): Upgrade->convertEditorDecisionNotes(Object(Upgrade), Array)
#4 C:\wamp64\www\ojs248\lib\pkp\classes\install\Installer.inc.php(263): Installer->executeAction(Array)
#5 C:\wamp64\www\ojs248\lib\pkp\classes\install\Installer.inc.php(186): Installer->executeInstaller()
#6 C:\wamp64\www\ojs248\li in C:\wamp64\www\ojs248\lib\pkp\classes\db\DAO.inc.php on line 703

After the correction, the system went under upgradation process continuasly for last 4 days, after which I found the error about which I have mentioned in the forum. I am not sure, but I think that the stage at which this error occurred, may be some what arround the article_suplimentry_file table and submission table.

1045 $suppFilesResult = $submissionFileDao->retrieve(‘SELECT a.context_id, sf.* FROM article_supplementary_files sf, submissions a WHERE a.submission_id = sf.article_id’); // COMMENT_TYPE_EDITOR_DECISION
1046 while (!$suppFilesResult->EOF) {
1047 $row = $suppFilesResult->getRowAssoc(false);
1048 $suppFilesResult->MoveNext();
1049 if (!$journal || $journal->getId() != $row[‘context_id’]) {
1050 $journal = $journalDao->getById($row[‘context_id’]);
1051 $managerUserGroup = $userGroupDao->getDefaultByRoleId($journal->getId(), ROLE_ID_MANAGER);
1052 $managerUsers = $userGroupDao->getUsersById($managerUserGroup->getId(), $journal->getId());
1053 $managerUser = $managerUsers->next();
1054 if (!$managerUser) fatalError(‘Journal ID ’ . $journal->getId() . ’ does not have any enrolled managers!’);
1055 $creatorUserId = $managerUser->getId();
1056 }
1057 $article = $submissionDao->getById($row[‘article_id’]);
1058 if (!$article) {
1059 error_log('WARNING: Unable to fetch article for article_supplementary_files.supp_id = ’ . $row[‘supp_id’] . ‘. Skipping.’);
1060 continue;
1061 }

Thank you advance for your support.