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

Billable Usage service causes CrashLoopException when receiving tally summaries with an invalid metric ID

XMLWordPrintable

      Stacktrace:

      2025-01-08 08:08:48,428 INFO  [com.red.swa.bil.usa.ser.BillableUsageService] (executor-thread-1) Processing monthly billable usage for orgId=17791774 productId=rhel-for-x86-els-payg-addon metric=bad provider=aws, billingAccountId=f2feaabe-cca5-4199-add9-72ffd2a379eb snapshotDate=2025-01-08T06:18:24.751849Z
      2025-01-08 08:08:48,428 DEBUG [com.red.swa.bil.usa.ser.BillableUsageService] (executor-thread-1) Usage: org.candlepin.subscriptions.billable.usage.BillableUsage@6e10496c[uuid=<null>,orgId=17791774,tallyId=a9942e75-6b37-427e-86f0-a87cc6e595e3,billingProvider=aws,billingAccountId=f2feaabe-cca5-4199-add9-72ffd2a379eb,snapshotDate=2025-01-08T06:18:24.751849Z,productId=rhel-for-x86-els-payg-addon,sla=Premium,usage=Production,status=<null>,errorCode=<null>,billedOn=<null>,metricId=bad,value=3.0,billingFactor=<null>,vendorProductCode=<null>,hardwareMeasurementType=PHYSICAL,currentTotal=3.0]
      2025-01-08 08:08:48,433 ERROR [io.sma.rea.mes.provider] (executor-thread-1) SRMSG00200: The method com.redhat.swatch.billable.usage.services.TallySummaryMessageConsumer#consume has thrown an exception: java.lang.IllegalArgumentException: MetricId: bad not found in configuration
      	at com.redhat.swatch.configuration.registry.MetricId.lambda$fromString$1(MetricId.java:62)
      	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
      	at com.redhat.swatch.configuration.registry.MetricId.fromString(MetricId.java:59)
      	at com.redhat.swatch.billable.usage.services.model.BillingUnit.lambda$new$0(BillingUnit.java:45)
      	at java.base/java.util.Optional.flatMap(Optional.java:289)
      	at com.redhat.swatch.billable.usage.services.model.BillingUnit.<init>(BillingUnit.java:42)
      	at com.redhat.swatch.billable.usage.services.model.Quantity.fromContractCoverage(Quantity.java:86)
      	at com.redhat.swatch.billable.usage.services.BillableUsageService.produceMonthlyBillable(BillableUsageService.java:101)
      	at com.redhat.swatch.billable.usage.services.BillableUsageService_Subclass.produceMonthlyBillable$$superforward(Unknown Source)
      	at com.redhat.swatch.billable.usage.services.BillableUsageService_Subclass$$function$$1.apply(Unknown Source)
      	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:73)
      	at io.quarkus.arc.impl.AroundInvokeInvocationContext.proceed(AroundInvokeInvocationContext.java:62)
      	at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:136)
      	at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.invokeInOurTx(TransactionalInterceptorBase.java:107)
      	at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.doIntercept(TransactionalInterceptorRequired.java:38)
      	at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorBase.intercept(TransactionalInterceptorBase.java:61)
      	at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired.intercept(TransactionalInterceptorRequired.java:32)
      	at io.quarkus.narayana.jta.runtime.interceptor.TransactionalInterceptorRequired_Bean.intercept(Unknown Source)
      	at io.quarkus.arc.impl.InterceptorInvocation.invoke(InterceptorInvocation.java:42)
      	at io.quarkus.arc.impl.AroundInvokeInvocationContext.perform(AroundInvokeInvocationContext.java:30)
      	at io.quarkus.arc.impl.InvocationContexts.performAroundInvoke(InvocationContexts.java:27)
      	at com.redhat.swatch.billable.usage.services.BillableUsageService_Subclass.produceMonthlyBillable(Unknown Source)
      	at com.redhat.swatch.billable.usage.services.BillableUsageService.submitBillableUsage(BillableUsageService.java:70)
      	at com.redhat.swatch.billable.usage.services.BillableUsageService_ClientProxy.submitBillableUsage(Unknown Source)
      	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
      	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
      	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
      	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
      	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
      	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
      	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
      	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
      	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
      	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
      	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
      	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
      	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
      	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
      	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
      	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
      	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
      	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
      	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
      	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
      	at com.redhat.swatch.billable.usage.services.TallySummaryMessageConsumer.consume(TallySummaryMessageConsumer.java:61)
      

      Acceptance Criteria

      • Investigate from where the "bad" metric is coming from just in case we need to mitigate this source as well
      • Prevent the service to be restarted when invalid requests

              jcarvaja@redhat.com Jose Carvajal Hilario
              jcarvaja@redhat.com Jose Carvajal Hilario
              Aurobinda Nayak Aurobinda Nayak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: