Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1395110

Summary: Can't modify frozen hash error when trying to delete smart proxy via API/CLI
Product: Red Hat Satellite Reporter: Stanislav Tkachenko <stkachen>
Component: Foreman ProxyAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.3.0CC: abalakht, bbuckingham, jcallaha, rplevka
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-08 13:23:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stanislav Tkachenko 2016-11-15 08:03:57 UTC
Description of problem:
"Can't modify frozen hash" error is raised when trying to delete smart proxy via API or hammer, though proxy itself is deleted.
Works correctly via UI.

Example:
# Create using hammer
> # hammer -v -u admin -p changeme --output=csv proxy create --url="https://sat6.com:12370" --name="test"
> Message,Id,Name
> Smart proxy created,7,test

# Read info
> # hammer -v -u admin -p changeme proxy info --name="test"
> Id:            7
> Name:          test
> URL:           https://sat6.com:12370

# Try to delete via hammer
> # hammer -v -u admin -p changeme proxy delete --name="test"      
> [ERROR 2016-11-15 02:48:39 API] 500 Internal Server Error
> [ERROR 2016-11-15 02:48:39 Exception] Can't modify frozen hash
> Could not delete the proxy:
>  Can't modify frozen hash
> [ERROR 2016-11-15 02:48:39 Exception] 
> RestClient::InternalServerError (500 Internal Server Error):

# Read info one more time
> # hammer -v -u admin -p changeme proxy info --name="test"  
> [ERROR 2016-11-15 02:49:45 Exception] Error: smart_proxy not found
> Error: smart_proxy not found
> [ERROR 2016-11-15 02:49:45 Exception] 
> HammerCLIForeman::ResolverError (smart_proxy not found):

# Try to delete another proxy via API
> Making HTTP DELETE request to https://sat6.com/api/v2/smart_proxies/8 with options {'verify': False, 'auth': ('admin', 'changeme'), 'headers': {'content-type': 'application/json'}} and no data.
> Received HTTP 500 response: {
>  "error": {"message":"Can't modify frozen hash"}


Version-Release number of selected component (if applicable):
Satellite 6.3.0 Snap 6.0, Foreman 1.13.1-1

How reproducible:
Always

Steps to Reproduce:
1. ncat -kl -p 12370 -c "ncat sat6.com 9090"
2. hammer -v -u admin -p changeme --output=csv proxy create --url="https://sat6.com:12370" --name="test"
3. hammer -v -u admin -p changeme proxy info --name="test"
4. hammer -v -u admin -p changeme proxy delete --name="test"
5. hammer -v -u admin -p changeme proxy info --name="test"

Actual results:
Error and stacktrace are displayed.

Expected results:
Proxy should be deleted without errors.

Additional info:

Comment 3 Roman Plevka 2016-12-08 13:23:22 UTC
Closing this in favor of https://bugzilla.redhat.com/show_bug.cgi?id=1398695 (despite the fact that this one is older, the newer one contains more info + has the correct flags set)

*** This bug has been marked as a duplicate of bug 1398695 ***