[OPEN-ILS-GENERAL] Upgrade error

Blake Henderson blake at mobiusconsortium.org
Wed May 20 22:06:45 EDT 2015


Jim,

Take a peak at the sql file and on line 6 you will find:

SELECT evergreen.upgrade_deps_block_check('0892', :eg_version);

That function call attempts to insert into config.upgrade_log.

The config.upgrade_log table has a primary key constraint on the column 
"version"

Meaning, only one row is allowed to have the version value set to 
'0892'. This is to ensure the sanity of the database.

That value was set when you ran this script: 2.6.3-2.6.4-upgrade-db.sql

Looking through our upgrade scripts, we don't have a proper script to 
upgrade from 2.6.4 to 2.7.0. This came up before. Take a look at the 
discussion:

http://georgialibraries.markmail.org/search/?q=Upgrade+Script+for+2.6.4+to+2.7#query:Upgrade%20Script%20for%202.6.4%20to%202.7+page:1+mid:iddjybejzbczs45d+state:results

The 2.6.4 script would have brought your database up to '0895'
(
from line 157 inside of 2.6.3-2.6.4-upgrade-db.sql
SELECT evergreen.upgrade_deps_block_check('0895', :eg_version);
)

Compare the two files:
2.6.3-2.6.4-upgrade-db.sql
2.7.0-2.7.1-upgrade-db.sql

and you will find them to be exactly the same with the header comment 
changed.

So your database already has all of the changes from 2.7.0-2.7.1 applied.

You can skip that file and start with

2.7.1-2.7.2-upgrade-db.sql


-Blake-
Conducting Magic
MOBIUS
573-234-4513
877-312-3517

On 5/20/2015 6:36 PM, Jim Raney wrote:
> Hello all,
>
> I'm test-upgrading a snapshot of a live evergreen system running 2.6.4 
> to 2.8.1.  I've successfully run 2.6.3-2.7.0-upgrade-db.sql. I then 
> get the following:
>
> root at evergreen:/home/opensrf/Evergreen-ILS-2.8.1/Open-ILS/src/sql/Pg# 
> psql -U postgres -f version-upgrade/2.7.0-2.7.1-upgrade-db.sql evergreen
> BEGIN
> INSERT 0 1
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:6: ERROR: duplicate 
> key value violates unique constraint "upgrade_log_pkey"
> DETAIL:  Key (version)=(0892) already exists.
> CONTEXT:  SQL statement "INSERT INTO config.upgrade_log (version, 
> applied_to) VALUES (my_db_patch, my_applied_to)"
> PL/pgSQL function "upgrade_deps_block_check" line 22 at SQL statement
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:19: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:108: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:112: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:149: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:152: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:154: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:157: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:159: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:160: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:161: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:162: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:163: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:164: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:166: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:167: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> psql:version-upgrade/2.7.0-2.7.1-upgrade-db.sql:168: ERROR: current 
> transaction is aborted, commands ignored until end of transaction block
> ROLLBACK
>
> Did I make a mistake running 2.6.3-2.7.0-upgrade-db.sql?  Or do I have 
> something else going on?
>
> -- 
> Jim Raney



More information about the Open-ils-general mailing list