Bug 1563003 - Service level "Merry Maid Service" is not available to units of organization null.
Summary: Service level "Merry Maid Service" is not available to units of organization ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 2.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Chris "Ceiu" Rog
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-04-02 21:46 UTC by John Sefler
Modified: 2019-07-31 12:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-09 19:02:15 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 1965 0 None None None 2018-04-09 19:02:14 UTC
Red Hat Bugzilla 1565066 0 high CLOSED Runtime Error ownerId is null at org.candlepin.model.OwnerCurator.findOwnerById:69 while creating owner 2021-02-22 00:41:40 UTC

Internal Links: 1565066

Description John Sefler 2018-04-02 21:46:56 UTC
Description of problem:
Got a long time passing test that is trying to create a new organization/owner with a defaultServiceLevel but is getting blocked with the displayMessage above.

Since I am attempting to create a new org, it will not have any service levels available yet, so... it makes sense that the service level is not yet available.  Also notice the "null" in the message indicating that the owner does not exist yet either.  Feels like a new chicken/egg problem where as the prior versions of candlepin allowed me to specify a defaultServiceLevel with the POSTing of a new owner that will eventually be created at a later time.

Version-Release number of selected component (if applicable):
[root@jsefler-rhel6 ~]# curl --stderr /dev/null --insecure --request GET https://jsefler-candlepin.usersys.redhat.com:8443/candlepin/status | python -m json/tool | grep version
    "version": "2.3.4"

[root@jsefler-candlepin candlepin]# git show | head -1
commit abe976de0d9b1f422581ca5aa264e02297e196c2
[root@jsefler-candlepin candlepin]# git branch
* master



How reproducible:


Steps to Reproduce:

[root@jsefler-rhel6 ~]# curl --stderr /dev/null --insecure --user REDACTED:REDACTED --request POST --data '{"displayName":"The Jones Residence","defaultServiceLevel":"Merry Maid Service","key":"The_Joneses"}' --header 'accept: application/json' --header 'content-type: application/json' https://jsefler-candlepin.usersys.redhat.com:8443/candlepin/owners | python -m json/tool
{
    "displayMessage": "Service level \"Merry Maid Service\" is not available to units of organization null.", 
    "requestUuid": "6898c19b-30be-4040-a0e3-c7495999b1b0"
}


[root@jsefler-candlepin candlepin]# tail -f /var/log/candlepin/candlepin.log 
2018-04-02 17:40:18,902 [thread=http-bio-8443-exec-1] [req=6898c19b-30be-4040-a0e3-c7495999b1b0, org=, csid=] INFO  org.candlepin.common.filter.LoggingFilter - Request: verb=POST, uri=/candlepin/owners
2018-04-02 17:40:18,939 [thread=http-bio-8443-exec-1] [req=6898c19b-30be-4040-a0e3-c7495999b1b0, org=, csid=] WARN  org.candlepin.audit.EventSinkImpl - Rolling back ActiveMQ transaction.
2018-04-02 17:40:18,940 [thread=http-bio-8443-exec-1] [req=6898c19b-30be-4040-a0e3-c7495999b1b0, org=, csid=] INFO  org.candlepin.common.filter.LoggingFilter - Response: status=400, content-type="application/json", time=38



Actual results:
  above

Expected results:
  successful org creation with any defaultServiceLevel

Additional info:

Comment 1 Chris "Ceiu" Rog 2018-04-09 19:02:15 UTC
Closing this PR as NOTABUG due to the following:

After investigating the issue here, it was found that allowing the default service level to be set at owner creation time (before it could be properly validated) allowed it to be set to invalid values, which could have very negative and confusing effects for clients using the auto-attach functionality without specifying a service level.

What we've done instead is fixed the broken error message noted in comment as well as added additional error output to clarify exactly what is expected during owner creation. Hopefully this will suffice going forward.


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