Upgrade OJS 3.2.1-4 to 3.3.0-5 ERROR

I upgrading OJS 3.2.1-4 to 3.3.0-5 and the upgrade fails and gives this error:

SQLSTATE[HY000]: General error: 1824 Failed to open the referenced table ‘files’ (SQL: alter table submission_files add constraint submission_files_file_id_foreign foreign key (file_id) references files (file_id))

Can anyone help me?, search the forum but did not find a topic with the same problem. It is the only error found in the PHP LOG.

SERVER DATA:

WAMPSERVER 3.2.5 64BITS
PHP 7.4.9
MYSQL 8.0.21

Hi @dragoniant

OJS 3.3 requires that your MySQL user has REFERENCE privilege granted against the DB which allows user to create a foreign key.

Best,
Israel Cefrin
PKP Team

Hi @israel.cefrin ,

Thanks for your reply, How do I do that? The user that is connecting to the database is the main ROOT of Mysql.

Hi @dragoniant

To grant this privilege you will need to edit the user via phpMyAdmin (or any other MySQL DB manager). And check the REFERENCES administration option:
image

Best,
Israel Cefrin
PKP Team

Hi @israel.cefrin,

I activate REFERENCES privileges to the ROOT user and a new one that I create (iush_user).

Imagen sin título

I tested with the two users, I started the upgrade and again I got the error:

[20-May-2021 17:47:48 UTC] SQLSTATE[HY000]: General error: 1824 Failed to open the referenced table ‘files’ (SQL: alter table submission_files add constraint submission_files_file_id_foreign foreign key (file_id) references files (file_id))

Hi @dragoniant

Have you recreated the database, the user and restored the original DB dump?

Best,
Israel Cefrin
PKP Team

1 Like

Hi @israel.cefrin,

I hadn’t recreated the database. Delete everything and recreate the database and the new user, assign it privileges. I went to the database and imported the SQL Dump. Start the upgrade and I get the same error.

Delete everything again and recreate everything but in a different order:

  1. Start first creating the user. At the same time as creating the user, create a database for the user with the same name (selecting the two check boxes available for the Item create databases). and assign all the privileges.

image

  1. Then verify that the user was assigned to the database and had all privileges.

image

  1. Upload the SQL Dump.

  2. Check that all tables in the database, the engine was InnoDB and the collation utf8_general_ci.

  3. Start de upgrade.

Upgrade of OJS 3.2.1.4 to version 3.3.0.6 has completed successfully.

Thank you for the help, it was very useful and I to fix the error.

2 Likes

We are using BHP server for OJS 3 for processing of JAFMDC. All were went smoothly but now fir one year we are tryning to send our articles for review thorough ojs but we fails. Our email notifications are sent to reviewers or authors thats why we are not able to communicate with reviewers as well as authors . i will be gratefu if any one help and guide me concerning this problem.
Regards
Dr shireen jawed
Editor
Journal of aziz Fatimah medical and dental college

Hi @shireen

Just checking if I understood correctly: your system notification is not working?

Best,
Israel