Upgrade from 3.3.0-21 to 3.5.0-1

Describe the issue or problem
The conversion of the database worked but trying to reach the website gives 500-error. Is it a setting error in the config.inc.php?

Steps I took leading up to the issue
For example:

  1. Followed the instructions for upgrade via command line. Upgrade of database worked without errors.
  2. Did get the error below

What application are you using?
OJS 3.3.0-21 to 3.5.0-1

Additional information
php log:

[16-Jul-2025 12:20:45 Europe/Stockholm] PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'WHERE' in /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:407
Stack trace:
#0 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(407): PDO->prepare()
#1 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(812): Illuminate\Database\Connection->Illuminate\Database\{closure}()
#2 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(779): Illuminate\Database\Connection->runQueryCallback()
#3 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(398): Illuminate\Database\Connection->run()
#4 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3106): Illuminate\Database\Connection->select()
#5 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3091): Illuminate\Database\Query\Builder->runSelect()
#6 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3676): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#7 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3090): Illuminate\Database\Query\Builder->onceWithColumns()
#8 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(343): Illuminate\Database\Query\Builder->get()
#9 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3013): Illuminate\Database\Query\Builder->first()
#10 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php(97): Illuminate\Database\Query\Builder->find()
#11 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php(136): Illuminate\Session\DatabaseSessionHandler->read()
#12 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Session/Store.php(176): Illuminate\Session\DatabaseSessionHandler->write()
#13 /var/www/html/journal/lib/pkp/classes/core/PKPSessionServiceProvider.php(38): Illuminate\Session\Store->save()
#14 [internal function]: PKP\core\PKPSessionServiceProvider->PKP\core\{closure}()
#15 {main}

Next Illuminate\Database\QueryException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'id' in 'WHERE' (Connection: mysql, SQL: select * from `sessions` where `id` = XYZXYZXYZXYZXYZ limit 1) in /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php:825
Stack trace:
#0 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(779): Illuminate\Database\Connection->runQueryCallback()
#1 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php(398): Illuminate\Database\Connection->run()
#2 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3106): Illuminate\Database\Connection->select()
#3 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3091): Illuminate\Database\Query\Builder->runSelect()
#4 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3676): Illuminate\Database\Query\Builder->Illuminate\Database\Query\{closure}()
#5 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3090): Illuminate\Database\Query\Builder->onceWithColumns()
#6 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Concerns/BuildsQueries.php(343): Illuminate\Database\Query\Builder->get()
#7 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php(3013): Illuminate\Database\Query\Builder->first()
#8 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php(97): Illuminate\Database\Query\Builder->find()
#9 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Session/DatabaseSessionHandler.php(136): Illuminate\Session\DatabaseSessionHandler->read()
#10 /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Session/Store.php(176): Illuminate\Session\DatabaseSessionHandler->write()
#11 /var/www/html/journal/lib/pkp/classes/core/PKPSessionServiceProvider.php(38): Illuminate\Session\Store->save()
#12 [internal function]: PKP\core\PKPSessionServiceProvider->PKP\core\{closure}()
#13 {main}
  thrown in /var/www/html/journal/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 825

Update:
When I set the installed = Off and reach the install webpage I get the following error:


**Fatal error** : Uncaught TypeError: PKP\core\PKPString::convertStrftimeFormat(): Argument #1 ($format) must be of type string, null given, called in /var/www/html/journal/lib/pkp/classes/template/PKPTemplateManager.php on line 1404 and defined in /var/www/html/journal/lib/pkp/classes/core/PKPString.php:300 Stack trace: #0 /var/www/html/journal/lib/pkp/classes/template/PKPTemplateManager.php(1404): PKP\core\PKPString::convertStrftimeFormat() 
#1 /var/www/html/journal/lib/pkp/classes/form/Form.php(214): PKP\template\PKPTemplateManager->display() 
#2 /var/www/html/journal/lib/pkp/classes/form/Form.php(156): PKP\form\Form->fetch() 
#3 /var/www/html/journal/lib/pkp/classes/install/form/MaintenanceForm.php(51): PKP\form\Form->display() 
#4 /var/www/html/journal/lib/pkp/classes/install/form/InstallForm.php(124): PKP\install\form\MaintenanceForm->display() 
#5 /var/www/html/journal/lib/pkp/pages/install/InstallHandler.php(58): PKP\install\form\InstallForm->display() 
#6 [internal function]: PKP\pages\install\InstallHandler->index() 
#7 /var/www/html/journal/lib/pkp/classes/core/PKPRouter.php(327): call_user_func() 
#8 /var/www/html/journal/lib/pkp/classes/core/PKPPageRouter.php(249): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest() 
#9 /var/www/html/journal/lib/pkp/classes/core/Dispatcher.php(157): PKP\core\PKPPageRouter->route() 
#10 /var/www/html/journal/lib/pkp/classes/core/PKPApplication.php(426): PKP\core\Dispatcher->dispatch() 
#11 /var/www/html/journal/index.php(21): PKP\core\PKPApplication->execute() 
#12 {main} thrown in **/var/www/html/journal/lib/pkp/classes/core/PKPString.php** on line **300**

Hi @eddoff, can you check what is set for date_format_short under the [general] section in your config.inc.php file? It sounds like you may have an invalid setting there.

