| Summary: | hammer: apparently cannot delete proxy via --name | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Corey Welton <cwelton> |
| Component: | Provisioning | Assignee: | jmagen <jmagen> |
| Status: | CLOSED WORKSFORME | QA Contact: | Tazim Kolhar <tkolhar> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.0.2 | CC: | asaleh, cwelton, dcleal, skottler, tkolhar |
| Target Milestone: | Unspecified | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://projects.theforeman.org/issues/3524 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-05-26 17:56:04 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
Corey Welton
2013-10-24 17:41:15 UTC
Satellite-6.0.2-RHEL-6-20131023.1 Could you provide /var/log/foreman/production.log please? I hope we'll see the request causing the 404 there. I can't reproduce this with upstream Foreman and Hammer at the moment.
[root@rhel6b ~]# hammer proxy delete --name test
Smart proxy deleted
[root@rhel6b ~]# tail -5 /var/log/foreman/production.log
Started DELETE "/api/smart_proxies/test" for ::1 at 2013-10-25 11:12:58 +0000
Processing by Api::V1::SmartProxiesController#destroy as JSON
Parameters: {"id"=>"test", "smart_proxy"=>{}}
Authorized user admin(Admin User)
Completed 200 OK in 35ms (Views: 0.6ms | ActiveRecord: 0.0ms)
foreman-1.3.0-1.el6.noarch
rubygem-foreman_api-0.1.7-1.el6.noarch
rubygem-hammer_cli-0.0.7-1.el6.noarch
rubygem-hammer_cli_foreman-0.0.8-1.el6.noarch
Got it, the bug's in the API when the proxy name contains a ".", which it will if it's an FQDN. As a workaround, use the ID or web UI. Fixed in develop in 78ced7bb10d0324db16b2a19851d228fb6dfc61c. # hammer proxy list ---|---------------------------------------------|--------------------------------------------------------- ID | NAME | URL ---|---------------------------------------------|--------------------------------------------------------- 1 | ibm-x3650m4-01-vm-16.lab.eng.bos.redhat.com | https://ibm-x3650m4-01-vm-16.lab.eng.bos.redhat.com:9090 ---|---------------------------------------------|--------------------------------------------------------- # hammer proxy delete --name ibm-x3650m4-01-vm-16.lab.eng.bos.redhat.com Could not delete the proxy: ERROR: update or delete on table "smart_proxies" violates foreign key constraint "hosts_puppet_ca_proxy_id_fk" on table "hosts" DETAIL: Key (id)=(1) is still referenced from table "hosts". Failed Tazim, the error you are getting is different than the original bug which was fixed in develop in 78ced7bb10d0324db16b2a19851d228fb6dfc61c This "new" bug is that it's not giving the correct error message and it's now fixed in https://github.com/theforeman/foreman/pull/1453 and awaiting merge into develop. After this is merge, you should get an error such as "ibm-x3650m4-01-vm-16.lab.eng.bos.redhat.com is used by h01.sat.lab.tlv.redhat.com" Merged in f20ddfe. Note to QE that this will still block deletion of smart proxies that are in use, but should give a clearer error message. Remove resources that are using the proxy, or add a new proxy containing dots in the name and remove that. # hammer proxy list undefined local variable or method `session' for Foreman::Controller::UsersMixin:Module Hammer proxy list itself is failing (In reply to Tazim Kolhar from comment #13) > # hammer proxy list > undefined local variable or method `session' for > Foreman::Controller::UsersMixin:Module > > Hammer proxy list itself is failing This is bug #1096223, check you're using snap 6 (foreman-1.6.0.10-1-sat or higher). I am using Snap 5 Compose 4 On snap 6, it seems to work. hammer -u admin -p changeme proxy delete --name qetello02.usersys.redhat.com Smart proxy deleted |