Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1342077

Summary: Actions::Candlepin::Consumer::AutoAttachSubscriptions reports success even if the AutoAttach fails
Product: Red Hat Satellite Reporter: Pavel Moravec <pmoravec>
Component: Subscription ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.8CC: bcourt, ktordeur, tomckay
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-09-04 18:04:36 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:

Description Pavel Moravec 2016-06-02 11:56:33 UTC
Description of problem:
Despite auto-attach subscription fails and the content host still lacks associated subscriptions, the task is marked as succeeded.

The cause is candlepin returns 200 response code even after Autobind error.


Version-Release number of selected component (if applicable):
Satellite 6.1.9
candlepin-0.9.49.12-1.el7.noarch


How reproducible:
100%


Steps to Reproduce:
1. Remove any manifest from a Satellite (just to ensure there are no free subscriptions available)
2. Register a Content Host
3. In WebUI, go to the Content Host -> Subscriptions -> click to Run Auto-Attach
4. Check output/response and task detail


Actual results:
4.:
- the content host will have Invalid subscription status (that is expected)
- Sat responds with "Successfully updated subscriptions. "
- task detail shows success


Expected results:
- the content host will have Invalid subscription status (that is expected)
- Sat responds with some autobind error
- task detail to have the same error (got from candlepin that should return other than 200 code with some error string)


Additional info:
candlepin.log from the time of event:

..
2016-06-02 13:49:37,918 [req=3aa65f20-2818-41c9-b184-9af3d89436a5, org=] INFO  org.candlepin.common.filter.LoggingFilter - Request: verb=POST, uri=/candlepin/consumers/e11a9512-013f-4b24-84b7-6b0095c0172b/entitlements
2016-06-02 13:49:37,996 [req=3aa65f20-2818-41c9-b184-9af3d89436a5, org=Default_Organization] ERROR org.candlepin.resource.ConsumerResource - Autobind error
java.lang.RuntimeException: No entitlements for products: [69]
	at org.candlepin.policy.js.autobind.AutobindRules.selectBestPools(AutobindRules.java:79) ~[AutobindRules.class:na]
	at org.candlepin.controller.CandlepinPoolManager.getBestPools(CandlepinPoolManager.java:811) ~[CandlepinPoolManager.class:na]
	at org.candlepin.controller.CandlepinPoolManager.entitleByProducts(CandlepinPoolManager.java:493) ~[CandlepinPoolManager.class:na]
	at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:58) ~[guice-persist-3.0-redhat-1.jar:3.0-redhat-1]
	at org.candlepin.controller.Entitler.bindByProducts(Entitler.java:194) ~[Entitler.class:na]
	at org.candlepin.controller.Entitler.bindByProducts(Entitler.java:146) ~[Entitler.class:na]
	at org.candlepin.resource.ConsumerResource.bind(ConsumerResource.java:1498) ~[ConsumerResource.class:na]
	at org.candlepin.guice.TransactionalInvoker.invoke(TransactionalInvoker.java:34) ~[TransactionalInvoker.class:na]
	at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66) ~[guice-persist-3.0-redhat-1.jar:3.0-redhat-1]
	at org.candlepin.guice.CandlepinResourceTxnInterceptor.invoke(CandlepinResourceTxnInterceptor.java:33) ~[CandlepinResourceTxnInterceptor.class:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.8.Final-redhat-3.jar:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [tomcat-servlet-3.0-api.jar:na]
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at org.candlepin.servlet.filter.EventFilter.doFilter(EventFilter.java:63) [EventFilter.class:na]
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at org.candlepin.servlet.filter.ContentTypeHackFilter.doFilter(ContentTypeHackFilter.java:58) [ContentTypeHackFilter.class:na]
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at org.candlepin.common.filter.LoggingFilter.doFilter(LoggingFilter.java:88) [candlepin-common-1.0.22.jar:]
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at org.candlepin.servlet.filter.CandlepinPersistFilter.doFilter(CandlepinPersistFilter.java:48) [CandlepinPersistFilter.class:na]
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at org.candlepin.servlet.filter.CandlepinScopeFilter.doFilter(CandlepinScopeFilter.java:68) [CandlepinScopeFilter.class:na]
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113) [guice-servlet-3.0-redhat-1.jar:3.0-redhat-1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) [catalina.jar:7.0.54]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) [catalina.jar:7.0.54]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) [catalina.jar:7.0.54]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) [catalina.jar:7.0.54]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) [catalina.jar:7.0.54]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [catalina.jar:7.0.54]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:7.0.54]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) [catalina.jar:7.0.54]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) [catalina.jar:7.0.54]
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) [tomcat-coyote.jar:7.0.54]
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) [tomcat-coyote.jar:7.0.54]
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) [tomcat-coyote.jar:7.0.54]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-coyote.jar:7.0.54]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
2016-06-02 13:49:37,997 [req=3aa65f20-2818-41c9-b184-9af3d89436a5, org=Default_Organization] INFO  org.candlepin.common.filter.LoggingFilter - Response: status=200, content-type="application/json", time=79
..

Comment 2 Filip Nguyen 2016-06-02 15:03:02 UTC
This may not necessarily be a Candlepin bug. Candlepin behaves logically - it returns 200, because the autobind was successfull. The fact that the autobind  didn't 'fully covered' the consumer (in this case because of a lack of correct pools available) is probably something that the clients such as Katello might check using compliance endpoints.

Comment 3 Tom McKay 2016-06-02 15:42:53 UTC
I agree w/ Filip: Client tooling should provide report if users expect that.

For katello it could be a pre- and post-auto count totals for red/yellow/green, for example.

Comment 4 Bryan Kearney 2016-07-08 20:40:52 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 6 Bryan Kearney 2018-09-04 18:04:36 UTC
Thank you for your interest in Satellite 6. We have evaluated this request, and we do not expect this to be implemented in the product in the foreseeable future. We are therefore closing this out as WONTFIX. If you have any concerns about this, please feel free to contact Rich Jerrido or Bryan Kearney. Thank you.