Description of problem: this issue is the same as https://bugzilla.redhat.com/show_bug.cgi?id=1354568 but happens with `domain` subcommand Version-Release number of selected component (if applicable): # rpm -qa satellite satellite-6.3.0-6.1.beta.el7sat.noarch How reproducible: always Steps to Reproduce: # hammer -v -u admin -p changeme --output=csv domain create --name="foo" --dns-id="-1" [ERROR 2016-11-24 11:28:22 API] 500 Internal Server Error [ERROR 2016-11-24 11:28:22 Exception] ERROR: insert or update on table "domains" violates foreign key constraint "domains_dns_id_fk" DETAIL: Key (dns_id)=(-1) is not present in table "smart_proxies". Could not create the domain: ERROR: insert or update on table "domains" violates foreign key constraint "domains_dns_id_fk" DETAIL: Key (dns_id)=(-1) is not present in table "smart_proxies". [ERROR 2016-11-24 11:28:22 Exception] RestClient::InternalServerError (500 Internal Server Error): /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/abstract_response.rb:74:in `return!' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:312:in `block in rest_client_call_block' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:493:in `process_result' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:421:in `block in transmit' /opt/rh/rh-ruby22/root/usr/share/ruby/net/http.rb:853:in `start' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in `transmit' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-1.8.0/lib/restclient/resource.rb:67:in `post' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:293:in `call_client' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:222:in `http_call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:172:in `call_action' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/api.rb:167:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.0.18/lib/apipie_bindings/resource.rb:21:in `call' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.8.0/lib/hammer_cli/apipie/command.rb:43:in `send_request' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.8.0/lib/hammer_cli_foreman/commands.rb:190:in `send_request' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.8.0/lib/hammer_cli/apipie/command.rb:34:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.8.0/lib/hammer_cli/abstract.rb:22:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.8.0/lib/hammer_cli/abstract.rb:22:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/subcommand/execution.rb:11:in `execute' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:68:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.8.0/lib/hammer_cli/abstract.rb:22:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.0.0/lib/clamp/command.rb:133:in `run' /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.8.0/bin/hammer:125:in `<top (required)>' /usr/bin/hammer:23:in `load' /usr/bin/hammer:23:in `<main>'
*** Bug 1398390 has been marked as a duplicate of this bug. ***
Upstream bug assigned to szadok
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/17525 has been resolved.
This bug still affecting 6.3 Version-Release number of selected component (if applicable): * candlepin-2.0.35-1.el7.noarch * candlepin-selinux-2.0.35-1.el7.noarch * foreman-1.15.0-1.el7sat.noarch * foreman-cli-1.15.0-1.el7sat.noarch * foreman-compute-1.15.0-1.el7sat.noarch * foreman-debug-1.15.0-1.el7sat.noarch * foreman-discovery-image-3.1.1-22.el7sat.noarch * foreman-ec2-1.15.0-1.el7sat.noarch * foreman-gce-1.15.0-1.el7sat.noarch * foreman-installer-1.15.0-1.el7sat.noarch * foreman-installer-katello-3.4.0.1-1.el7sat.noarch * foreman-libvirt-1.15.0-1.el7sat.noarch * foreman-openstack-1.15.0-1.el7sat.noarch * foreman-ovirt-1.15.0-1.el7sat.noarch * foreman-postgresql-1.15.0-1.el7sat.noarch * foreman-proxy-1.15.0-2.el7sat.noarch * foreman-rackspace-1.15.0-1.el7sat.noarch * foreman-selinux-1.15.0-1.el7sat.noarch * foreman-vmware-1.15.0-1.el7sat.noarch * katello-3.4.0-3.el7sat.noarch * katello-ca-consumer-sat-r220-02.lab.eng.rdu2.redhat.com-1.0-1.noarch * katello-certs-tools-2.4.0-1.el7sat.noarch * katello-client-bootstrap-1.3.0-1.el7sat.noarch * katello-common-3.4.0-3.el7sat.noarch * katello-debug-3.4.0-3.el7sat.noarch * katello-default-ca-1.0-1.noarch * katello-installer-base-3.4.0.1-1.el7sat.noarch * katello-selinux-3.0.2-1.el7sat.noarch * katello-server-ca-1.0-1.noarch * katello-service-3.4.0-3.el7sat.noarch * openldap-2.4.40-13.el7.x86_64 * pulp-client-1.0-1.noarch * pulp-docker-plugins-2.3.0-1.el7sat.noarch * pulp-katello-1.0.2-1.el7sat.noarch * pulp-ostree-plugins-1.2.1-1.el7sat.noarch * pulp-puppet-plugins-2.12.2-1.el7sat.noarch * pulp-puppet-tools-2.12.2-1.el7sat.noarch * pulp-rpm-plugins-2.12.2-1.el7sat.noarch * pulp-selinux-2.12.2-1.el7sat.noarch * pulp-server-2.12.2-1.el7sat.noarch * python-ldap-2.4.15-2.el7.x86_64 * tfm-rubygem-ldap_fluff-0.4.6-1.el7sat.noarch * tfm-rubygem-net-ldap-0.15.0-1.el7sat.noarch
This seems to fix the issue only for domain creation (which was reported in comment 1. Feel free to mark as failed QA, the fix should cover updating in a same way.
move to ASSIGNED to support the update also
The fix was merged upstream and was cherrypicked for 1.15.3
VERIFIED on 6.3.0 snap#13 # hammer -v -u admin -p changeme --output=csv domain create --name="foo" --dns-id="-1" [ERROR 2017-08-30 08:06:06 API] 422 Unprocessable Entity [ERROR 2017-08-30 08:06:06 Exception] Dns Invalid capsule id Could not create the domain: Dns Invalid capsule id
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