org.pentaho.reporting.libraries.formula.EvaluationException: LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error}

Pentaho BI Platform Tracking | Ariel Scarpinelli | 3 years ago
  1. 0

    When an error occurs in a Formula step execution, an stack trace is shown on the log. For instance for the attached KTR file, the log shows: ERROR 16-12 15:46:24,918 - Formula - Unexpected error ERROR 16-12 15:46:24,919 - Formula - org.pentaho.di.core.exception.KettleValueException: org.pentaho.reporting.libraries.formula.EvaluationException: LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} at org.pentaho.di.trans.steps.formula.Formula.calcFields(Formula.java:237) at org.pentaho.di.trans.steps.formula.Formula.processRow(Formula.java:104) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:50) at java.lang.Thread.run(Thread.java:724) Caused by: org.pentaho.reporting.libraries.formula.EvaluationException: LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} at org.pentaho.reporting.libraries.formula.EvaluationException.getInstance(EvaluationException.java:70) at org.pentaho.reporting.libraries.formula.util.NumberUtil.divide(NumberUtil.java:145) at org.pentaho.reporting.libraries.formula.operators.DivideOperator.evaluate(DivideOperator.java:43) at org.pentaho.reporting.libraries.formula.operators.AbstractNumericOperator.evaluate(AbstractNumericOperator.java:66) at org.pentaho.reporting.libraries.formula.lvalues.Term.evaluate(Term.java:63) at org.pentaho.di.trans.steps.formula.Formula.calcFields(Formula.java:152) ... 3 more This error dump doesn't give any clue of which of the different calculated fields in the same formula step is the one that is giving the error. In the example there are two of them. The only way to determine which is the faulty one is to separate all the fields on a different formula step. The request is to add the field name to the ERROR log and possibly the formula definition, like this: ERROR 16-12 15:46:24,918 - Formula - Field "paid_percentage" defined as [amount_due] / [amount_paid] generated an error. ERROR 16-12 15:46:24,919 - Formula - org.pentaho.di.core.exception.KettleValueException: ... Ideally it would also print the values of the formula parameters like this: ERROR 16-12 15:46:24,918 - Formula - Field "paid_percentage" defined as [amount_due] / [amount_paid] with (amount_due = 0, amount_paid = 0) generated an error. ERROR 16-12 15:46:24,919 - Formula - org.pentaho.di.core.exception.KettleValueException:

    Pentaho BI Platform Tracking | 3 years ago | Ariel Scarpinelli
    org.pentaho.reporting.libraries.formula.EvaluationException: LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error}
  2. 0

    When an error occurs in a Formula step execution, an stack trace is shown on the log. For instance for the attached KTR file, the log shows: ERROR 16-12 15:46:24,918 - Formula - Unexpected error ERROR 16-12 15:46:24,919 - Formula - org.pentaho.di.core.exception.KettleValueException: org.pentaho.reporting.libraries.formula.EvaluationException: LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} at org.pentaho.di.trans.steps.formula.Formula.calcFields(Formula.java:237) at org.pentaho.di.trans.steps.formula.Formula.processRow(Formula.java:104) at org.pentaho.di.trans.step.RunThread.run(RunThread.java:50) at java.lang.Thread.run(Thread.java:724) Caused by: org.pentaho.reporting.libraries.formula.EvaluationException: LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} at org.pentaho.reporting.libraries.formula.EvaluationException.getInstance(EvaluationException.java:70) at org.pentaho.reporting.libraries.formula.util.NumberUtil.divide(NumberUtil.java:145) at org.pentaho.reporting.libraries.formula.operators.DivideOperator.evaluate(DivideOperator.java:43) at org.pentaho.reporting.libraries.formula.operators.AbstractNumericOperator.evaluate(AbstractNumericOperator.java:66) at org.pentaho.reporting.libraries.formula.lvalues.Term.evaluate(Term.java:63) at org.pentaho.di.trans.steps.formula.Formula.calcFields(Formula.java:152) ... 3 more This error dump doesn't give any clue of which of the different calculated fields in the same formula step is the one that is giving the error. In the example there are two of them. The only way to determine which is the faulty one is to separate all the fields on a different formula step. The request is to add the field name to the ERROR log and possibly the formula definition, like this: ERROR 16-12 15:46:24,918 - Formula - Field "paid_percentage" defined as [amount_due] / [amount_paid] generated an error. ERROR 16-12 15:46:24,919 - Formula - org.pentaho.di.core.exception.KettleValueException: ... Ideally it would also print the values of the formula parameters like this: ERROR 16-12 15:46:24,918 - Formula - Field "paid_percentage" defined as [amount_due] / [amount_paid] with (amount_due = 0, amount_paid = 0) generated an error. ERROR 16-12 15:46:24,919 - Formula - org.pentaho.di.core.exception.KettleValueException:

    Pentaho BI Platform Tracking | 3 years ago | Ariel Scarpinelli
    org.pentaho.reporting.libraries.formula.EvaluationException: LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error} LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error}

    Root Cause Analysis

    1. org.pentaho.reporting.libraries.formula.EvaluationException

      LibFormulaErrorValue{errorCode=503, errorMessage=Arithmetic Error}

      at org.pentaho.reporting.libraries.formula.EvaluationException.getInstance()
    2. org.pentaho.reporting
      Term.evaluate
      1. org.pentaho.reporting.libraries.formula.EvaluationException.getInstance(EvaluationException.java:70)
      2. org.pentaho.reporting.libraries.formula.util.NumberUtil.divide(NumberUtil.java:145)
      3. org.pentaho.reporting.libraries.formula.operators.DivideOperator.evaluate(DivideOperator.java:43)
      4. org.pentaho.reporting.libraries.formula.operators.AbstractNumericOperator.evaluate(AbstractNumericOperator.java:66)
      5. org.pentaho.reporting.libraries.formula.lvalues.Term.evaluate(Term.java:63)
      5 frames
    3. org.pentaho.di
      RunThread.run
      1. org.pentaho.di.trans.steps.formula.Formula.calcFields(Formula.java:152)
      2. org.pentaho.di.trans.steps.formula.Formula.processRow(Formula.java:104)
      3. org.pentaho.di.trans.step.RunThread.run(RunThread.java:50)
      3 frames
    4. Java RT
      Thread.run
      1. java.lang.Thread.run(Thread.java:724)
      1 frame