Created attachment 923826 [details] relevant part of /var/log/foreman/production.log Description of problem: When creating content-host, creation fails with: Validation failed: Facts can't be blank (ActiveRecord::RecordInvalid) even if facts are set. This is a regression. Version-Release number of selected component (if applicable): Satellite-6.0.4-RHEL-6-20140730.0-Satellite-x86_64 How reproducible: always Steps to Reproduce: 1. curl -s -H "Content-Type:application/json" -H "Accept:application/json,version=2" -k -u admin:changeme -d '{"type":"system", "facts":{"release":"6Server", "architecture":"x86_64"}, "host_colletion_id":{}, "organization_id":3, "description":"Initial Registration Parameters:\nOS: redhat-release-server\nRelease: 6Server\nCPU Arch: x86_64\nsat5_system_id: 1000020000", "name":"mysytem-123.example.com"}' $(hostname)/katello/api/systems Actual results: {"displayMessage":"Validation failed: Facts can't be blank","errors":{"facts":["can't be blank"]}} Expected results: Content host created. Additional info: This is a regression, same command worked with Satellite-6.0.4-RHEL-6-20140723.0-Satellite-x86_64 as expected. This bug blocks migration of content-hosts.
It appears that this issue has been solved with katello PR: https://github.com/Katello/katello/pull/4508 Without the PR: $ curl -s -H "Content-Type:application/json" -H "Accept:application/json,version=2" -k -u admin:changeme -d '{"type":"system", "facts":{"release":"6Server", "architecture":"x86_64"}, "host_colletion_id":{}, "organization_id":1, "environment_id":1, "description":"Initial Registration Parameters:\nOS: redhat-release-server\nRelease: 6Server\nCPU Arch: x86_64\nsat5_system_id: 1000020000", "name":"mysytem-123.example.com"}' http://$(hostname):3000/katello/api/systems {"displayMessage":"Validation failed: Facts can't be blank","errors":{"facts":["can't be blank"]}}[bbucking@fortello action With the PR: $ curl -s -H "Content-Type:application/json" -H "Accept:application/json,version=2" -k -u admin:changeme -d '{"type":"system", "facts":{"release":"6Server", "architecture":"x86_64"}, "host_colletion_id":{}, "organization_id":1, "environment_id":1, "description":"Initial Registration Parameters:\nOS: redhat-release-server\nRelease: 6Server\nCPU Arch: x86_64\nsat5_system_id: 1000020000", "name":"mysytem-123.example.com"}' http://$(hostname):3000/katello/api/systems {"id":3,"uuid":"47c23d72-a306-4315-8452-20439d3101f0","name":"mysytem-123.example.com","description":"Initial Registration Parameters:\nOS: redhat-release-server\nRelease: 6Server\nCPU Arch: x86_64\nsat5_system_id: 1000020000","location":"None","content_view":{"composite":null,"created_at":"2014-07-26T14:20:32Z","default":true,"description":null,"id":1,"label":"Default_Organization_View","name":"Default Organization View","next_version":1,"organization_id":1,"updated_at":"2014-07-26T14:20:32Z"},"content_view_id":1,"distribution":" ","content_overrides":[],"entitlementStatus":"valid","autoheal":true,"href":"/consumers/47c23d72-a306-4315-8452-20439d3101f0","release":null,"checkin_time":null,"created":"2014-08-05T12:13:23.877+0000","installedProducts":[],"service_level":"","release_ver":null,"permissions":{"editable":true},"products":[],"host":null,"hostCollections":[],"customInfo":[],"environment":{"id":1,"name":"Library","label":"Library","description":null,"organization":{"name":"Default_Organization","label":"Default_Organization"},"created_at":"2014-07-26T14:20:31Z","updated_at":"2014-07-26T14:20:31Z","library":true,"prior":null,"permissions":{"view_lifecycle_environments":true,"edit_lifecycle_environments":true,"destroy_lifecycle_environments":true,"promote_or_remove_content_views_to_environments":true}},"activation_keys":[]}
https://github.com/Katello/katello/pull/4508 will fix this
Created redmine issue http://projects.theforeman.org/issues/6937 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/6937 has been closed ------------- Christine Fouant Applied in changeset commit:katello|6f38a256be89400a4900429bdad7ff78e2e3f101.
I see the same error with Satellite-6.0.4-RHEL-6-20140806.0-Satellite-x86_64 compose.
*** Bug 1128455 has been marked as a duplicate of this bug. ***
Verified using API. Now I am able to create content host by passing facts. # curl -X POST -H "Accept:application/json" -H "Content-Type: application/json" -u admin:changeme --insecure -d '{"type":"system","facts":{"release":"6Server", "architecture":"x86_64"}, "organization_id":3, "name":"testsystem1.redhat.com","environment_id":3, "content_view_id":3}' https://test.redhat.com/katello/api/systems Success! Version Tested: GA Snap 5 - Satellite-6.0.4-RHEL-6-20140813.2 * apr-util-ldap-1.3.9-3.el6_0.1.x86_64 * candlepin-0.9.23-1.el6_5.noarch * candlepin-common-1.0.1-1.el6_5.noarch * candlepin-scl-1-5.el6_4.noarch * candlepin-scl-quartz-2.1.5-5.el6_4.noarch * candlepin-scl-rhino-1.7R3-1.el6_4.noarch * candlepin-scl-runtime-1-5.el6_4.noarch * candlepin-selinux-0.9.23-1.el6_5.noarch * candlepin-tomcat6-0.9.23-1.el6_5.noarch * elasticsearch-0.90.10-4.el6sat.noarch * foreman-1.6.0.40-1.el6sat.noarch * foreman-compute-1.6.0.40-1.el6sat.noarch * foreman-gce-1.6.0.40-1.el6sat.noarch * foreman-libvirt-1.6.0.40-1.el6sat.noarch * foreman-ovirt-1.6.0.40-1.el6sat.noarch * foreman-postgresql-1.6.0.40-1.el6sat.noarch * foreman-proxy-1.6.0.27-1.el6sat.noarch * foreman-selinux-1.6.0.6-1.el6sat.noarch * foreman-vmware-1.6.0.40-1.el6sat.noarch * katello-1.5.0-28.el6sat.noarch * katello-ca-1.0-1.noarch * katello-certs-tools-1.5.6-1.el6sat.noarch * katello-installer-0.0.59-1.el6sat.noarch * openldap-2.4.23-34.el6_5.1.x86_64 * openldap-devel-2.4.23-34.el6_5.1.x86_64 * pulp-katello-0.3-3.el6sat.noarch * pulp-nodes-common-2.4.0-0.30.beta.el6sat.noarch * pulp-nodes-parent-2.4.0-0.30.beta.el6sat.noarch * pulp-puppet-plugins-2.4.0-0.30.beta.el6sat.noarch * pulp-puppet-tools-2.4.0-0.30.beta.el6sat.noarch * pulp-rpm-plugins-2.4.0-0.30.beta.el6sat.noarch * pulp-selinux-2.4.0-0.30.beta.el6sat.noarch * pulp-server-2.4.0-0.30.beta.el6sat.noarch * python-ldap-2.3.10-1.el6.x86_64 * ruby193-rubygem-net-ldap-0.3.1-3.el6sat.noarch * ruby193-rubygem-runcible-1.1.0-2.el6sat.noarch
This was delivered with Satellite 6.0 which was released on 10 September 2014.