Hide Forgot
Description of problem: When searching for a resource via the API some variables are returned as null even tho the parameter is indeed set. Version-Release number of selected component (if applicable): 6.2.1 How reproducible: Every time Steps to Reproduce: 1. Create a new host in 6.2.1 2. Look up the newly created server 3. Search for the same server via the API Actual results: https://satellite.lab.example.com/api/v2/hosts/configureme.lab.example.com { "ip": "192.168.180.79", "environment_id": 4, "environment_name": "KT_Default_Organization_Dev_Puppet_Modules_4", "last_report": "2016-09-13 16:27:29 UTC", "mac": "00:1a:4a:16:01:69", "realm_id": null, "realm_name": null, "sp_mac": null, "sp_ip": null, "sp_name": null, "domain_id": 1, "domain_name": "lab.example.com", "architecture_id": 1, "architecture_name": "x86_64", "operatingsystem_id": 2, "operatingsystem_name": "RHEL Server 7.2", "subnet_id": 1, "subnet_name": "labnet", "sp_subnet_id": null, <snip> } https://satellite.lab.example.com/api/v2/hosts?search=configureme.lab.example.com { "total": 5, "subtotal": 1, "page": 1, "per_page": 20, "search": "configureme.lab.example.com", "sort": { "by": null, "order": null }, "results": [ { "ip": null, "environment_id": 4, "environment_name": "KT_Default_Organization_Dev_Puppet_Modules_4", "last_report": "2016-09-13 16:27:29 UTC", "mac": null, "realm_id": null, "realm_name": null, "sp_mac": null, "sp_ip": null, "sp_name": null, "domain_id": null, "domain_name": null, "architecture_id": 1, "architecture_name": "x86_64", "operatingsystem_id": 2, "operatingsystem_name": "RHEL Server 7.2", "subnet_id": null, "subnet_name": null, "sp_subnet_id": null, "ptable_id": 103, "ptable_name": "vda only, all root", "medium_id": 9, "medium_name": "Default_Organization/Library/Red_Hat_Server/Red_Hat_Enterprise_Linux_7_Server_Kickstart_x86_64_7_2", "build": false, "comment": "", "disk": "", "installed_at": "2016-09-13 12:52:11 UTC", "model_id": 2, "hostgroup_id": 2, "owner_id": 3, "owner_type": "User", "enabled": true, "puppet_ca_proxy_id": 1, "managed": true, "use_image": null, "image_file": "", "uuid": "a630fdfe-6c8e-4cbc-8d36-627ffa6347b6", "compute_resource_id": 1, "compute_resource_name": "RHEV", "compute_profile_id": 1, "compute_profile_name": "1-Small", <snip> } Expected results: Values should be populated correcly when using the search API. For example, subnet_name is set to labnet in the first query. The search query should return the same value as it's the same host. Additional info:
If using the GET on a specific host, do you see the same 'null' attributes?
No, as described in the first post I see the expected values when doing a get on a specific host; "ip": "192.168.180.79", "subnet_name": "labnet", But when searching for the same host some values return null. "ip": null, "subnet_name": null, Worth noting is also that I see the same result when searching by mac as well as hostname.
Upstream bug assigned to szadok
Upstream bug component is API
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16380 has been resolved.
Verified in Satellite 6.3, snap 6, parameters no longer missing in the search output.
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