Bug 1092467 - An exception is raised when orphaned content is removed by type and id
Summary: An exception is raised when orphaned content is removed by type and id
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: API/integration
Version: unspecified
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 2.4.0
Assignee: Chris Duryee
QA Contact: Ina Panova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-29 11:33 UTC by Ina Panova
Modified: 2014-08-09 06:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-09 06:57:12 UTC
Embargoed:


Attachments (Terms of Use)

Description Ina Panova 2014-04-29 11:33:06 UTC
Description of problem:
An unhandled exception is raised when orphaned content is removed by type and id :

$ curl -H "Accept: application/json" -X POST  -k -u admin:admin -d '{[{'content_type_id': 'rpm', 'unit_id': 'd692be5f-f585-4e6d-b816-0285ffecd847'}]}' 'https://example.com/pulp/api/v2/content/actions/delete_orphans/' | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5960  100  5887  100    73   5962     73  0:00:01 --:--:--  0:00:01  5958
{
    "_href": "/pulp/api/v2/content/actions/delete_orphans/",
    "error_message": "Unhandled Exception",
    "exception": [
        "EncodeError: Can't pickle <type 'module'>: attribute lookup __builtin__.module failed\n"
    ],
    "http_request_method": "POST",
    "http_status": 500,
    "traceback": [
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/middleware/exception.py\", line 44, in __call__\n    return self.app(environ, start_response)\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/middleware/postponed.py\", line 42, in __call__\n    return self.app(environ, start_response)\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 279, in wsgi\n    result = self.handle_with_processors()\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 29, in _handle_with_processors\n    return process(self.processors)\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 26, in process\n    return p(lambda: process(processors))\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 566, in processor\n    return handler()\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 26, in <lambda>\n    return p(lambda: process(processors))\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 26, in process\n    return p(lambda: process(processors))\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 581, in processor\n    result = handler()\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 26, in <lambda>\n    return p(lambda: process(processors))\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 28, in process\n    return self.handle()\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 230, in handle\n    return self._delegate(fn, self.fvars, args)\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 422, in _delegate\n    return f()\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 430, in <lambda>\n    f = lambda: self._delegate_sub_application(pat, what)\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 455, in _delegate_sub_application\n    return app.handle_with_processors()\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 29, in _handle_with_processors\n    return process(self.processors)\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 26, in process\n    return p(lambda: process(processors))\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 566, in processor\n    return handler()\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 26, in <lambda>\n    return p(lambda: process(processors))\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 26, in process\n    return p(lambda: process(processors))\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 581, in processor\n    result = handler()\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 26, in <lambda>\n    return p(lambda: process(processors))\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py\", line 28, in process\n    return self.handle()\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 230, in handle\n    return self._delegate(fn, self.fvars, args)\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 405, in _delegate\n    return handle_class(f)\n",
        "  File \"/usr/lib/python2.7/site-packages/web/application.py\", line 396, in handle_class\n    return tocall(*args)\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/decorators.py\", line 227, in _auth_decorator\n    value = method(self, *args, **kwargs)\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/controllers/contents.py\", line 327, in POST\n    async_task = orphan.delete_orphans_by_id.apply_async((orphan,), tags=tags)\n",
        "  File \"/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py\", line 377, in apply_async\n    async_result = super(Task, self).apply_async(*args, **kwargs)\n",
        "  File \"/usr/lib/python2.7/site-packages/celery/app/task.py\", line 555, in apply_async\n    **dict(self._get_exec_options(), **options)\n",
        "  File \"/usr/lib/python2.7/site-packages/celery/app/base.py\", line 351, in send_task\n    reply_to=reply_to or self.oid, **options\n",
        "  File \"/usr/lib/python2.7/site-packages/celery/app/amqp.py\", line 305, in publish_task\n    **kwargs\n",
        "  File \"/usr/lib/python2.7/site-packages/kombu/messaging.py\", line 161, in publish\n    compression, headers)\n",
        "  File \"/usr/lib/python2.7/site-packages/kombu/messaging.py\", line 237, in _prepare\n    body) = dumps(body, serializer=serializer)\n",
        "  File \"/usr/lib/python2.7/site-packages/kombu/serialization.py\", line 164, in dumps\n    payload = encoder(data)\n",
        "  File \"/usr/lib64/python2.7/contextlib.py\", line 35, in __exit__\n    self.gen.throw(type, value, traceback)\n",
        "  File \"/usr/lib/python2.7/site-packages/kombu/serialization.py\", line 59, in _reraise_errors\n    reraise(wrapper, wrapper(exc), sys.exc_info()[2])\n",
        "  File \"/usr/lib/python2.7/site-packages/kombu/serialization.py\", line 55, in _reraise_errors\n    yield\n",
        "  File \"/usr/lib/python2.7/site-packages/kombu/serialization.py\", line 164, in dumps\n    payload = encoder(data)\n",
        "  File \"/usr/lib/python2.7/site-packages/kombu/serialization.py\", line 356, in pickle_dumps\n    return dumper(obj, protocol=pickle_protocol)\n"
    ]
}


Version-Release number of selected component (if applicable):
2.4.0-0.10.beta

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Michael Hrivnak 2014-05-01 16:00:24 UTC
Fix this, and also mark all other orphan removal API endpoints as deprecated.

Comment 2 Chris Duryee 2014-05-07 14:47:04 UTC
https://github.com/pulp/pulp/pull/945

Comment 3 Randy Barlow 2014-05-15 17:00:15 UTC
The fix for this bug is included in the pulp-2.4.0-0.14.beta builds.

Comment 4 Ina Panova 2014-05-26 12:34:07 UTC
Tested in 2.4.0-0.17.beta


$ curl -H "Accept: application/json" -X POST -k -u admin:admin -d '[{"content_type_id": "rpm", "unit_id": "d692be5f-f585-4e6d-b816-0285ffecd847"}]' 'https://example.com/pulp/api/v2/content/actions/delete_orphans/' | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   251  100   172  100    79    177     81 --:--:-- --:--:-- --:--:--   177
{
    "error": null,
    "result": null,
    "spawned_tasks": [
        {
            "_href": "/pulp/api/v2/tasks/08ed610f-ec35-4feb-b152-181f37da086f/",
            "task_id": "08ed610f-ec35-4feb-b152-181f37da086f"
        }
    ]
}

Moving to Verified.

Comment 5 Randy Barlow 2014-08-09 06:57:12 UTC
This has been fixed in Pulp 2.4.0-1.


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