Error during upgrade OJS 3.4.0-5 to 3.4.0-6: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'files'

Describe the issue or problem
I’m facing error during upgrade OJS 3.4.0-5 to 3.4.0-6 using terminal command

Steps I took leading up to the issue
First, i check the version

$ php tools/upgrade.php check
Code version:      3.4.0.6
Database version:  3.4.0.5
Latest version:    3.4.0.6
Database version is older than code version
Run "tools/upgrade.php upgrade" to update

Then i try to upgrade using command below, but the error appear and upgrade process stopped right there:

$ php tools/upgrade.php upgrade
2024-07-23 15:35:17 [pre-install]
2024-07-23 15:35:17 [load: upgrade.xml]
2024-07-23 15:35:17 [version: 3.4.0.6]
2024-07-23 15:35:17 [code: Installer Installer::checkPhpVersion]
2024-07-23 15:35:17 [code: Installer Installer::installDefaultNavigationMenus]
2024-07-23 15:35:17 [code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
2024-07-23 15:35:17 [migration: PKP\migration\upgrade\v3_4_0\I9830_FixEmptyUserLocales]
2024-07-23 15:35:17 [migration: PKP\migration\upgrade\v3_4_0\I8592_SiteNotificationSubscriptions]
2024-07-23 15:35:17 [migration: APP\migration\upgrade\v3_4_0\I9813_QuickSubmitSubmissionProgressType]
2024-07-23 15:35:17 [revert migration: PKP\migration\upgrade\v3_4_0\I8592_SiteNotificationSubscriptions]
2024-07-23 15:35:18 [revert migration: PKP\migration\upgrade\v3_4_0\I9830_FixEmptyUserLocales]
2024-07-23 15:35:18 [downgrade for "PKP\migration\upgrade\v3_4_0\I9830_FixEmptyUserLocales" unsupported: Downgrade not supported]
ERROR: Upgrade failed: DB: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: 'files' (SQL: update `submissions` set `submission_progress` =  where `submission_progress` = 0)

I have no idea with this error :thinking:

Hi @dnaite,

OJS 3.4.0-5 and 3.4.0-6 are database compatible, so there’s actually no need to run the upgrade script when going between them. But I’ll ask someone to take a look into this.

Regards,
Alec Smecher
Public Knowledge Project Team

4 Likes

Hi @asmecher
Finally i can use OJS 3.4.0.6 code by using 3.4.0.5 database without upgrade script.

I also have added 3.4.0.6 record to the versions table (version_id=81)

Now, the System Information page shows the current version number, also the update notification has gone away.
The version numbers shown are not sorted properly, but it just a cosmetic, at least it works like a charm right now :grin:

Thank you for your help.

I tried the upgrade today, the same error occurred. Thank you @asmecher for the workaround, but the problem with the database still persist and we at our university are afraid that in the next upgrade the problem still persists, and may cause problems in a major version upgrade in the future. Thus, we yould like to know if there´s a precise explenation to why this error of the data format is occurring in the upgrade procedure. Please help and advise. Our cyber security team audits, oblige us to always have the latests code and data base versions.

Thank you for any help you could give us

Kind regards
João Aires

…im sorry but i forgot the precise error, that is similar from the one on this threat

Upgrade failed: DB: SQLSTATE[22007]: Invalid datetime format: 1292 Trunca ted incorrect DECIMAL value: ‘’ (SQL: update submissions set submission_progr ess = where submission_progress = 0)

Thanks for any help you can give

Hi @joaoaires , if your current installation also use OJS 3.4.0.5, please give a try the method described by @asmecher .
It works on my case from 3.4.0.5 to 3.4.0.6. Just replace the old OJS code with the new one and add new record for 3.4.0.6 on versions table in order to remove the upgrade notification on siteadmin dashboard.

1 Like

Hi @dnaite, i will try this method in my test environment … my only concern is that in future upgrades this problem will happen again and in the long term could be problematic in a major version upgrade.

Thanks for the reply

Hi all,

I can 100% confirm that you are OK to update the code from 3.4.0-5 to 3.4.0-6 and not run the upgrade script. There is no need to update the versions table either, but you can do that if you like. Meanwhile, there will be feedback on the error message here soon.

Regards,
Alec Smecher
Public Knowledge Project Team

I have a similar problem

n00

ERROR: Upgrade failed: DB: SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value: ‘contributors’ (SQL: update submissions set submission_progress = where submission_progress = 0)

Thanks for any help you can give x 2

Hi all,
Unfortunately I cannot reproduce the problem, but maybe this change would solve the problem: pkp/pkp-lib#9813 cast int to string by bozana · Pull Request #4376 · pkp/ojs · GitHub.
I.e. converting/casting the $oldValue to a string (adding (string) in front of the $oldValue in that line).
Would anybody be able to test the upgrade with this change and report if it works then?

Also, what database are you using?

Thanks a lot!
Bozana

Hi all,

@bosana, your fix worked perfectly, thanks. I repeated the upgrade procedure from 3.4.0.5 to 3.4.0.6 and the upgrade script worked has expected. In both my test and production environments, I use a mysql (MariaDB) database.

Thank you all for the help
João Aires

Hi @bozana , Your solution works for me, I can upgrade from OJS 3.4.0-5 to 3.4.0-6 with no issue raised.
I use MySQL server.
Here’s the upgrade log:

➜  ojs3406 ~$ php tools/upgrade.php check                                                                                                                                         
Code version:      3.4.0.6
Database version:  3.4.0.5
Latest version:    3.4.0.6
Database version is older than code version
Run "tools/upgrade.php upgrade" to update
➜  ojs3406 ~$ php tools/upgrade.php upgrade                                                                                                                                       
2024-07-26 20:24:59 [pre-install]
2024-07-26 20:24:59 [load: upgrade.xml]
2024-07-26 20:24:59 [version: 3.4.0.6]
2024-07-26 20:24:59 [code: Installer Installer::checkPhpVersion]
2024-07-26 20:24:59 [code: Installer Installer::installDefaultNavigationMenus]
2024-07-26 20:25:00 [code: Installer Installer::migrateStaticPagesToNavigationMenuItems]
2024-07-26 20:25:00 [migration: PKP\migration\upgrade\v3_4_0\I9830_FixEmptyUserLocales]
2024-07-26 20:25:00 [migration: PKP\migration\upgrade\v3_4_0\I8592_SiteNotificationSubscriptions]
2024-07-26 20:25:00 [migration: APP\migration\upgrade\v3_4_0\I9813_QuickSubmitSubmissionProgressType]
2024-07-26 20:25:00 [code: Installer Installer::addPluginVersions]
2024-07-26 20:25:00 [post-install]
Successfully upgraded to version 3.4.0.6
➜  ojs3406 $ php tools/upgrade.php check  
Code version:      3.4.0.6
Database version:  3.4.0.6
Latest version:    3.4.0.6
Your system is up-to-date

Thank you. :grinning: :+1:

Great, glad to hear, thank you!

1 Like