Bug 1733462 - Client payload upload shall fail if not registered
Summary: Client payload upload shall fail if not registered
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: insights-client
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: 8.3
Assignee: jcrafts
QA Contact: Pavol Kotvan
Kevin Blake
URL:
Whiteboard:
Depends On:
Blocks: 1122832
TreeView+ depends on / blocked
 
Reported: 2019-07-26 07:52 UTC by Peter Vreman
Modified: 2021-07-25 07:30 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

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.


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