[Spacewalk-list] Failed schema upgrade from 2.0 to 2.1, ERROR: duplicate key value violates unique constraint "rhn_pkey_keyid_uq"

Tomáš Kašpárek tkasparek at redhat.com
Wed Mar 5 08:07:53 UTC 2014


On 03/05/2014 08:40 AM, Eduardo Minguez wrote:
> ----- Original Message -----
>> From: "Tomáš Kašpárek" <tkasparek at redhat.com>
>> To: spacewalk-list at redhat.com
>> Sent: Wednesday, 5 March, 2014 8:24:05 AM
>> Subject: Re: [Spacewalk-list] Failed schema upgrade from 2.0 to 2.1, ERROR: duplicate key value violates unique
>> constraint "rhn_pkey_keyid_uq"
>>
>> Hello,
>>
>> this issue will be fixed in package spacewalk-schema-2.1.51 which
>> will
>> be released today.
> So, by updating the spacewalk-schema package and running a "spacewalk-schema-upgrade" will be fixed or is there any other step needed?
>
> Thanks
You will need to restore your database from the backup to the state 
where it was prior to Spacewalk upgrade as the database is now in state 
when it's in middle of upgrade process. Then you simply run 
"spacewalk-schema-upgrade" with new spacewalk-schema package.
>
>> Regards Tomas
>>
>> On 03/05/2014 08:11 AM, Jonathan Hoser wrote:
>>> Hi,
>>>
>>> I had the same issue,
>>> (this is schema-update script #047)
>>> where I already had the to-be-inserted key in my table (no clue
>>> where I
>>> got it),
>>> and I manually updated it with the values the insert-statement
>>> wanted to
>>> place there.
>>>
>>> Afterwards the 2 (or 3?) remaining sqls I manually applied using
>>> the \i
>>> [filename] syntax,
>>> and everything was fine...
>>> (ooh... I just remembered, that a last transaction somewhere
>>> changes the
>>> database-version field... I have to go check on that one...)
>>>
>>> Best
>>> -Jonathan
>>>
>>> On 03/04/2014 03:28 PM, Eduardo Minguez wrote:
>>>> Hi,
>>>>
>>>> CentOS 6.5 x86_64 yum updated to the latest version, and following
>>>> the spacewalk upgrade guide in
>>>> https://fedorahosted.org/spacewalk/wiki/HowToUpgrade, it fails in
>>>> the schema-upgrade procedure like:
>>>>
>>>> (snip)
>>>> ...
>>>> ------------------------------------------------------------------------------------------------
>>>>    spacewalk-schema-2.0-to-spacewalk-schema-2.1/046-rhnUserExtGroupMapping-trigger.sql.postgresql
>>>> (1 row)
>>>>
>>>> CREATE FUNCTION
>>>> CREATE TRIGGER
>>>> COMMIT
>>>>                                        ?column?
>>>> -----------------------------------------------------------------------------------
>>>>    spacewalk-schema-2.0-to-spacewalk-schema-2.1/047-rhnPackageKey-f20.sql.postgresql
>>>> (1 row)
>>>>
>>>> psql:/var/log/spacewalk/schema-upgrade/20140304-125445-script.sql:4308:
>>>> ERROR:  duplicate key value violates unique constraint
>>>> "rhn_pkey_keyid_uq"
>>>>
>>>>
>>>> If I try to do it again it says:
>>>>
>>>> spacewalk-schema-upgrade
>>>> Unknown schema name [(0 rows)] found.
>>>>
>>>> Is there anything I can do to fix it?
>>>>
>>>> Thanks
>>>>
>> --
>> Tomáš Kašpárek
>> Red Hat Satellite 5, Red Hat
>>
>>




More information about the Spacewalk-list mailing list