Bug 1398695 - API/CLI - ISE on Deleting proxy: Can't modify frozen hash
Summary: API/CLI - ISE on Deleting proxy: Can't modify frozen hash
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Foreman Proxy
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Andrew Kofink
QA Contact: Roman Plevka
URL:
Whiteboard:
: 1395110 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-25 15:46 UTC by Roman Plevka
Modified: 2019-04-01 20:26 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-02-21 16:54:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 17784 0 Normal Closed API/CLI - ISE on Deleting proxy: Can't modify frozen hash 2020-12-18 13:33:09 UTC

Description Roman Plevka 2016-11-25 15:46:29 UTC
Description of problem:
Server returning err500 - "Can't modify frozen hash" every time user deletes a capsule using cli or api.
The capsule seems to be removed anyway.

This is a regression in 6.3

Version-Release number of selected component (if applicable):
satellite-6.3.0-6.1.beta.el7sat.noarch

How reproducible:
always

Steps to Reproduce:
1. add a capsule (you can forward port 9090 of the stallite to some other port to simulate a different capsule):

ncat -kl -p 11018 -c "ncat sat63.com 9090 &" (you might need to set a proper selinux context for the ports or simply disable it)

hammer proxy create --name foo --url="https://sat63.com:11018"

2. use CLI or API to delete it:
# hammer -u admin -p changeme proxy delete --id 11
Could not delete the proxy:
  Can't modify frozen hash

or

$ curl -ku admin:changeme -X DELETE "https://sat63.com/api/v2/smart_proxies/11"
{
  "error": {"message":"Can't modify frozen hash"}
}

Actual results:
error returned:"Can't modify frozen hash" but proxy removed

Expected results:
no errors

Additional info:

Comment 2 Ohad Levy 2016-11-28 08:09:52 UTC
can you please attach logs?

Comment 4 Roman Plevka 2016-12-08 13:23:22 UTC
*** Bug 1395110 has been marked as a duplicate of this bug. ***

Comment 5 Andrew Kofink 2016-12-19 21:23:08 UTC
Created redmine issue http://projects.theforeman.org/issues/17784 from this bug

Comment 6 Andrew Kofink 2016-12-22 16:34:59 UTC
This occurs because we try to update the puppet_path attribute of a SmartProxy every time we read it, and upon deletion, the API responds with the object which has been deleted, thus calling puppet_path on the SmartProxy; however, Rails freezes the attribute hash of an object once it has been deleted, so we cannot modify this attribute.

Comment 7 Bryan Kearney 2017-01-03 19:20:46 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17784 has been resolved.

Comment 8 Roman Plevka 2017-09-27 20:10:40 UTC
VERIFIED
on sat6.3.0-17

API:

Making HTTP DELETE request to https://qe-sat63-rhel7..com/api/v2/smart_proxies/3 with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}}, no params and no data.
2017-09-26 06:44:07 - nailgun.client - DEBUG - Received HTTP 200 response: {"id":3,"name":"XoSTYkMwM","url":"https://qe-sat63-rhel7..com:14767","created_at":"2017-09-26T10:44:07.324Z","updated_at":"2017-09-26T10:44:07.324Z","pubkey":null,"expired_logs":"0","puppet_path":null,"download_policy":"on_demand"}
2017-09-26 06:44:07 - robottelo.ssh - DEBUG - Destroyed Paramiko client 0x7f7cb0889910
2017-09-26 06:44:07 - nailgun.client - DEBUG - Making HTTP GET request to https://qe-sat63-rhel7..com/api/v2/smart_proxies/3 with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}}, no params and no data.
2017-09-26 06:44:07 - nailgun.client - WARNING - Received HTTP 404 response: {
  "error": {"message":"Resource smart_proxy not found by id '3'"}
}

CLI:

2017-09-26 06:49:13 - robottelo.ssh - INFO - >>> LANG=en_US.UTF-8  hammer -v -u admin -p changeme  proxy delete --id="10"
2017-09-26 06:49:15 - robottelo.ssh - INFO - <<< stdout
Smart proxy deleted

Comment 9 Satellite Program 2018-02-21 16:54:17 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA.
> 
> For information on the advisory, and where to find the updated files, follow the link below.
> 
> If the solution does not work for you, open a new bug report.
> 
> https://access.redhat.com/errata/RHSA-2018:0336


Note You need to log in before you can comment on or make changes to this bug.