Hide Forgot
Description of problem: Package stays partially in the database after non-trivial scenario and package-cleanup-bunch taskomatic bunch. Version-Release number of selected component (if applicable): spacewalk-taskomatic-1.6.77-1.el5 spacewalk-schema-1.6.28-1.el5 spacewalk-backend-tools-1.6.40-1.el5 How reproducible: always Steps to Reproduce: 1. create channel (all following happens with this channel) 2. push package A into it 3. dump it into dump First 4. delete package A from it using API call 5. push package B 6. dump it into dump Second 7. spacewalk-remove-channel -c channel 8. satellite-sync the channel from dump First 9. satellite-sync the channel from dump Second (happens even with --consider-full) 10. wait (or schedule) package-cleanup-bunch taskomatic bunch (by default every */10 minute) 11. try to push package A again => here comes the error message Actual results: # rhnpush -v --server=<fqdn> --username=admin --password=nimda packageA-1-1.noarch.rpm --channel=my_channel --nosig Wed Nov 23 03:44:38 EST 2011 Connecting to http://<fqdn>/APP Package packageA-1-1.noarch.rpm Not Found on RHN Server -- Uploading Uploading package packageA-1-1.noarch.rpm Using POST request Uploading failed for packageA-1-1.noarch.rpm Error: Package with same name already exists on server but contents differ (package recompiled). Use --force or remove old package before uploading the newer version. Diff: [['package_group', 5, 6], ['cookie', '', 'None']] Funny thing is, this do not happen when you try to re-push (as in step 11.) before step 10. or after step 11. Expected results: push should pass
The error that I observe is Uploading failed for psklenar-is-testing-me-first-1-1.noarch.rpm Error: Package with same name already exists on server but contents differ (package recompiled). Use --force or remove old package before uploading the newer version. Diff: [['cookie', '', 'None']] -- there is no package_group in the diff. But the cookie is deterministic.
I've now fixed the cookie problem in Spacewalk master, 6eede99aaf2f65ea50f8e73d61f11a16210e05db. The bug was caused by the fact that null value from the database was put to the channel dump (export) as string "None". Let me know if you have a reproducer for the package_group difference -- I was not able to see it.
Spacewalk 1.6 has been released.
Reopening. We were able to come across the package_group issue again. The problem seems to be that the same group is inserted to rhnpackagegroup multiple times, and presumably which id you get is not as stable on PostgreSQL as on Oracle. # select * from rhnpackagegroup ; id | name | created | modified ----+----------------------------+------------------------+------------------------ 1 | NoGroup | 2012-01-19 12:36:34-05 | 2012-01-19 12:36:34-05 4 | Applications/Productivity | 2012-01-19 13:34:29-05 | 2012-01-19 13:34:29-05 7 | Unspecified | 2012-01-19 13:45:43-05 | 2012-01-19 13:45:43-05 : 2 | test | 2012-01-19 12:52:03-05 | 2012-01-19 12:52:03-05 : 3 | Applications/Productivity | 2012-01-19 13:14:12-05 | 2012-01-19 13:14:12-05 : 5 | grp | 2012-01-19 13:44:57-05 | 2012-01-19 13:44:57-05 : 6 | grp | 2012-01-19 13:45:05-05 | 2012-01-19 13:45:05-05 8 | Unspecified | 2012-01-19 13:45:57-05 | 2012-01-19 13:45:57-05 (8 rows) Another interesting thing to note is # PGPASSWORD=spacepw psql -U spaceuser spaceschema psql (8.4.9) Type "help" for help. spaceschema=# select * from rhnpackagegroup where name = 'grp' ; id | name | created | modified ----+------+---------+---------- (0 rows) spaceschema=# select * from rhnpackagegroup where name like 'grp%' ; id | name | created | modified ----+------+------------------------+------------------------ 5 | grp | 2012-01-19 13:44:57-05 | 2012-01-19 13:44:57-05 : 6 | grp | 2012-01-19 13:45:05-05 | 2012-01-19 13:45:05-05 (2 rows) spaceschema=# select * from rhnpackagegroup where name = 'grp ' ; id | name | created | modified ----+------+------------------------+------------------------ 6 | grp | 2012-01-19 13:45:05-05 | 2012-01-19 13:45:05-05 (1 row)
The dump used to migrate from Oracle to PostgreSQL is: -- Types for rhnpackagegroup: DOUBLE PRECISION VARCHAR2 DATE DATE copy rhnpackagegroup(id,name,created,modified) from stdin; 1 NoGroup 2012-01-19 12:36:34 2012-01-19 12:36:34 4 Applications/Productivity 2012-01-19 13:34:29 2012-01-19 13:34:29 7 Unspecified\x0a 2012-01-19 13:45:43 2012-01-19 13:45:43 2 test\x0a 2012-01-19 12:52:03 2012-01-19 12:52:03 3 Applications/Productivity\x0a 2012-01-19 13:14:12 2012-01-19 13:14:12 5 grp\x0a 2012-01-19 13:44:57 2012-01-19 13:44:57 6 grp 2012-01-19 13:45:05 2012-01-19 13:45:05 8 Unspecified 2012-01-19 13:45:57 2012-01-19 13:45:57 \. Note that once it has \x0a, and once it has space after the group name.
An extra \n (\x0a) is a bug in RHEL5 rpm-python - see bug 783451. I added code to workaround this issue + data fix: commit c06105b1ca5395be47b9245fe04b980ca2e4200a 756918 - fix data for package_group commit 11989296652ad5620e3d799b65b31ddf5cfc00af 756918 - workaround for package_group issue
One more commit commit e8e976df476bc51ca95325f00c8d433428060dd7 756918 - fix data for package_group
Spacewalk 1.7 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes17