Bug 752195 - 'pulp-admin repo sync' fails on resyncing repositories which have removed content, and preserve_metadata set to true.
Summary: 'pulp-admin repo sync' fails on resyncing repositories which have removed con...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: unspecified
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
: ---
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-08 19:33 UTC by Ernest W. Durbin III
Modified: 2013-09-09 16:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-02-24 20:13:12 UTC


Attachments (Terms of Use)

Description Ernest W. Durbin III 2011-11-08 19:33:45 UTC
Description of problem:
    running pulp-admin repo sync against a repository which has removed/replaced content raises an exception and stops cold when preserve_metadata is set to 'True'.

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

How reproducible:
    Perfectly

Steps to Reproduce:
1. Sync a repository which removes/replaces content with the perserve_metadata flag set to true
2. Wait until repository has replaced or removed content
3. Try to sync the repository once more.
  
Actual results:

At the command line:
PulpException: Metadata for repo [repository-id] is set to be preserved. Cannot remove new content

In /var/log/pulp/pulp.log
2011-11-08 14:21:25,208 13173:140249355228928: pulp.server.api.synchronizers:INFO: synchronizers:275 Skipping errata imports from sync process
2011-11-08 14:21:25,212 13173:140249355228928: pulp.server.api.repo_sync:INFO: repo_sync:263 Sync returned 81 packages, 0 errata in 20.8483200073 seconds
2011-11-08 14:21:30,030 13173:140249355228928: pulp.server.api.repo_sync:INFO: repo_sync:274 81 old packages to process, 81 new packages to process
2011-11-08 14:21:30,034 13173:140249355228928: pulp.server.api.repo:INFO: repo:956 Metadata for repo [redhat-cdh-3] is set to be preserved. Cannot remove new content
2011-11-08 14:21:30,039 13173:140249355228928: pulp.server.tasking.task:ERROR: task:455 Task failed: Task cd19d18a-0a3e-11e1-a635-00137254a118: _sync(redhat-cdh-3, synchronizer=<pulp.server.api.synchronizers.YumSynchronizer object at 0x7f8e95f01e10>, skip_dict={}, max_speed=None, threads=None, progress_callback=<bound method RepoSyncTask.progress_callback of <pulp.server.api.repo_sync_task.RepoSyncTask object at 0x7f8e95f01590>>)
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/tasking/task.py", line 404, in run
    result = self.callable(*self.args, **self.kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/api/repo_sync.py", line 277, in _sync
    repo_api.remove_packages(repo["id"], old_pkgs)
  File "/usr/lib/python2.7/site-packages/pulp/server/api/repo.py", line 957, in remove_packages
    raise PulpException(msg)
PulpException: Metadata for repo [redhat-cdh-3] is set to be preserved. Cannot remove new content

Expected results:
Yo! found you new rpms! Toss them dirty old ones out.

Additional info:

Comment 1 Pradeep Kilambi 2011-11-08 19:57:19 UTC
fixed! commit 69e2d0d6e3f4135e1af59db8a63992a21a5a9fb2

Comment 2 Jay Dobies 2011-11-09 20:32:05 UTC
Fixed in build 0.247.

Comment 3 Preethi Thomas 2012-01-09 14:30:29 UTC
verified

[root@preethi ~]# pulp-admin repo sync --id=rhel6_x86_64_preserve -F
Sync for repository rhel6_x86_64_preserve started
Sync: Finished
4/6710 new items downloaded
6706/6710 existing items processed

Item Details: 
RPMs: 6710/6710

[root@preethi ~]# pulp-admin repo info --id=rhel6_x86_64_preserve 

Id                 	rhel6_x86_64_preserve    
Name               	rhel6_x86_64_preserve    
Repo URL           	https://preethi.usersys.redhat.com/pulp/repos/content/dist/rhel/rhui/server-6/updates/6Server/x86_64/os/
Feed URL           	https://cdn.redhat.com/content/dist/rhel/rhui/server-6/updates/6Server/x86_64/os/
Feed Type          	remote                   
Content Type       	yum                      
Feed Certs         	CA:Yes   Cert:Yes
Consumer Certs     	CA:No   Cert:No
Architecture       	noarch                   
Sync Schedule      	None                     
Packages           	6710                     
Files              	0                        
Distributions      	None                     
Publish            	True                     
Clones             	[]                       
Groups             	None                     
Filters            	[]                       
Notes              	{}                       
Preserve Metadata  	True                     
Checksum Type      	sha256

Comment 4 Preethi Thomas 2012-02-24 20:13:12 UTC
Pulp v1.0 is released
Closed Current Release.


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