Error upgrade OJS to 3.4

Hello everybody!

When upgrading OJS from 3.3.0.14 to 3.4.0.0 I get an error:

/opt/php80/bin/php tools/upgrade.php check
PHP Fatal error: Uncaught Exception: Mailer driver isn’t specified in the application’s config in /var/www/user/data/www/ojs/lib/pkp/classes/core/PKPContainer.php:315
Stack trace:
#0 /var/www/user/data/www/ojs/lib/pkp/classes/core/PKPContainer.php(268): PKP\core\PKPContainer::getDefaultMailer()
#1 /var/www/user/data/www/ojs/lib/pkp/classes/core/PKPContainer.php(117): PKP\core\PKPContainer->loadConfiguration()
#2 /var/www/user/data/www/ojs/lib/pkp/classes/core/PKPApplication.php(231): PKP\core\PKPContainer->registerConfiguredProviders()
#3 /var/www/user/data/www/ojs/lib/pkp/classes/core/PKPApplication.php(203): PKP\core\PKPApplication->initializeLaravelContainer()
#4 /var/www/user/data/www/ojs/classes/core/Application.php(50): PKP\core\PKPApplication->__construct()
#5 /var/www/user/data/www/ojs/lib/pkp/includes/bootstrap.php(37): APP\core\Application->__construct()
#6 /var/www/user/data/www/ojs/lib/pkp/classes/cliTool/CommandLineTool.php(41): require_once(‘/var/www/user…’)
#7 /var/www/user/data/www/ojs/tools/bootstrap.php(17): require(‘/var/www/user…’)
#8 /var/www/user/data/www/ojs/tools/upgrade.php(19): require(‘/var/www/user…’)
#9 {main}
thrown in /var/www/user/data/www/ojs/lib/pkp/classes/core/PKPContainer.php on line 315

I ask for help, as I have not found an answer)

I solved this problem. Added the following lines to the email section:

default = sendmail
sendmail_path = “/usr/sbin/sendmail -bs”

But now I got a new problem:

2023-06-14 16:43:01 [A pre-flight check failed. The software was successfully upgraded to 3.3.9.9 but could not be upgraded further (to 3.4.0.0). Check and correct the error, then try again.]
ERROR: Upgrade failed: DB: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘at.assoc_type’ in ‘where clause’ (SQL: select distinct at.type_id from announcement_types as at left join journals as c on at.assoc_id = c.journal_id where c.journal_id is null or at.assoc_type <> 256)

1 Like

I think your installation was damaged by the first try.
You need to rollback to 3.3.0-14 and try to install again changing the email section in your config before you upgrade.

If you confirm you are able to upgrade this second time, the error you found looks like something that could be added to the pre-fight checks to protect users from a partial upgrade.

Thank you. I figured it out. Configuration file conf.TEMPLATE.inc.php the new version should be used as the main one. Also in conf.TEMPLATE.inc.php changed the database type from mysqli to mysql.
In version 3.4.0.1, mail settings were added to the e-mail section, which were not present in version 3.4.0.0.

1 Like

Hi @Dimidrol, happy to see you finally made it.

To carify for others… did the upgrade with the wrong config break your DB?
If yes, does it mans you (1) recovered your installation from your backup, (2) fix the config and (3) run the upgrade again… and this second time all goes well?

Thanks for your time,
m.

Hi. Yes, an incorrect configuration destroyed the database. I rolled back to the previous version and restored the database from the backup.
By default, the mysqli database driver is in the configuration file. I fixed it on mysql and successfully upgraded.
The site is working correctly, but now I get this error in the log:
[Error] The usage_events_20230622.log file has an old event log file format that cannot be processed and therefore will be moved back to the working directory.

1 Like

Hi @Dimidrol and @marc
I hope you are doing fine! I have the same exact error when I tried to upgrade OJS from 3.3.0-15 to 3.4.0-1. I’m just confused about the reason behind changing the database driver from sqli to sql. SQLI should work fine. Is there anything should be changing in the server side to avoid this error and keep using SQLI? hope @asmecher can clarify this issue for us.
Thanks in advance.

@Salam_Al-Khammasi in the config file, specify the database driver that was in 3.3.0-15 and there will be no problem.

@Dimidrol I did that but I got the error above

@Salam_Al-Khammasi add data from the old file to config.TEMPLATE.inc.php , then make it config.inc.php

@Dimidrol What kind of data do u mean. I’m really sorry if I didn’t get well

@Dimidrol I’ve restored the back up and changed sqli to sql but still getting the same error

2023-07-02 23:54:24 [code: Installer Installer::checkPhpVersion] 2023-07-02 23:54:24 [code: Installer Installer::installDefaultNavigationMenus] 2023-07-02 23:54:24 [code: Installer Installer::migrateStaticPagesToNavigationMenuItems] 2023-07-02 23:54:24 [migration: APP\migration\upgrade\v3_4_0\PreflightCheckMigration] 2023-07-02 23:54:31 [A pre-flight check failed. The software was successfully upgraded to 3.3.9.9 but could not beupgraded further (to 3.4.0.1). Check and correct the error, then try again.] ERROR: Upgrade failed: DB: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'at.assoc_type' in 'where clause' (SQL: select distinct at.type_idfromannouncement_typesasatleft joinjournalsasconat.assoc_id=c.journal_idwherec.journal_idis null orat.assoc_type <> 256)

1 Like

I got same issues but still don’t know how to fix that issues.

See Unsupported assoc_type in the event log: 515 · Issue #9121 · pkp/pkp-lib · GitHub

You may apply this patch or wait until OJS 3.4.0-2 is available.

1 Like

Facing this issue, looks similar to this.
Any ideas/help:

[30-Jul-2023 14:34:09 UTC] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'at.assoc_type' in 'where clause' (SQL: select distinct `at`.`type_id` from `announcement_types` as `at` left join `journals` as `c` on `at`.`assoc_id` = `c`.`journal_id` where `c`.`journal_id` is null or `at`.`assoc_type` <> 256)

Upgrade done from 3.3.0.7 to 3.4.0.1