Bug 1733462

Summary: Client payload upload shall fail if not registered
Product: Red Hat Enterprise Linux 8 Reporter: Peter Vreman <peter.vreman>
Component: insights-clientAssignee: jcrafts
Status: CLOSED WONTFIX QA Contact: Pavol Kotvan <pakotvan>
Severity: medium Docs Contact: Kevin Blake <kblake>
Priority: unspecified    
Version: 8.3CC: dajohnso, fstavela, jcrafts, klape, lphiri, pakotvan
Target Milestone: rc   
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-24 07:27:08 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:
Bug Depends On:    
Bug Blocks: 1122832    

Description Peter Vreman 2019-07-26 07:52:45 UTC
Description of problem:
When the client is unregistered i can do a payload upload. The client will then create a new system at cloud.redhat.com with a UUID name

-------------------
vrempet@li-lc-1444 ~
$ ls -la /etc/insights-client/.registered
ls: cannot access /etc/insights-client/.registered: No such file or directory


vrempet@li-lc-1444 ~
$ sudo insights-client --status  --conf /tmp/insights.conf
System is NOT registered locally via .registered file. Unregistered at 2019-07-26T07:43:37.325380
Insights API says this machine is NOT registered.

vrempet@li-lc-1444 ~
$ sudo insights-client --conf /tmp/insights.conf  --payload /var/lib/insights/compliance-report-standard.xml --content-type application/vnd.redhat.compliance.something+tgz --net-debug --verbose
...
2019-07-26 07:45:31,419    DEBUG insights.client.connection Canonical facts collected:
{"bios_uuid": "...", "subscription_manager_id": "55d7ea8f-ed1c-4881-83fb-21bea03f4fa6", "insights_id": "7cc0b631-862b-41b7-933c-bb51bd525ac9", "mac_addresses": ["..."]}
2019-07-26 07:45:31,419    DEBUG insights.client.connection Uploading /var/lib/insights/compliance-report-standard.xml to https://fibssat6c.hag.hilti.com:443/redhat_access/r/insights/platform/ingress/v1/upload
2019-07-26 07:45:31,419     INFO network POST https://fibssat6c.hag.hilti.com:443/redhat_access/r/insights/platform/ingress/v1/upload
2019-07-26 07:45:34,993    DEBUG insights.client.connection Upload status: 202 Accepted
....

vrempet@li-lc-1444 ~
$ sudo insights-client --status  --conf /tmp/insights.conf
System is registered locally via .registered file. Registered at 2019-07-26T07:45:30.479339
Insights API says this machine is NOT registered.

vrempet@li-lc-1444 ~
-------------

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


How reproducible:


Steps to Reproduce:
0. Delete Client on cloud.redhat.com if it Exists
1. rm -f  /etc/insights-client/.registered  /etc/insights-client/machine-id
2. isnights-client --status
# The client should mentioned now it is NOT registered
3. insights-client  --payload /var/lib/insights/compliance-report-standard.xml --content-type application/vnd.redhat.compliance.something+tgz --net-debug --verbose

Actual results:
Uploaded succeeds, a system with a uuid is created

Expected results:
Step 3 shall fail that the system is unregisteed


Additional info:

Comment 1 Jeff Needle 2019-07-26 17:32:41 UTC
This is actually behaving as designed.  Since insights-client is now shipping by default with RHEL8 there are a couple of different client usage models.  One is the traditional registration and scheduled update model with which you are familiar.  --register enables the timers and daily uploads as it has in the past.  A new feature with cloud.redhat.com is to allow the client to also upload specific payloads on demand for certain services as with your compliance example.  We did not want to mandate registration in this usage model workflow but the act of uploading a payload will effectively "register" your system so you can find results in cloud.redhat.com.

Comment 2 Peter Vreman 2019-07-29 10:22:59 UTC
Jeff, but uploading with a random id is also not usefull. And the id in the UI looks to be the database id and there is for me as user no correlation with any id on the client.
So for me as an user the current behaviour is not traceable and understandable.

It works maybe for 1 uploaded, but with 10+ clients the results are useless.

If the register is done implicit then use an understandable name for the user.

Comment 7 Ian Page Hands 2020-04-02 16:24:19 UTC
(In reply to Peter Vreman from comment #2)
> Jeff, but uploading with a random id is also not usefull. And the id in the
> UI looks to be the database id and there is for me as user no correlation
> with any id on the client.
> So for me as an user the current behaviour is not traceable and
> understandable.
>
> It works maybe for 1 uploaded, but with 10+ clients the results are useless.
> 
> If the register is done implicit then use an understandable name for the
> user.


I think I would like to look into these as resolutions to this specific comment.

- Set a display name when uploading --display-name "something_meaningful"
- Hostname is used as the display name if a valid host name is set (should be that way now)
- /insights/inventory needs to be filterable by Insights UUID
- /insights/inventory needs to be filterable by Inventory UUID

Comment 12 Link Dupont 2021-02-24 15:54:52 UTC
Migrating this bug as part of the effort to close the cloud.redhat.com/Client Product/Component.

Comment 15 RHEL Program Management 2021-08-24 07:27:08 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.