I am upgrading OJS and get the following error:
UPDATE publication_galleys as g
SET url_path = (
SELECT gs.setting_value
FROM publication_galley_settings as gs
WHERE gs.galley_id = g.galley_id
AND gs.setting_name = 'pub-id::publisher-id'
)
failed. Subquery returns more than 1 row
How can I solve this problem?
Hi @Sunflower,
Is this your second attempt to run an upgrade? If so, make sure you restored your database from backup after the failure.
Regards,
Alec Smecher
Public Knowledge Project Team
Hi Alec,
Do you mean that I run the upgrade from OJS 3.1.2-4 to 3.2.1-1 twice with the same database? No, I don’t do this. When I do the installation and when it failed I begin always with a backup from the database. Before 3.1.2-4 we are using OJS 3.0.2. That upgrade was succesfully.
Hi @Sunflower,
What do you get for the following query after the upgrade has failed?
SELECT * FROM publication_galley_settings WHERE setting_name = 'pub-id::publisher-id' GROUP BY galley_id HAVING COUNT(setting_value) > 1;
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @Sunflower,
This indicates that galleys 1058 and 1336 seem to have two publisher IDs entered. Could you check the submission_galley_settings
table in your pre-upgrade backup to see if there are two settings with setting_name = 'pub-id::publisher-id'
for those galley IDs?
Regards,
Alec Smecher
Public Knowledge Project Team
Hi @asmecher,
Yes there are:


I see also a double record for datacite::registeredDoi, I think this is not correct. Is this also a problem? I checked with
SELECT * FROM submission_galley_settings WHERE setting_name = ‘datacite::registeredDoi’ GROUP BY galley_id HAVING COUNT(setting_name) > 1
and there are 41 records.
Hi @asmecher,
I have deleted the empty record with galley_id 1058 and 1336 and setting_name pub-id::publisher-id and setting_value with no text in it. Then I did a new upgrade. The upgrade is now succesfully ugraded to 3.2.1.1 
Do you think I get trouble with deleting this 2 records?
Hi @Sunflower,
I don’t think that’ll cause problems! Glad to hear the upgrade was successful.
Regards,
Alec Smecher
Public Knowledge Project Team