Bug 568293

Summary: ORA-01422: exact fetch returns more than requested number of rows
Product: [Community] Spacewalk Reporter: Michael Mráka <mmraka>
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED CURRENTRELEASE QA Contact: Garik Khachikyan <gkhachik>
Severity: medium Docs Contact:
Priority: low    
Version: 0.8CC: gkhachik, mkoci, mzazrivec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 613996 (view as bug list) Environment:
Last Closed: 2010-05-10 14:52:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 582354, 613996    
Attachments:
Description Flags
bz568293-fix.sql
none
bz568293-fix.sql none

Description Michael Mráka 2010-02-25 10:20:23 UTC
Description of problem:
After 0.7 -> 0.8 upgrade spacewalk-repo-sync ends up with ORA-01422: exact fetch returns more than requested number of rows.
Actually it's a bug in schema upgrade script which created duplicated entries in rhnChecksum table.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. install spacewalk 0.7 + create a channel
2. push spacewalk-pxt-0.7.8-1.el5.noarch.rpm and spacewalk-base-minimal-0.7.8-1.el5.noarch.rpm to the channel
3. perform upgrade to 0.8
4. push spacewalk-pxt-0.8.17-1.el5.noarch to the channel
  
Actual results:
Traceback and ORA-01422: exact fetch returns more than requested number of rows

Expected results:
no error, package pushed

Additional info:

Comment 1 Michael Mráka 2010-03-01 23:13:29 UTC
The bug is not present in sql upgrade scripts but update-packages script and it applies to sha256 packages only.

New steps to reproduce:
1. install spacewalk 0.7 + create a channel
2. push spacewalk-pxt-0.7.8-1.fc12.noarch.rpm and
spacewalk-base-minimal-0.7.8-1.fc12.noarch.rpm to the channel
3. perform upgrade to 0.8
4. push spacewalk-pxt-0.8.17-1.fc12.noarch to the channel

Comment 3 Michael Mráka 2010-03-02 11:01:18 UTC
Created attachment 397296 [details]
bz568293-fix.sql

This is an sql script to fix duplicates in database.

As root run
# sqlplus $(spacewalk-cfg-get default_db) @bz568293-fix.sql

Comment 4 Michael Mráka 2010-03-02 13:19:19 UTC
Created attachment 397321 [details]
bz568293-fix.sql

New version which also creates unique constraint.

Comment 5 Michael Mráka 2010-03-03 15:32:32 UTC
spacewalk-schema-0.8.15-1  contains fixed schema.

Test plan:

1) see comment #1 for steps to reproduce
make sure you have spacewalk-schema-0.8.12-1.el5.noarch installed to reproduce the error
after applying bz568293-fix.sql rhnpush and/or spacewalk-repo-sync have to work again

2) when installed spacewalk-schema-0.8.15-1 error should be never raised while
doing comment #1 for steps to reproduce

Comment 7 Garik Khachikyan 2010-03-09 11:03:02 UTC
# REOPEN

Hi Michael,

Going through the second scenario (yum install spacewalk-oracle-0.8.1-1.el5; rpm -Uvh http://koji.rhndev.redhat.com/mnt/koji/packages/spacewalk-schema/0.8.15/1.el5/noarch/spacewalk-schema-0.8.15-1.el5.noarch.rpm; spacewalk-setup) there seems the issue not fixed still...

I'll keep the current SW 0.8 installation for your reproducer/investigations. Contact me for details to get access to that server. Thanks.

Comment 15 Michael Mráka 2010-05-10 14:52:26 UTC
This bug has been fixed in Spacewalk 1.0.