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: CapsuleAssignee: 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:

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 ***