Bug 756918 - "Diff: [['package_group', 5, 6], ['cookie', '', 'None']]" when re-pushing package
Summary: "Diff: [['package_group', 5, 6], ['cookie', '', 'None']]" when re-pushing pac...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 1.6
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Jan Pazdziora
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks: space17
TreeView+ depends on / blocked
 
Reported: 2011-11-25 06:43 UTC by Jan Hutař
Modified: 2012-03-07 09:55 UTC (History)
2 users (show)

Fixed In Version: spacewalk-backend-1.7.7-1 spacewalk-schema-1.7.20-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-03-07 09:55:23 UTC


Attachments (Terms of Use)

Description Jan Hutař 2011-11-25 06:43:55 UTC
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

Comment 2 Jan Pazdziora 2011-12-16 14:29:12 UTC
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.

Comment 3 Jan Pazdziora 2011-12-16 15:21:42 UTC
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.

Comment 5 Milan Zázrivec 2011-12-22 16:50:40 UTC
Spacewalk 1.6 has been released.

Comment 6 Jan Pazdziora 2012-01-20 09:29:20 UTC
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)

Comment 7 Jan Pazdziora 2012-01-20 09:31:23 UTC
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.

Comment 8 Michael Mráka 2012-01-23 10:19:18 UTC
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

Comment 9 Michael Mráka 2012-01-25 12:40:18 UTC
One more commit
commit e8e976df476bc51ca95325f00c8d433428060dd7
    756918 - fix data for package_group

Comment 10 Jan Pazdziora 2012-03-07 09:55:23 UTC
Spacewalk 1.7 has been released:

https://fedorahosted.org/spacewalk/wiki/ReleaseNotes17


Note You need to log in before you can comment on or make changes to this bug.