Bug 1342077 - Actions::Candlepin::Consumer::AutoAttachSubscriptions reports success even if the AutoAttach fails
Summary: Actions::Candlepin::Consumer::AutoAttachSubscriptions reports success even if...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Subscription Management
Version: 6.1.8
Hardware: x86_64
OS: Linux
medium
medium vote
Target Milestone: Unspecified
Assignee: satellite6-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-02 11:56 UTC by Pavel Moravec
Modified: 2020-03-11 15:07 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-09-04 18:04:36 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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