Oh!
Thank you @kaitlin!
I had the following settings before:

time_zone = "Stockholm"
; Short and long date formats
date_format_short = "%Y-%m-%d"
date_format_long = "%B %e, %Y"
datetime_format_short = "%Y-%m-%d %I:%M %p"
datetime_format_long = "%B %e, %Y - %I:%M %p"
time_format = "%I:%M %p"

But changed to the settings in the TEMPLATE-file:

time_zone = "Europe/Stockholm"
; Short and long date formats
date_format_short = "Y-m-d"
date_format_long = "F j, Y"
datetime_format_short = "Y-m-d h:i A"
datetime_format_long = "F j, Y - h:i A"
time_format = "h:i A"

Is it wrong settings in the TEMPLATE-file?

My “old” settings work in 3.5 now! Thanks!

/ @eddoff

Dear @kaitlin and others,

I can now access the install webpage. But the first PHP Fatal error still appears when setting installed = On
If I have installed = Off and go further to the update link and try to upgrade the db, I get an error that the form is not filled in correctly.

I tried to take a new clean install of OJS 3.5, and that seems to work, so there is something with the database i guess. I tried to install via the webpage and then I’ve got an error message saying that there is a missing contact email address for one of the journals.

When that was corrected I made a new try. I then got several of the following errors:

A row with "user_id"="3042" and "setting_name"="affiliation" found in table "user_settings" which will conflict with other rows specific to the locale key "en" after the migration. Please review this row before upgrading.

I saw the following post Errors while upgrading from OJS-3.3.0-14 to OJS-3.4.0rc2 · Issue #8929 · pkp/pkp-lib But that problem seemed to me to be corrected. Are the still problems when upgrading from 3.3 to 3.5?

@eddoff

When checking my database there are some doublets in that table:

MariaDB [ojs]> SELECT * FROM user_settings WHERE setting_name = "affiliation" AND user_id = "1234"
    -> ;
+---------+--------+--------------+------------+----------+--------------------+--------------+
| user_id | locale | setting_name | assoc_type | assoc_id | setting_value      | setting_type |
+---------+--------+--------------+------------+----------+--------------------+--------------+
|    1234 | en_US  | affiliation  |       NULL |     NULL | University of Oslo | string       |
|    1234 | en_US  | affiliation  |       NULL |     NULL | U                  | string       |
+---------+--------+--------------+------------+----------+--------------------+--------------+

I have no idea where that row with just a “U” come from!

Hi @eddoff, it’s a little unclear from the posts if you have already upgraded to 3.5, in which case you should not be running the install or upgrade scripts, or if you are having difficulty with the upgrade. Have you already completed the command-line upgrade from 3.3 to 3.5, and if so, was it successful or were errors displayed? And have you reviewed the 3.5 config template for other changes needed in your config.inc.php file?

Hi, yes I am sorry, I wasn’t clear enough.

I tried in many different ways to upgrade, and I did also a clean install (which worked). The problem was my database. The origin of the errors was users imported via the XML import tool long time ago.

I have got 63 errors like this when trying to upgrade via the command line:
ERROR: Upgrade failed: DB: A row with "user_id"="3042" and "setting_name"="affiliation" found in table "user_settings" which will conflict with other rows specific to the locale key "en" after the migration. Please review this row before upgrading.

I found them in the database with the following SQL query (an AI helped me with the syntax):

SELECT * FROM user_settings WHERE (COALESCE(user_id, ''), COALESCE(locale, ''), COALESCE(setting_name, ''), COALESCE(assoc_type, ''), COALESCE(assoc_id, ''), COALESCE(setting_type, '') ) IN (SELECT COALESCE(user_id, ''), COALESCE(locale, ''), COALESCE(setting_name, ''), COALESCE(assoc_type, ''), COALESCE(assoc_id, ''), COALESCE(setting_type, '') FROM user_settings GROUP BY COALESCE(user_id, ''), COALESCE(locale, ''), COALESCE(setting_name, ''), COALESCE(assoc_type, ''), COALESCE(assoc_id, ''), COALESCE(setting_type, '') HAVING COUNT(*) > 1 ) ORDER BY user_id;

I deleted the rows with the following query (It was 63 of them that I made up in Excel based on the output from the query above):

DELETE from user_settings WHERE setting_name = 'affiliation' AND user_id = '3042' AND setting_value = 'U' LIMIT 1;

Now I could successfully upgrade the database and OJS was accessable from the web. However, a lot of plugins were not available yet to 3.5 so we cannot upgrade the production server yet.

@eddoff

Thanks for clarifying that @eddoff, glad you found a solution.

Out of curiosity, are there specific plugin upgrades you are waiting for that are blocking your upgrade process?

Thank you for your reply!

Yes. The major problems are with the XML publishing process, using JatsParser, Texture and Docx2xml-converter. I am not sure we are able to install either of 3.4 or 3.5 since none of these plugins has been updated to support higher versions than 3.3. I think we must rely on the coming 3.6 version with the new XML-publishing routes. Or do you know a way to publish XML:s converted to text on the article landing pages?

Further there are some other plugins I am missing such as: customLocale, defaultTranslation, controlpublicfiles, authorRequriements, oldGregg, conference, crossrefconference

@eddoff