Bug 1653135 - facts upload failed
Summary: facts upload failed
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Discovery Image
Version: 6.3.3
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2018-11-26 02:36 UTC by matt jia
Modified: 2018-11-29 13:38 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2018-11-29 13:38:22 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description matt jia 2018-11-26 02:36:06 UTC
Description of problem:

With the discovery image v3.4.4-1, even with v3.5.1, fact upload failed with below error:

Validation failed: Name has already been taken, Discovery attributes set can't be blank.

The error is caused by a blank attribute. See the following entries in production.log

2018-11-20 13:22:45 6fd4ba75 [app] [I] Started POST "/api/v2/discovered_hosts/facts" for at 2018-11-20 13:22:45 +0100
2018-11-20 13:22:45 6fd4ba75 [app] [I] Processing by Api::V2::DiscoveredHostsController#facts as JSON
2018-11-20 13:22:45 6fd4ba75 [app] [I]   Parameters: {"facts"=>"[FILTERED]", "apiv"=>"v2", "discovered_host"=>{"facts"=>"[FILTERED]"}}
2018-11-20 13:22:45 6fd4ba75 [app] [I] Current user: foreman_admin (administrator)
2018-11-20 13:22:45 6fd4ba75 [audit] [I] [mac005056aa94cf] deleted 0 (3.5ms)
2018-11-20 13:22:45 6fd4ba75 [audit] [I] [mac005056aa94cf] added 132 (345.2ms)
2018-11-20 13:22:45 6fd4ba75 [app] [W] Host discovery failed, facts: {"lib"=>"/usr/share/fdi/facts:/opt/extension/facts", 
"discovery_netmask"=>"", "discovery_gateway"=>"xx.xx.xx.x", "discovery_dns"=>"xx.xx.xx.x", ""=>"",

As you can see, for some reason, the facts has an empty attribute.

Version-Release number of selected component (if applicable):


How reproducible:

Hard as this is only observed in one customer's env

Steps to Reproduce:

use  foreman-discovery-image-3.4.4 image for PXE-less discovery

Actual results:

Can't provision a host.

Expected results:

Can provision a host.

Additional info:

I think empty attributes(still not sure how this happens) should be automatically removed from the discovered facts before sending to the 
Satellite server.

Note You need to log in before you can comment on or make changes to this bug.