1

After updating an app from Mule Runtime 4.4.0 to 4.6.9 an error occurs during deploy on CloudHub. ** when deployed on Studio the app runs without raising an error.

The error on CloudHub:

Your application has failed with exception java.lang.IllegalStateException: 
com.mulesoft.ch.services.agent.muleAgent.MuleAgentException: 
{
"type":"class java.lang.IllegalArgumentException",
"message":"There was an error on the Mule Runtime while deploying the application job-example. 
Error: Failed to deploy artifact [job-example]. 
NumberFormatException: For input string: \"\""}

The error after downloading the log from cloudhub:

2024-12-27 18:24:26.900 INFO    org.mule.runtime.core.internal.construct.FlowConstructLifecycleManager [ArtifactDeployer.start.01]: Starting flow: flow-trigger
2024-12-27 18:24:26.926 ERROR   org.mule.runtime.core.internal.processor.strategy.StreamEmitterProcessingStrategyFactory$StreamEmitterProcessingStrategy [ArtifactDeployer.start.01]: Exception reached PS subscriber for flow 'flow-trigger'
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'subflow01': Cannot create inner bean '(inner bean)#1ff9590d' of type [org.mule.runtime.core.internal.routing.Foreach] while setting bean property 'messageProcessors' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1ff9590d': Cannot create inner bean '(inner bean)#5930f45d' of type [org.mule.runtime.core.internal.routing.Foreach] while setting bean property 'messageProcessors' with key [3]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#5930f45d': Cannot create inner bean '(inner bean)#33016a6c' of type [org.mule.runtime.core.internal.routing.ParallelForEach] while setting bean property 'messageProcessors' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#33016a6c': Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'maxConcurrency'; nested exception is java.lang.NumberFormatException: For input string: ""
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:389)
    Suppressed: The stacktrace has been enhanced by Reactor, refer to additional information below: 
Error has been observed at the following site(s):
    *__checkpoint ⇢ flow-trigger/processors/3

The XML with a few lines of the implementation related to the error:

                <parallel-foreach
                    maxConcurrency="${scheduler.flowTrigger.parallelForEach.maxConcurrency}"
                    target="hasSecond"
                    targetValue="#[if(not isEmpty(payload.*payload) ) true else false]">
                    <ee:transform>
                        <ee:message>
                        </ee:message>
                        <ee:variables>
                            <ee:set-variable variableName="path"><![CDATA[%dw 2.0
output application/java
---
p('app.path.flowTrigger')]]></ee:set-variable>
                            <ee:set-variable variableName="method"><![CDATA[%dw 2.0
output application/java
---
"DELETE"]]></ee:set-variable>
                            <ee:set-variable variableName="uriParams"><![CDATA[%dw 2.0
output application/java
---
{
    "id"    : payload.id,
}]]></ee:set-variable>
                        </ee:variables>
                    </ee:transform>
                    <until-successful
                        maxRetries="${api.retry}"
                        millisBetweenRetries="${api.retryTime}">
                        <try>
                            <http:request
                                method="#[vars.method]"
                                config-ref="HTTP_Request_configuration_01"
                                path="#[vars.path]"
                                responseTimeout="${app.responseTimeout}"
                                sendBodyMode="NEVER">
                                <http:uri-params><![CDATA[#[vars.uriParams default {}]]]></http:uri-params>
                                <http:response-validator>
                                    <http:success-status-code-validator values="${app.successResponseCode}"/>
                                </http:response-validator>
                            </http:request>
                        </try>
                    </until-successful>
                </parallel-foreach>

The YAML config file:

api:
  retry: "3"
  retryTime: "5000" #Miliseconds

app:
  path:
    flowTrigger: "/api/v1/something"
  responseTimeout: "120000"
  successResponseCode: "200,201,400,401,404,500"

scheduler:
  flowTrigger:
    parallelForEach.maxConcurrency: ""

I need to understand the error and fix the issue.

3
  • The error is that the value for the property scheduler.flowTrigger.parallelForEach.maxConcurrency is empty, so it is not a number, as the error mentions. The error could be clearer but this is simply user mistake., not a programming issue. Commented Dec 27, 2024 at 22:54
  • I agree, but In Mule Runtime 4.4.0 empty wasn't an issue. Also, cloudhub log was helpful after downloading the log file, before that was not that clear. Commented Dec 28, 2024 at 21:49
  • That looks to be an improvement in the validation implemented after Mule 4.4. Commented Dec 29, 2024 at 2:09

1 Answer 1

2

After some analysis, it was the config property ${scheduler.flowTrigger.parallelForEach.maxConcurrency} that was empty "" and it shouldn't, or the ParallelForEach doesn't need the attribute maxConcurrency

api:
  retry: "3"
  retryTime: "5000" #Miliseconds

app:
  path:
    flowTrigger: "/api/v1/something"
  responseTimeout: "120000"
  successResponseCode: "200,201,400,401,404,500"

scheduler:
  flowTrigger:
    parallelForEach.maxConcurrency: "2"
<parallel-foreach
    target="hasSecond"
    targetValue="#[if(not isEmpty(payload.*payload) ) true else false]">                
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.