Project

Profile

Help

Issue #696

PulpCodedException raised when deleting a repo group

Added by amacdona@redhat.com over 6 years ago. Updated over 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Description of problem:

When trying to delete a repo group, the following exception is raised:

PulpCodedException: Working Directory requested outside of asynchronous task.

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

Probably a regression, new in master.

How reproducible:

Always

Steps to Reproduce:

1. Create a repo group

$ pulp-admin repo group create --group-id new_group
Repository Group [new_group] successfully created

2.Try to delete it

$ pulp-admin repo group delete --group-id new_group
An internal error occurred on the Pulp server:
RequestException: DELETE request
on /pulp/api/v2/repo_groups/new_group/ failed with 500 - Working Directory
requested outside of asynchronous task. 

Actual results:

An internal error occurred on the Pulp server:
RequestException: DELETE request
on /pulp/api/v2/repo_groups/new_group/ failed with 500 - Working Directory
requested outside of asynchronous task. 

Expected results:

Successful delete.

Additional info:

Problem occurs in server/pulp/server/managers/repo/group/cud.py, line 171. This delete should be taking place asynchronously in a task, rather than synchronously.

+ This bug was cloned from Bugzilla Bug #1192177 +

History

#1 Updated by ipanova@redhat.com over 6 years ago

this commit introduced the issue https://github.com/pulp/pulp/commit/8e351dc49345b2f022f1e26b0b39c5227609a74a

Deletion of repo_group and consumer_group should be a synchronous call, at least it was so time ago. Plus docs confirm that also http://pulp.readthedocs.org/en/latest/dev-guide/integration/rest-api/repo/groups/cud.html#delete-a-repository-group

+ This comment was cloned from Bugzilla #1192177 comment 1 +

#2 Updated by dkliban@redhat.com over 6 years ago

Why does a repo group need to have a working directory?

+ This comment was cloned from Bugzilla #1192177 comment 2 +

#3 Updated by bmbouter over 6 years ago

I can't think of why it would need a working directory. If we can remove the manager's usage of the working directory that would be the best fix for this.

+ This comment was cloned from Bugzilla #1192177 comment 3 +

#4 Updated by dkliban@redhat.com over 6 years ago

I am going to fix this bug, by removing the code that tries to delete the working directory. Now that the working directories are cleaned up after tasks finish running, I don't think it's necessary to worry about deleting them elsewhere.

+ This comment was cloned from Bugzilla #1192177 comment 4 +

#5 Updated by amacdona@redhat.com over 6 years ago

Agreed. And after the working directory code is removed, the bug should be modified to make this delete asynchronous and given a target of 3.0.

+ This comment was cloned from Bugzilla #1192177 comment 5 +

#6 Updated by bmbouter over 6 years ago

I don't think the goal is to make delete asynchronous. It can be a synchronous since its just some simple mongo bookkeeping. It should return very quickly. I recommend fixing it as discussed and then sending it to QA.

+ This comment was cloned from Bugzilla #1192177 comment 6 +

#8 Updated by bcourt over 6 years ago

If a repo group supports custom distributors, then deleting the repo group could involve updates to the filesystem which probably should not be done synchronously.

#9 Updated by bmbouter over 6 years ago

  • Triaged changed from No to Yes
  • Severity set to Medium

#10 Updated by bmbouter over 6 years ago

  • Severity changed from Medium to 2. Medium

#11 Updated by dkliban@redhat.com over 6 years ago

  • Platform Release set to 2.7.0

#12 Updated by dkliban@redhat.com about 6 years ago

  • Status changed from MODIFIED to 5

#13 Updated by igulina@redhat.com about 6 years ago

  • Status changed from 5 to 6
>>rpm -qa pulp-server
pulp-server-2.7.0-0.4.beta.el7.noarch

Deleting a group without members:

>> pulp-admin repo group create --group-id banda
Repository Group [banda] successfully created

>>  pulp-admin repo group delete --group-id banda
Repository group [banda] successfully deleted

Deleting nonempty group:

pulp-admin repo group list
+----------------------------------------------------------------------+
                           Repository Groups
+----------------------------------------------------------------------+

Id:           zoo_banda
Display Name: None
Description:  None
Repo Ids:     zoopark, panda
Notes:        

>> pulp-admin repo group delete --group-id zoo_banda
Repository group [zoo_banda] successfully deleted

Deleting nonexisting group:

>> pulp-admin repo group delete --group-id no_such_group
Repository group [no_such_group] does not exist on the server

And one more test:

>> pulp-admin repo group create --group-id zoo_group
Repository Group [zoo_group] successfully created
>>  pulp-admin repo group members add --group-id zoo_group --all
Successfully added members to repository group [zoo_group]
>> pulp-admin rpm repo delete --repo-id panda
This command may be exited via ctrl+c without affecting the request.

[\]
Running...

Repository [panda] successfully deleted

>> pulp-admin repo group delete --group-id zoo_group
Repository group [zoo_group] successfully deleted

And API:

>> pulp-admin repo group create --group-id my_repo_group
Repository Group [my_repo_group] successfully created

>> curl -i -H \"Accept: application/json\" -X DELETE -k -u admin:admin   'https://localhost/pulp/api/v2/repo_groups/my_repo_group/'
curl: (6) Could not resolve host: application; Name or service not known
HTTP/1.1 200 OK
Date: Tue, 07 Jul 2015 16:13:14 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 4
Content-Type: application/json

null

>> pulp-admin repo group list
+----------------------------------------------------------------------+
                           Repository Groups
+----------------------------------------------------------------------+

No repository groups found

#14 Updated by amacdona@redhat.com over 5 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#16 Updated by bmbouter over 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF