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 +
Merge pull request #668 from bmbouter/693-delete-all-docs-except-index
Deletes all docs so users will see the warning banner