Project

Profile

Help

Issue #2170

closed

Getting a 500 instead of 400 when using a string in criteria instead of dict

Added by pthomas@redhat.com over 7 years ago. Updated almost 4 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
2.9.2
Platform Release:
OS:
RHEL 7
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Getting a 500 instead of 400 when using a string in criteria instead of dict

[root@tigger ~]# http --verify no --auth admin:admin POST https://localhost/pulp/api/v2/repositories/zoo1/actions/associate/ source_repo_id=zoo criteria='{'type_ids' : ['rpm'],'filters' : {'unit' : {'$and': [{'name': {'$regex': 'c*.*'}}, {'version': {'$gt': '1.0'}}] }}} }'
/usr/lib/python2.7/site-packages/urllib3/connectionpool.py:769: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
HTTP/1.1 500 INTERNAL SERVER ERROR
Connection: close
Content-Length: 1591
Content-Type: application/json; charset=utf-8
Date: Thu, 11 Aug 2016 17:36:31 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5

{
"_href": "/pulp/api/v2/repositories/zoo1/actions/associate/",
"error_message": "'str' object has no attribute 'pop'",
"exception": [
"AttributeError: 'str' object has no attribute 'pop'\n"
],
"http_request_method": "POST",
"http_status": 500,
"traceback": [
" File \"/usr/lib/python2.7/site-packages/django/core/handlers/base.py\", line 112, in get_response\n response = wrapped_callback(request, *callback_args, **callback_kwargs)\n",
" File \"/usr/lib/python2.7/site-packages/django/views/generic/base.py\", line 69, in view\n return self.dispatch(request, *args, **kwargs)\n",
" File \"/usr/lib/python2.7/site-packages/django/views/generic/base.py\", line 87, in dispatch\n return handler(request, *args, **kwargs)\n",
" File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/views/decorators.py\", line 241, in _auth_decorator\n return _verify_auth(self, operation, super_user_only, method, *args, **kwargs)\n",
" File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/views/decorators.py\", line 195, in _verify_auth\n value = method(self, *args, **kwargs)\n",
" File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/views/util.py\", line 130, in wrapper\n return func(*args, **kwargs)\n",
" File \"/usr/lib/python2.7/site-packages/pulp/server/webservices/views/repositories.py\", line 1159, in post\n criteria = UnitAssociationCriteria.from_client_input(criteria_body)\n",
" File \"/usr/lib/python2.7/site-packages/pulp/server/db/model/criteria.py\", line 260, in from_client_input\n type_ids = query.pop('type_ids', None)\n"
]
}

[root@tigger ~]#


Files

test.py (1.49 KB) test.py martin@hatchlane.com, 04/25/2016 04:37 PM

Related issues

Copied from Pulp - Issue #1863: Exception using regex in filters against associate endpointCLOSED - CURRENTRELEASEttereshcActions

Also available in: Atom PDF