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 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
Why does a repo group need to have a working directory?
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.
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.
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.
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.
https://github.com/pulp/pulp/pull/1641
Moved to https://pulp.plan.io/issues/696