Issue #696
closedPulpCodedException raised when deleting a repo group
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 +
Updated by ipanova@redhat.com over 8 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 +
Updated by dkliban@redhat.com over 8 years ago
Why does a repo group need to have a working directory?
+ This comment was cloned from Bugzilla #1192177 comment 2 +
Updated by bmbouter over 8 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 +
Updated by dkliban@redhat.com over 8 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 +
Updated by amacdona@redhat.com over 8 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 +
Updated by bmbouter over 8 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 +
Updated by dkliban@redhat.com over 8 years ago
https://github.com/pulp/pulp/pull/1641
+ This comment was cloned from Bugzilla #1192177 comment 7 +
Updated by bcourt over 8 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.
Updated by bmbouter over 8 years ago
- Triaged changed from No to Yes
- Severity set to Medium
Updated by dkliban@redhat.com over 8 years ago
- Status changed from MODIFIED to 5
Updated by igulina@redhat.com about 8 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
Updated by amacdona@redhat.com almost 8 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE