Error upgrading OJS from 3.1.1.2 to 3.2.1.1 POSTGRESQL

Hi,

I’m facing this error while upgrade process:
[schema: lib/pkp/xml/schema/rolesAndUserGroups.xml] ERROR: Upgrade failed: DB: ERROR: smallint out of range

Can someone please help me? Maybe @asmecher?
Today i’m upgrading the production, it’s not a test.

Regards,
Tarcisio Pereira

postgresql log:

2020-10-01 11:49:54 -03 [88533]: [1094-1] user=revistas,db=revistas3 ERROR: smallint out of range
2020-10-01 11:49:54 -03 [88533]: [1095-1] user=revistas,db=revistas3 STATEMENT: ALTER TABLE stage_assignments ALTER COLUMN recommend_only TYPE SMALLINT

And maybe something is wrong with this registry:

revistas3=> select *,recommend_only from stage_assignments order by recommend_only desc limit 2;
stage_assignment_id | submission_id | user_group_id | user_id | date_assigned | recommend_only | recommend_only
---------------------±--------------±--------------±--------±--------------------±---------------±---------------
1 | 132947 | 683 | 76920 | 2020-09-18 12:02:54 | 170559 | 170559
197840 | 161757 | 3168 | 92537 | 2019-10-15 17:35:43 | 1 | 1
(2 rows)

Hi @Tarcisio_Pereira,

There should definitely not be a 170559 entry for recommend_only – it should be 0 or 1 for false or true respectively. I suspect there’s bad data in your 3.1.1-2 database. Try changing that 170559 value to 1 after restoring your database from backup and before running the upgrade again.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher

And what is also strange is that it record 1 with stage_assignment_id = 1. The records with stage_assignment_id < 10 have date date_assigned like 2018.
I have no idea how it happened, there is no kind of interaction done directly at the database.
Anyway, I changed the value to 0 and I’m trying to update again.
Any news I will let you know.

Thank you.

Regards,
Tarcisio Pereira.