Error while upgrading OJS from 3.1.1.4 to 3.3.0.5

I am trying to upgrade OJS from 3.1.1.4, and want to upgrade it to 3.3.0.5 While upgrading It is showing the database error as below:

A database error has occurred: SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row (SQL: UPDATE submissions as s SET current_publication_id = ( SELECT p.publication_id FROM publications as p WHERE s.submission_id = p.submission_id ) )

Earlier it was showing the error of Engine that I has updated to InnoDB.

Kindly suggest.

@staff @asmecher Kindly suggest.

@loveleentak

Please be patient. Support on the PKP Community Forum is provided for free by PKP staff and community members. We are a small team and need to balance our time spent answering questions here on the Forum with our other work developing and maintaining our free and open source software and other services. We do not guarantee that every question will be answered or that every issue is resolved.

If you are interested in professional, specialized support for your OJS install, PKP Publishing Services offers a fee-based service which provides the hosting of OJS, daily backups of your data, applying security patches, free upgrades, and priority answering your support questions. They offer solutions for a range of publishers, from small, cost-conscious or society publishers to full university and commercial publishing institutions. More information is available on their website.

Hi @loveleentak,

Is it possible that your publications table wasn’t empty before you started? If you experienced a failed upgrade and reloaded your database from backup without dropping and re-creating the database entirely, it’s possible that some entries were left around from the failed upgrade and affected your second attempt.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

I have tried with almost all the options, still, it is showing the below error:

Errors occurred during installation:

A database error has occurred: SQLSTATE[21000]: Cardinality violation: 1242 Subquery returns more than 1 row (SQL: UPDATE submissions as s SET current_publication_id = ( SELECT p.publication_id FROM publications as p WHERE s.submission_id = p.submission_id ) )

Kinldy guide the procedure so that I can overcome this issue and able to upgrade the OJS.

Hi @loveleentak,

Did you verify before running the upgrade that the publications table did not exist?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

Yes right. I have checked publications table doesn’t exist in the database before running the upgrade.

Please guide me further.

Hi @loveleentak,

After any upgrade failure, are you completing a clean-up and restore?

  • Fully drop the database
  • Re-create the database
  • Reload the database from a backup taken before the first upgrade attempt to 3.3.0-5 was executed
  • Restore the files directory from a backup likewise taken before the upgrade attempt

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I have dropped the dataset and re-created it. Then uploaded the database from the backup (before 1st upgrade), but still facing the issue. This time it is showing the following error.

A database error has occurred: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table `submission_file_revisions` add constraint `submission_file_revisions_submission_file_id_foreign` foreign key (`submission_file_id`) references `submission_files` (`submission_file_id`))

Please Guide.

Hi @loveleentak,

OK, you’ve resolved the issue you were originally asking about in this topic; could you post this next question as a new topic, including all relevant details? That’ll help keep the forum organized.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

Thank you for your reply. I have created a new topic.

1 Like