Issue #668
closed500 error is raised when attempting to create consumer group with already existing id
Description
Description of problem:
- pulp-admin -u admin -p admin rpm consumer group list
----------------------------------------------------------------------
Consumer Groups
-------------------------------------------------------------------- - curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"id":"new-group"}' 'https://localhost/pulp/api/v2/consumer_groups/'
HTTP/1.1 201 Created
Date: Fri, 16 Jan 2015 18:00:43 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Location: /pulp/api/v2/consumer_groups/new-group/
Content-Length: 238
Content-Type: application/json
{"scratchpad": null, "display_name": null, "description": null, "_ns": "consumer_groups", "notes": {}, "consumer_ids": [], "_id": {"$oid": "54b951cba629d30aa9e1aca9"}, "id": "new-group", "_href": "/pulp/api/v2/consumer_groups/new-group/"}
- curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"id":"new-group"}' 'https://localhost/pulp/api/v2/consumer_groups/'
HTTP/1.1 500 Internal Server Error
Date: Fri, 16 Jan 2015 18:00:47 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Length: 527
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at
root@localhost to inform them of the time this error occurred,
and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
</body></html>
- pulp-admin -u admin -p admin rpm consumer group create --group-id new-group
There was an internal server error while trying to access the Pulp application.
One possible cause is that the database needs to be migrated to the latest
version. If this is the case, run pulp-manage-db and restart the services. More
information may be found in Apache's log.
- pulp-admin -u admin -p admin rpm consumer group list
----------------------------------------------------------------------
Consumer Groups
--------------------------------------------------------------------
Id: new-group
Display Name: None
Description: None
Consumer Ids:
Notes:
Version-Release number of selected component (if applicable):
2.6.0-0.4.beta
How reproducible:
always
Steps to Reproduce:
1. create consumer group
2. create consumer group with same id
3.
Actual results:
Expected results:
409/duplicate of resource
Additional info:
from apache log;
[Fri Jan 16 18:01:03.755795 2015] [:error] [pid 2731] [remote 54.246.34.239:196] Traceback (most recent call last):
[Fri Jan 16 18:01:03.755817 2015] [:error] [pid 2731] [remote 54.246.34.239:196] File "/usr/lib/python2.7/site-packages/pulp/server/webservices/middleware/exception.py", line 50, in call
[Fri Jan 16 18:01:03.755854 2015] [:error] [pid 2731] [remote 54.246.34.239:196] response['error'] = e.to_dict()
[Fri Jan 16 18:01:03.755869 2015] [:error] [pid 2731] [remote 54.246.34.239:196] File "/usr/lib/python2.7/site-packages/pulp/server/exceptions.py", line 45, in to_dict
[Fri Jan 16 18:01:03.755892 2015] [:error] [pid 2731] [remote 54.246.34.239:196] result['sub_errors'].append(error.to_dict())
[Fri Jan 16 18:01:03.755906 2015] [:error] [pid 2731] [remote 54.246.34.239:196] File "/usr/lib/python2.7/site-packages/pulp/server/exceptions.py", line 39, in to_dict
[Fri Jan 16 18:01:03.755927 2015] [:error] [pid 2731] [remote 54.246.34.239:196] 'description': str(self),
[Fri Jan 16 18:01:03.755940 2015] [:error] [pid 2731] [remote 54.246.34.239:196] File "/usr/lib/python2.7/site-packages/pulp/server/exceptions.py", line 95, in str
[Fri Jan 16 18:01:03.755973 2015] [:error] [pid 2731] [remote 54.246.34.239:196] msg = self.error_code.message % self.error_data
[Fri Jan 16 18:01:03.755997 2015] [:error] [pid 2731] [remote 54.246.34.239:196] ValueError: unsupported format character 'a' (0x61) at index 26
+ This bug was cloned from Bugzilla Bug #1183119 +
Updated by ipanova@redhat.com about 9 years ago
- Status changed from ASSIGNED to POST
Updated by ipanova@redhat.com about 9 years ago
- Status changed from POST to MODIFIED
Updated by dkliban@redhat.com about 9 years ago
- Status changed from MODIFIED to 5
Updated by igulina@redhat.com about 9 years ago
- Status changed from 5 to 6
rpm -qa pulp-server
pulp-server-2.6.0-0.7.beta.el6.noarch
pulp-admin -u admin -p admin rpm consumer group list
--------------------------------------------------------------------
Consumer Groups
--------------------------------------------------------------------
curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"id":"bobik-banda"}' 'https://localhost/pulp/api/v2/consumer_groups/'
HTTP/1.1 201 Created
Date: Mon, 16 Mar 2015 10:48:35 GMT
Server: Apache/2.2.15 (Red Hat)
Location: /pulp/api/v2/consumer_groups/bobik-banda/
Content-Length: 242
Connection: close
Content-Type: application/json
{"scratchpad": null, "display_name": null, "description": null, "_ns": "consumer_groups", "notes": {}, "consumer_ids": [], "_id": {"$oid": "5506b5049166d81f4b8422cf"}, "id": "bobik-banda", "_href": "/pulp/api/v2/consumer_groups/bobik-banda/"}
curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"id":"bobik-banda"}' 'https://localhost/pulp/api/v2/consumer_groups/'
HTTP/1.1 500 Internal Server Error
Date: Mon, 16 Mar 2015 10:48:43 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Length: 611
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator,
root@localhost and inform them of the time the error occurred,
and anything you might have done that may have
caused the error.</p>
<p>More information about this error may be available
in the server error log.</p>
<hr>
<address>Apache/2.2.15 (Red Hat) Server at localhost Port 443</address>
</body></html>
yum update
....
rpm -qa pulp-server
pulp-server-2.6.0-0.9.rc.el6.noarch
curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X POST -k -u admin:admin -d '{"id":"bobik-banda"}' 'https://localhost/pulp/api/v2/consumer_groups/'
HTTP/1.1 409 Conflict
Date: Mon, 16 Mar 2015 11:04:11 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Encoding: utf-8
Content-Length: 351
Connection: close
Content-Type: application/json
{"error": {"code": "PLP0018", "data": {"resource_id": "bobik-banda"}, "description": "Duplicate resource: bobik-banda", "sub_errors": []}, "http_request_method": "POST", "exception": null, "error_message": "Duplicate resource: bobik-banda", "_href": "/pulp/api/v2/consumer_groups/", "http_status": 409, "resource_id": "bobik-banda", "traceback": null}
pulp-admin -u admin -p admin rpm consumer group create --group-id bobik-banda
A resource with the ID "bobik-banda" already exists.
var/log/messages:
Mar 16 07:05:23 ip-XXX pulp: pulp.server.webservices.middleware.exception:INFO: Duplicate resource: bobik-banda
var/log/httpd/ssl_access_log:
::1 - - [16/Mar/2015:06:48:35 0400] "POST /pulp/api/v2/consumer_groups/ HTTP/1.1" 201 242 - [16/Mar/2015:07:05:23 -0400] "POST /pulp/api/v2/consumer_groups/ HTTP/1.1" 409 351
::1 - - [16/Mar/2015:06:48:43 -0400] "POST /pulp/api/v2/consumer_groups/ HTTP/1.1" 500 611
XXX - - [16/Mar/2015:06:58:40 -0400] "POST /pulp/api/v2/consumers/gena.be/profiles/ HTTP/1.1" 201 98551
::1 - - [16/Mar/2015:07:04:11 -0400] "POST /pulp/api/v2/consumer_groups/ HTTP/1.1" 409 351
XXX
~
Added by bmbouter about 9 years ago
Updated by rbarlow about 9 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE
Updated by bmbouter almost 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.
Merge pull request #668 from bmbouter/693-delete-all-docs-except-index
Deletes all docs so users will see the warning banner