Hi @asmecher and @rcgillis,
I am trying to upgrade the OJS platform from version 3.3.0.13 to OJS 3.4.0.8. When I run the php tools/upgrade.php upgrade command, it shows me the following:
PHP Warning: require_once(/plugins/paymethod/paypal/vendor/autoload.php): Failed to open stream: No such file or directory in /plugins/paymethod/paypal/PaypalPaymentPlugin.php on line 30
PHP Fatal error: Uncaught Error: Failed opening required '/plugins/paymethod/paypal/vendor/autoload.php' (include_path='.:/usr/share/php') in /plugins/paymethod/paypal/PaypalPaymentPlugin.php:30
Stack trace:
#0 /lib/pkp/lib/vendor/composer/ClassLoader.php(576): include()
#1 /lib/pkp/lib/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#2 /plugins/paymethod/paypal/index.php(13): Composer\Autoload\ClassLoader->loadClass()
#3 /lib/pkp/classes/plugins/PluginRegistry.php(259): include('...')
#4 /lib/pkp/classes/plugins/PluginRegistry.php(193): PKP\plugins\PluginRegistry::_deprecatedInstantiatePlugin()
#5 /lib/pkp/classes/plugins/PluginRegistry.php(241): PKP\plugins\PluginRegistry::_instantiatePlugin()
#6 /lib/pkp/classes/plugins/PluginRegistry.php(113): PKP\plugins\PluginRegistry::_loadFromDisk()
#7 /lib/pkp/classes/plugins/PluginRegistry.php(177): PKP\plugins\PluginRegistry::loadCategory()
#8 [internal function]: PKP\plugins\PluginRegistry::PKP\plugins\{closure}()
#9 /lib/pkp/classes/plugins/PluginRegistry.php(177): array_reduce()
#10 /lib/pkp/classes/install/Installer.php(126): PKP\plugins\PluginRegistry::loadAllPlugins()
#11 /classes/install/Upgrade.php(56): PKP\install\Installer->__construct()
#12 /lib/pkp/classes/cliTool/UpgradeTool.php(93): APP\install\Upgrade->__construct()
#13 /lib/pkp/classes/cliTool/UpgradeTool.php(69): PKP\cliTool\UpgradeTool->upgrade()
#14 /tools/upgrade.php(22): PKP\cliTool\UpgradeTool->execute()
#15 {main}
thrown in /plugins/paymethod/paypal/PaypalPaymentPlugin.php on line 30
I downloaded the official version 3.4.0.8 of the platform.
And when I check it (php tools/upgrade.php check), it shows me that everything is fine:
Code version: 3.4.0.8
Database version: 3.3.0.13
Latest version: 3.4.0.8
Database version is older than code version
Run "tools/upgrade.php upgrade" to update
@asmecher and @rcgillis,
I was able to update and I see that this update to version 3.4.0.8 removes many orphaned entries from the database, then after a while it fails and shows me the following error:
2025-03-11 23:13:53 [migration: PKP\migration\upgrade\v3_4_0\I8060_UpdateUserLocalesDefaultToEmptyArrayFromNull]
2025-03-11 23:15:23 [migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]
2025-03-12 03:15:39 [migration: APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor]
2025-03-12 03:16:21 [migration: APP\migration\upgrade\v3_4_0\I6091_AddFilterNamespaces]
2025-03-12 03:16:24 [migration: APP\migration\upgrade\v3_4_0\I3573_AddPrimaryKeys]
2025-03-12 13:45:00 [migration: APP\migration\upgrade\v3_4_0\I6093_AddForeignKeys]
2025-03-12 13:45:05 [revert migration: APP\migration\upgrade\v3_4_0\I3573_AddPrimaryKeys]
2025-03-13 11:59:19 [revert migration: APP\migration\upgrade\v3_4_0\I6091_AddFilterNamespaces]
2025-03-13 11:59:25 [revert migration: APP\migration\upgrade\v3_4_0\I7129_IssueEntityDAORefactor]
2025-03-13 11:59:44 [revert migration: PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString]
2025-03-13 11:59:44 [downgrade for "PKP\migration\upgrade\v3_4_0\I7245_UpdateUserLocaleStringToParsableJsonString" unsupported: Downgrade not supported]
ERROR: Upgrade failed: DB: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect date value: '0000-00-00' for column 'date_expire' at row 62 (SQL: alter tas_type_id_foreign` foreign key (`type_id`) references `announcement_types` (`type_id`) on delete set null)
How can I fix it to perform the update tests again?
Hi @diegomejia07,
I suspect you already have some bad data in your database, and touching the table row is causing MySQL to complain about it. Take a look at the announcements
table and check that date_expire
contains valid dates, or null
for announcements that do not have an expiry. It seems like you have at least one date there that is set to 0000-00-00
, which MySQL considers invalid.
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @asmecher,
I have a question, should I check the error and fix it and restore the database again and update, or can I fix the error and run the update command again?
Hi @diegomejia07,
If the upgrade fails, unless the script tells you otherwise, you should restore from backup before trying again.
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @diegomejia07,
Do you mean another error message during upgrade? If you’re looking for guidance, can you post the full error message?
Regards,
Alec Smecher
Public Knowledge Project Team
@asmecher
I am trying to upgrade the OJS platform from version 3.3.0.13 to OJS 3.4.0.8. When I run the php tools/upgrade.php upgrade command, it shows me the following:
PHP Warning: require_once(/plugins/paymethod/paypal/vendor/autoload.php): Failed to open stream: No such file or directory in /plugins/paymethod/paypal/PaypalPaymentPlugin.php on line 30
PHP Fatal error: Uncaught Error: Failed opening required '/plugins/paymethod/paypal/vendor/autoload.php' (include_path='.:/usr/share/php') in /plugins/paymethod/paypal/PaypalPaymentPlugin.php:30
Stack trace:
#0 /lib/pkp/lib/vendor/composer/ClassLoader.php(576): include()
#1 /lib/pkp/lib/vendor/composer/ClassLoader.php(427): Composer\Autoload\{closure}()
#2 /plugins/paymethod/paypal/index.php(13): Composer\Autoload\ClassLoader->loadClass()
#3 /lib/pkp/classes/plugins/PluginRegistry.php(259): include('...')
#4 /lib/pkp/classes/plugins/PluginRegistry.php(193): PKP\plugins\PluginRegistry::_deprecatedInstantiatePlugin()
#5 /lib/pkp/classes/plugins/PluginRegistry.php(241): PKP\plugins\PluginRegistry::_instantiatePlugin()
#6 /lib/pkp/classes/plugins/PluginRegistry.php(113): PKP\plugins\PluginRegistry::_loadFromDisk()
#7 /lib/pkp/classes/plugins/PluginRegistry.php(177): PKP\plugins\PluginRegistry::loadCategory()
#8 [internal function]: PKP\plugins\PluginRegistry::PKP\plugins\{closure}()
#9 /lib/pkp/classes/plugins/PluginRegistry.php(177): array_reduce()
#10 /lib/pkp/classes/install/Installer.php(126): PKP\plugins\PluginRegistry::loadAllPlugins()
#11 /classes/install/Upgrade.php(56): PKP\install\Installer->__construct()
#12 /lib/pkp/classes/cliTool/UpgradeTool.php(93): APP\install\Upgrade->__construct()
#13 /lib/pkp/classes/cliTool/UpgradeTool.php(69): PKP\cliTool\UpgradeTool->upgrade()
#14 /tools/upgrade.php(22): PKP\cliTool\UpgradeTool->execute()
#15 {main}
thrown in /plugins/paymethod/paypal/PaypalPaymentPlugin.php on line 30
Hi @diegomejia07,
It looks like you’re missing some files from the OJS 3.4.0-8 .tar.gz
download. That file should be present in the package.
Regards,
Alec Smecher
Public Knowledge Project Team