Bug 1804943 - Cannot use hammer to update Capsule organization unless organization is already assigned
Summary: Cannot use hammer to update Capsule organization unless organization is alrea...
Keywords:
Status: NEW
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Capsule
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: Unspecified
Assignee: Lukas Zapletal
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-19 22:42 UTC by Paul Dudley
Modified: 2021-10-16 00:34 UTC (History)
5 users (show)

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


Attachments (Terms of Use)

Description Paul Dudley 2020-02-19 22:42:01 UTC
Cannot use hammer to update Capsule organization unless a organization is already defined.

To reproduce,
- install new Capsule
- do not configure this Capsule in webui and attempt to set organization via hammer:
~~~
[root@boosat ~]# hammer capsule update --name boocap.hauntedhouse.local  --organizations ghost
Could not update the proxy:
  Resource smart_proxy not found by id '2'
~~~

After the organization is set in webui hammer works without issue:
~~~
[root@boosat ~]# hammer capsule update --name boocap.hauntedhouse.local --organizations ghost,test
Smart proxy updated.
~~~

Comment 3 Paul Dudley 2020-02-19 22:52:47 UTC
Notes:
Unsure of correct component for this. Apologies in advance.

This does not appear to be an issue in Satellite 6.7 beta:
- installed fresh Capsule. After installer finished on Capsule attempted to set organization:
~~~
[root@boosat ~]# hammer capsule update --name boocap.hauntedhouse.local --organizations ghost
Smart proxy updated.
~~~

Satellite:
[root@boosat ~]# rpm -q foreman foreman-proxy
foreman-1.24.1.1-1.el7sat.noarch
foreman-proxy-1.24.1-1.el7sat.noarch

Capsule:
[root@boocap ~]# rpm -q foreman-proxy
foreman-proxy-1.24.1-1.el7sat.noarch

Comment 4 Adam Ruzicka 2020-02-20 08:56:09 UTC
Do you still have the original machine around? Is it possible that the user has a "Default on login" configured for organizations and locations and that the capsule is not assigned into any organization/location after registration?

Comment 5 Dave Carmichael 2020-02-20 13:40:47 UTC
Hi Adam,

Yes, the capsule and satellite are still available. We have the sosreports and can request additional information. What info do you need?

I don't quite understand your question about the default org and location for a user, but if you will clarify we'll have the customer check.

Kind regards,
Dave

Comment 6 Adam Ruzicka 2020-02-20 13:50:25 UTC
If you go to Administer > Users > $user > Organizations tab, there is a field called "Default on login" at the bottom of the page. Alternatively run hammer user info --login $user and look at "Default organization" and "Default location" fields. 

This controls which organization is used when the user logs in OR when they make an API request. Let's take your example, if there are organizations "Default organization" and "ghost" and the user has "ghost" as a default org on login and they try to assign the capsule into the "ghost" org, it may fail because by default it would look for the capsule inside the "ghost" org.

Also IIRC there was some issue about capsule not being assigned to *any* organization in 6.6, but maybe that was only about the "internal" capsule. If they go into Infrastructure > Capsules, does the capsule have any orgs and locs assigned?

Comment 7 Dave Carmichael 2020-02-20 14:18:35 UTC
Thanks. I requested the information.


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