Project

Profile

Help

Issue #2170

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

Added by pthomas@redhat.com about 4 years ago. Updated 3 months 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 ~]#

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 - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by pthomas@redhat.com about 4 years ago

  • Copied from Issue #1863: Exception using regex in filters against associate endpoint added

#2 Updated by amacdona@redhat.com about 4 years ago

  • Severity changed from 2. Medium to 1. Low
  • Triaged changed from No to Yes

#3 Updated by bmbouter over 1 year ago

  • Status changed from NEW to CLOSED - WONTFIX

#4 Updated by bmbouter over 1 year 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.

#5 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

#6 Updated by bmbouter 3 months ago

  • Category deleted (14)

We are removing the 'API' category per open floor discussion June 16, 2020.

Please register to edit this issue

Also available in: Atom PDF