A database error has occurred durring upgrade to ojs 3.2.10

I just tried upgrading ojs 3.2.0.3 to 3.2.1.0, but when I click “Upgrade Open Journal System” then an error comes out:

Errors occurred during installation:
A database error has occurred: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1

image
And the same error message appears in error_log

Please help how the solution

Hi @eddhie,

Are you able to restore your database from backup, and try the upgrade again using the command line upgrade tool? This will provide more information about where the upgrade failed.

Regards,
Alec Smecher
Public Knowledge Project Team

Is it possible you downloaded the release candidate 3.2.1rc1 version instead of the released 3.2.1?
I experienced this error when testing the pre-release version and saw it reported here
https://github.com/pkp/pkp-lib/issues/5967
to me it seems to be fixed in the final release.
When I experienced it testing the pre-release I went back, hit upgrade once again and it didn’t show the error anymore and everything worked as expected.

I have tried to restore the database, then I tried upgrading using the command line. But I don’t know whether my method is right or wrong, because nothing happened. And when I check the version it’s still 3.2.0.3.
image

I think I have downloaded the final release, because I got it from this link https://pkp.sfu.ca/ojs/ojs_download/
I am going to try to download again and upgrade it

Hi @eddhie,

There should be some output as a result of the php tools/upgrade.php upgrade command. The fact that you’re seeing none suggests to me that an error is occurring. I’d suggest checking your PHP error log for details.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
I have checked the error log, here what I have from the error log

[25-Jun-2020 04:03:39 UTC] PHP Warning:  Constants may only evaluate to scalar values in /home/u7422945/public_html/bcsee.org/lib/pkp/classes/db/DBConnection.inc.php on line 17
[25-Jun-2020 04:03:40 UTC] PHP Parse error:  syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/u7422945/public_html/bcsee.org/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

I have also upgraded another journal to ojs 3.2.1.0 and it worked perfectly, but for this journal, I don’t know whats the problem

Thanks in advance

Hi @eddhie,

Your PHP seems to be too old; try running php -v to check it.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Since the hosting that we use stores several journals, some are version 2 and 3 so we use php 5.6. And for ojs 3 I use htaccess for setting to php 7
After I change the default to php 7.2, I can run the update using the CLI. And the information I get is as follows
image
But when I login as the journal manager, the version detected is still version 3.2.0.3. Are there any steps that I have missed?

Many thanks

Hi @eddhie,

If the upgrade completes successfully, you’ll get a confirmation message saying so. I don’t see one on your screenshot, so I’d suggest checking your PHP error log.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, we are trying to upgrade OJS from 3.2.0.3 to 3.2.1.1 but getting the same error. We are running PHP 7.4 Apache…

upgrade error

Please advise!

Hi @Hassan_Abbas,

Unfortunately the error message doesn’t include the SQL query that caused the problem. I’d suggest trying to enable the database server’s query log to see if you can capture it that way.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi PKP Team!

I try upgrade from OJS 3.2.0.0 to 3.2.1-3 show error:
A database error has occurred: Can’t DROP INDEX section_editors_pkey; check that it exists

My server using PHP 7.3.26, Mariadb 10.5.5, Nginx

image

Please helpe me!