Issue #2170
closedGetting a 500 instead of 400 when using a string in criteria instead of dict
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
Related issues
Updated by pthomas@redhat.com almost 8 years ago
- Copied from Issue #1863: Exception using regex in filters against associate endpoint added
Updated by amacdona@redhat.com almost 8 years ago
- Severity changed from 2. Medium to 1. Low
- Triaged changed from No to Yes
Updated by bmbouter over 5 years ago
- Status changed from NEW to CLOSED - WONTFIX
Updated by bmbouter over 5 years ago
Pulp 2 is approaching maintenance mode, and this Pulp 2 ticket is not being actively worked on. As such, it is being closed as WONTFIX. Pulp 2 is still accepting contributions though, so if you want to contribute a fix for this ticket, please reopen or comment on it. If you don't have permissions to reopen this ticket, or you want to discuss an issue, please reach out via the developer mailing list.
Updated by bmbouter about 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.