Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-2903

Swatch-producer-azure throws vague error when handling api exception

XMLWordPrintable

    • 5
    • False
    • Hide

      None

      Show
      None
    • True
    • Low

       

      When swatch-producer-azure processes a billable usage and gets a 404 error from the internalSubscriptionApi during context usage lookup, it logs a DefaultApiException with the status code but we lose the context from where it is being called from.

      Instead it should be updated to display where in our code the call originated from.

      2024-09-10 18:00:04,332 INFO [com.red.swa.azu.ser.AzureBillableUsageAggregateConsumer] (executor-thread-1166) Received billable usage message BillableUsageAggregate(totalValue=5.0, windowTimestamp=2024-09-10T17:00Z, aggregateId=ca468430-03a9-4fed-9a55-aaed169f78ca, aggregateKey=BillableUsageAggregateKey(orgId=17702867, productId=rhel-for-x86-els-payg, metricId=vCPUs, sla=Premium, usage=Production, billingProvider=azure, billingAccountId=testfjl;testcqfe;testwmhls;testfmkbqf), snapshotDates=[2024-09-10T00:00Z], status=null, errorCode=null, billedOn=null, remittanceUuids=[])2024-09-10 18:00:04,332 INFO [com.red.swa.azu.ser.AzureBillableUsageAggregateConsumer] (executor-thread-1166) Processing billable usage message: BillableUsageAggregate(totalValue=5.0, windowTimestamp=2024-09-10T17:00Z, aggregateId=ca468430-03a9-4fed-9a55-aaed169f78ca, aggregateKey=BillableUsageAggregateKey(orgId=17702867, productId=rhel-for-x86-els-payg, metricId=vCPUs, sla=Premium, usage=Production, billingProvider=azure, billingAccountId=testfjl;testcqfe;testwmhls;testfmkbqf), snapshotDates=[2024-09-10T00:00Z], status=null, errorCode=null, billedOn=null, remittanceUuids=[])2024-09-10 18:00:04,378 DEBUG [org.jbo.res.rea.com.cor.AbstractResteasyReactiveContext] (vert.x-eventloop-thread-0) Attempting to handle unrecoverable exception: org.jboss.resteasy.reactive.common.core.UnwrappableException: com.redhat.swatch.azure.exception.DefaultApiException: Api response has status code 404at io.quarkus.rest.client.reactive.runtime.MicroProfileRestClientResponseFilter.filter(MicroProfileRestClientResponseFilter.java:58)at org.jboss.resteasy.reactive.client.handlers.ClientResponseFilterRestHandler.handle(ClientResponseFilterRestHandler.java:21)at org.jboss.resteasy.reactive.client.handlers.ClientResponseFilterRestHandler.handle(ClientResponseFilterRestHandler.java:10)at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.invokeHandler(AbstractResteasyReactiveContext.java:231)at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)at org.jboss.resteasy.reactive.client.impl.RestClientRequestContext$1.lambda$execute$0(RestClientRequestContext.java:324)at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:279)at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:261)at io.vertx.core.impl.ContextInternal.lambda$runOnContext$0(ContextInternal.java:59)at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:173)at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:166)at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:566)at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)at java.base/java.lang.Thread.run(Thread.java:840)Caused by: com.redhat.swatch.azure.exception.DefaultApiException: Api response has status code 404at com.redhat.swatch.azure.resource.DefaultApiExceptionMapper.toThrowable(DefaultApiExceptionMapper.java:44)at com.redhat.swatch.azure.resource.DefaultApiExceptionMapper.toThrowable(DefaultApiExceptionMapper.java:32)at io.quarkus.rest.client.reactive.runtime.MicroProfileRestClientResponseFilter.filter(MicroProfileRestClientResponseFilter.java:54)... 16 more2024-09-10 18:00:04,382 DEBUG [com.red.swa.azu.ser.BillableUsageStatusProducer] (executor-thread-1166) Queued Azure BillableUsageAggregate ca468430-03a9-4fed-9a55-aaed169f78ca to billable-usage-status topic with status failed 

       

       

              karshah@redhat.com Kartik Shah
              kflahert@redhat.com Kevin Flaherty
              Trayvon McKnight Trayvon McKnight
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: