Bug 1192177 - PulpCodedException raised when deleting a repo group
Summary: PulpCodedException raised when deleting a repo group
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: async/tasks
Version: Master
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Dennis Kliban
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-12 18:54 UTC by amacdona@redhat.com
Modified: 2015-02-28 23:23 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 23:23:45 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 696 0 None None None Never

Description amacdona@redhat.com 2015-02-12 18:54:03 UTC
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.

Comment 1 Ina Panova 2015-02-12 19:19:09 UTC
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

Comment 2 Dennis Kliban 2015-02-12 19:24:33 UTC
Why does a repo group need to have a working directory?

Comment 3 Brian Bouterse 2015-02-12 19:27:27 UTC
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.

Comment 4 Dennis Kliban 2015-02-12 19:34:46 UTC
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.

Comment 5 amacdona@redhat.com 2015-02-12 19:38:53 UTC
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.

Comment 6 Brian Bouterse 2015-02-12 19:43:02 UTC
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.

Comment 7 Dennis Kliban 2015-02-12 20:29:18 UTC
https://github.com/pulp/pulp/pull/1641

Comment 8 Brian Bouterse 2015-02-28 23:23:45 UTC
Moved to https://pulp.plan.io/issues/696


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