Bug 1318938
Summary: | Cannot register content host | ||
---|---|---|---|
Product: | Red Hat Satellite | Reporter: | Oleksandr Shtaier <oshtaier> |
Component: | Hosts | Assignee: | Justin Sherrill <jsherril> |
Status: | CLOSED ERRATA | QA Contact: | Sachin Ghai <sghai> |
Severity: | high | Docs Contact: | |
Priority: | unspecified | ||
Version: | 6.2.0 | CC: | bbuckingham, jsherril, mmccune, omaciel, sghai, tomckay |
Target Milestone: | Unspecified | Keywords: | PrioBumpQA, Regression, Triaged |
Target Release: | Unused | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
URL: | http://projects.theforeman.org/issues/13904 | ||
Whiteboard: | |||
Fixed In Version: | rubygem-hammer_cli_katello-0.0.22.6-1,rubygem-katello-3.0.0.18-1 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-07-27 09:07:23 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
Oleksandr Shtaier
2016-03-18 08:19:03 UTC
Issue is also reproducible through Hammer, so is not specific for API. Output from automation run: ``` CLIFactoryError: Failed to create ContentHost with data: { "content-view": null, "content-view-id": "310", "description": null, "guest-ids": null, "host-collection-ids": null, "last-checkin": null, "lifecycle-environment": null, "lifecycle-environment-id": "304", "location": null, "name": "\u74b0\u91e2\u8d7e\u5561\u65a7", "organization": null, "organization-id": "365", "organization-label": null, "release-ver": null, "service-level": null } Command "content-host create" finished with return_code 70 stderr contains following message: [ERROR 2016-03-16 10:11:05 Exception] ERROR: null value in column "host_id" violates not-null constraint Could not create content host: ERROR: null value in column "host_id" violates not-null constraint [ERROR 2016-03-16 10:11:05 Exception] ``` Putting regression as functionality worked before Note this api has been replaced with a new 'register' api: POST /host/subscriptions/ *** Bug 1320097 has been marked as a duplicate of this bug. *** Verified with sat6.2 beta snap8.2 I don't see "content-host create" command now via hammer. I think this has been removed as per of host-unification feature and system api's has been deprecated as well. As per comment5 now a new register command is available to create new content-host. ~]# hammer -u admin -p changeme host subscription register --name test --content-view-id 2 --lifecycle-environment-id 1 --organization-id 1 Host successfully registered ~]# hammer -u admin -p changeme host list | grep test 20 | test ~]# hammer -u admin -p changeme content-host list --organization-id 1 | grep test 8ac6363c-a667-4ac1-9bed-dcc676d9a500 | test | 0 [ INFO 2016-04-18 05:34:11 API] POST /api/hosts/subscriptions [DEBUG 2016-04-18 05:34:11 API] Params: { "name" => "test2", "facts" => {}, "lifecycle_environment_id" => 1, "content_view_id" => 2 } [DEBUG 2016-04-18 05:34:11 API] Headers: {} [DEBUG 2016-04-18 05:34:12 API] Response: { "id" => 21, "name" => "test2", "description" => nil, "content_view" => "cv_rhel7", "content_view_id" => nil, "environment" => "Library" using api's ~]# curl -i -k -u admin:changeme -H "Content-Type: application/json" -X POST -d '{"name":"test3", "lifecycle_environment_id": 1, "content_view_id": 1}' 'https://cloud-qe-3.idmqe.lab.eng.bos.redhat.com/api/hosts/subscriptions' HTTP/1.1 200 OK Date: Mon, 18 Apr 2016 09:54:42 GMT Server: Apache/2.4.6 (Red Hat Enterprise Linux) X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Foreman_version: 1.11.0.14 Foreman_api_version: 2 Apipie-Checksum: e99cc824c2dcbff1e03fc02853dae961 Cache-Control: max-age=0, private, must-revalidate X-Request-Id: 1d0013e4-adcb-42ee-bd7a-9631c9b7d425 X-Runtime: 1.310137 X-Powered-By: Phusion Passenger 4.0.18 Set-Cookie: request_method=POST; path=/ Set-Cookie: _session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFVEkiJTdlZjUzZDE2Yzc0OTY1NzQxNmY3YTFjMGIyM2IyYjVlBjsAVEkiC2xvY2FsZQY7AEZJIgdlbgY7AEY%3D--e5878e87b74bbb47ce6d8383e46ae57b67035b58; path=/; HttpOnly ETag: "0e9ab8edaca6a81be47d76bb9821f82b" Status: 200 OK Vary: Accept-Encoding Transfer-Encoding: chunked Content-Type: application/json; charset=utf-8 {"id":22,"name":"test3","description":null,"content_view":"Default Organization View","content_view_id":null,"environment":"Library"} 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/RHBA-2016:1500 |