Project

General

Custom queries

Profile

Actions

Bug #4092

closed

HTTP 400 Bad Request when deleting a system via the API

Added by Katello Issue Migration about 11 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I'm running katello headpin nightly:
[root@ec2-107-22-80-187 ~]# rpm -q katello-headpin-all
katello-headpin-all-1.4.2-1.git.199.3b8bdb1.el6.noarch

We're making a call like so using the katello python client:
self.systemapi.unregister(consumer_uuid)

This returns:
katello.client.server.ServerRequestError: (400, {u'displayMessage': u'Consumer fb6ba503-ff5e-4443-bd95-97fd4a0ff1de has been deleted', u'errors': [u'Consumer fb6ba503-ff5e-4443-bd95-97fd4a0ff1de has been deleted'], u'deletedId': u'fb6ba503-ff5e-4443-bd95-97fd4a0ff1de'}, None)

The consumer definitely existed before calling unregister.

Katello is kind of in an unusable state after this because the consumer has indeed been deleted from the candlepin database, but not the katello database.

candlepin db:
candlepin=> select count(*) from cp_consumer; count
-------
99
(1 row)

candlepin=> select * from cp_consumer where uuid='fb6ba503-ff5e-4443-bd95-97fd4a0ff1de';
id | created | updated | autoheal | entitlementstatus | lastcheckin | name | se
rvicelevel | username | uuid | environment_id | consumer_idcert_id | keypair_id | owner_id | type_id | releasever
----+---------+---------+----------+-------------------+-------------+------+---
-----------+----------+------+----------------+--------------------+------------
-----------------+------------
(0 rows)

katello db:
katelloschema=> select count(*) from systems; count
-------
100
(1 row)

katelloschema=> select * from systems where uuid='fb6ba503-ff5e-4443-bd95-97fd4a0ff1de';
id | uuid | name | description | location | environment_id | created_at | updated_
at | type | content_view_id
-----+--------------------------------------+----------+------------------------
-----+----------+----------------+----------------------------+-----------------
-----------+--------+-----------------
101 | fb6ba503-ff5e-4443-bd95-97fd4a0ff1de | system-1 | Initial Registration Pa
rams | None | 3 | 2013-05-07 17:52:45.100739 | 2013-05-07 17:52
:45.100739 | System |
(1 row)

This indiscrepancy also causes an error when going to Systems in the web ui:
Resources::Candlepin::CandlepinResource: 410 Gone {"displayMessage":"Consumer fb6ba503-ff5e-4443-bd95-97fd4a0ff1de has been deleted","deletedId":"fb6ba503-ff5e-4443-bd95-97fd4a0ff1de"} (GET /candlepin/consumers/fb6ba503-ff5e-4443-bd95-97fd4a0ff1de/compliance) (RestClient::Gone) {"displayMessage":"Consumer fb6ba503-ff5e-4443-bd95-97fd4a0ff1de has been deleted","deletedId":"fb6ba503-ff5e-4443-bd95-97fd4a0ff1de"}

I don't see anything related in any katello logs (that I could find).

Created: slagle on May 07, 2013 19:30 +00:00
Imported from https://api.github.com/repos/Katello/katello/issues/2210

Actions #1

Updated by Bryan Kearney about 11 years ago

  • Status changed from New to Rejected
Actions #2

Updated by Eric Helms almost 11 years ago

  • Triaged set to Yes
Actions #3

Updated by Eric Helms over 10 years ago

  • Translation missing: en.field_release set to 13
Actions #4

Updated by Pavel Studeník over 10 years ago

I have same problem, only other message.

ERROR:root:400 <function get at 0x1f84320> /katello/api/organizations/1/systems?per_page=100
ERROR:root:{"displayMessage":"Katello::Resources::Candlepin::Consumer: 410 Gone {\"displayMessage\":\"Unit b1b22286-e5fa-45e5-94e5-a4f4b6296101 has been deleted\",\"requestUuid\":\"24f54df7-89e7-49df-9315-80ba94decc44\",\"deletedId\":\"b1b22286-e5fa-45e5-94e5-a4f4b6296101\"} (GET /candlepin/consumers/b1b22286-e5fa-45e5-94e5-a4f4b6296101)","errors":["Katello::Resources::Candlepin::Consumer: 410 Gone {\"displayMessage\":\"Unit b1b22286-e5fa-45e5-94e5-a4f4b6296101 has been deleted\",\"requestUuid\":\"24f54df7-89e7-49df-9315-80ba94decc44\",\"deletedId\":\"b1b22286-e5fa-45e5-94e5-a4f4b6296101\"} (GET /candlepin/consumers/b1b22286-e5fa-45e5-94e5-a4f4b6296101)"]}

Actions #5

Updated by Bryan Kearney about 10 years ago

  • Status changed from Rejected to New
Actions #6

Updated by Eric Helms over 9 years ago

  • Status changed from New to Resolved
  • Translation missing: en.field_release deleted (13)

Given we aren't seeing reports of this in latest, I am moving to resolved, please re-open with new tracebacks if you see it in 2.4+

Actions #7

Updated by Eric Helms almost 9 years ago

  • Translation missing: en.field_release set to 166
Actions

Also available in: Atom PDF