Bug 784346 - repo delete failure
Summary: repo delete failure
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 1.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Pradeep Kilambi
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-24 16:10 UTC by Preethi Thomas
Modified: 2013-09-09 16:33 UTC (History)
1 user (show)

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


Attachments (Terms of Use)

Description Preethi Thomas 2012-01-24 16:10:28 UTC
Description of problem:
I create a repo with wrong feed. The repo failed to sync. Now I deleted repo and create another repo with the same name with a valid feed and synced. Now if I tried to delete the repo repo delete fails.

I had to repeat it a couple of times.

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


How reproducible:


Steps to Reproduce:
1. create a repo test with a wrong feed and sync
2. Delete the repo 
3. Create a repo with the same name (test) with a valid feed.
4. Sync the repo
5. delete the repo (see in pulp.log)
6. Repeat step  1-5 again and see in pulp.log
  
Actual results:

Repo being deleted message

Expected results:
2012-01-24 11:18:21,206 11740:140452267288320: pulp.server.tasking.task:ERROR: task:455 Task failed: Task 08607e33-46a7-11e1-8980-002564a85a58: RepoApi.delete(test2, )
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.py", line 560, in delete
    self._delete_published_link(repo)
  File "/usr/lib/python2.7/site-packages/pulp/server/api/repo.py", line 383, in _delete_published_link
    os.unlink(link_path)
OSError: [Errno 21] Is a directory: '/var/lib/pulp/published/repos/repos/pulp/pulp/6Server'


Additional info:

Comment 1 Pradeep Kilambi 2012-01-27 21:42:55 UTC
commit 6080f631541208858c9040d9fc4081cbfd9c04c3

Make sure you clean up /var/lib/pub/published dir with any empty dir before running your test. 


the issue is not any two repos, its overlapping feed relativepaths and the way delete cleans up published dirs. When we delete today we remove the symlink, but dont remove empty dirs from published dirs. So /var/lib/pulp/published/repos/repos/pulp/pulp/testing/fedora-16/ if left as it is. The fix is to make sure unpublish during delete removes those dirs after unlinking.

Comment 2 Jeff Ortel 2012-01-27 22:27:42 UTC
build: 0.263

Comment 3 Jeff Ortel 2012-02-01 21:35:21 UTC
build: 0.264

Comment 4 Preethi Thomas 2012-02-02 18:23:58 UTC
verified


[root@preethi ~]# rpm -q pulp
pulp-0.0.264-1.fc15.noarch

[root@preethi ~]# pulp-admin repo delete  --id test1 Repository [ test1 ] being deleted

[root@preethi ~]# pulp-admin repo create  --id test1 --feed=http://repos.fedorapeople.org/repos/pulp/pulp/testing/6Server/x86_64/
Successfully created repository [ test1 ]

[root@preethi ~]# pulp-admin repo sync  --id test1 -FSync for repository test1 started
Sync: Finished
20/20 new items downloaded
0/20 existing items processed

Item Details: 
RPMs: 20/20

[root@preethi ~]# pulp-admin repo delete  --id test1 Repository [ test1 ] being deleted

[root@preethi ~]# rpm -q pulp
pulp-0.0.264-1.fc15.noarch

Comment 5 Preethi Thomas 2012-02-24 20:11:01 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.