lsergio opened a new issue, #5088:
URL: https://github.com/apache/camel-k/issues/5088

   ### What happened?
   
   Consider the following Integration spec:
   ```
   apiVersion: camel.apache.org/v1
   kind: Integration
   metadata:
     name: test-jvm
   spec:
     sources:
     - name: main.groovy
       content: |-
         from("quartz://Scheduler_Trigger?cron=*+*+*+*+*")
             .to("direct:start")
   
         from("direct:start")
           .to("https://httpbin.org/delay/2?bridgeEndpoint=true";)
           .to("log:info")
     traits:
       container:
         requestCPU: "200m"
         requestMemory: 400Mi
         limitMemory: 400Mi
       quarkus:
         buildMode:
         - jvm
       affinity:
         enabled: true
         nodeAffinityLabels:
           - "karpenter=false"
   ```
   When I apply it to my cluster, I get a CronJob that is set up with the * * * 
* * schedule, and the integration runs smoothly:
   ```
   k get cronjob
   NAME       SCHEDULE    SUSPEND   ACTIVE   LAST SCHEDULE   AGE
   test-jvm   * * * * *   False     0        25s             112s
   k get pod
   NAME                                READY   STATUS      RESTARTS   AGE
   camel-k-operator-6cbc656bbd-ntk99   1/1     Running     0          3m16s
   test-jvm-28432451-6l275             0/1     Completed   0          91s
   test-jvm-28432452-wqr55             0/1     Completed   0          31s
   ```
   
   However, If I modify this code to use native builds, as below:
   
   ```
   apiVersion: camel.apache.org/v1
   kind: Integration
   metadata:
     name: test-native
   spec:
     sources:
     - name: main.groovy
       content: |-
         from("quartz://Scheduler_Trigger?cron=*+*+*+*+*")
             .to("direct:start")
   
         from("direct:start")
           .to("https://httpbin.org/delay/2?bridgeEndpoint=true";)
           .to("log:info")
     traits:
       container:
         requestCPU: "200m"
         requestMemory: 20Mi
         limitMemory: 20Mi
       quarkus:
         buildMode:
         - native
       builder:
         properties:
         - "quarkus.native.native-image-xmx=13g"
         tasksRequestCPU:
         - "quarkus-native:8000m"
         tasksRequestMemory:
         - "quarkus-native:16Gi"
         tasksLimitMemory:
         - "quarkus-native:16Gi"
         nodeSelector:
           karpenter: "true"
       affinity:
         enabled: true
         nodeAffinityLabels:
           - "karpenter=false"
   ```
   I still get the same `CronJob`:
   ```
   k get cronjob
   NAME          SCHEDULE    SUSPEND   ACTIVE   LAST SCHEDULE   AGE
   test-native   * * * * *   False     0        <none>          11s
   ```
   But the Integration will fail to run with the following error:
   ```
   Caused by: org.apache.camel.FailedToStartRouteException: Failed to start 
route route1 because of CronExpression '* * * * *' is invalid.
        at 
org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:122)
   
   ```
   
   It seems like the scheduling is being configured at the CronJob and also at 
the application level, with quartz, where * * * * * is not a valid expression.
     
   
   
   ### Steps to reproduce
   
   _No response_
   
   ### Relevant log output
   
   ```shell
   java.lang.RuntimeException: Failed to start quarkus
        at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
        at io.quarkus.runtime.Application.start(Application.java:101)
        at 
io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
   Caused by: java.lang.RuntimeException: java.lang.RuntimeException: 
org.apache.camel.FailedToStartRouteException: Failed to start route route1 
because of CronExpression '* * * * *' is invalid.
        at 
org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:47)
        at 
io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy_0(Unknown
 Source)
        at 
io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy(Unknown
 Source)
        ... 7 more
   Caused by: java.lang.RuntimeException: 
org.apache.camel.FailedToStartRouteException: Failed to start route route1 
because of CronExpression '* * * * *' is invalid.
        at 
org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:65)
        at 
org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
        ... 9 more
   Caused by: org.apache.camel.FailedToStartRouteException: Failed to start 
route route1 because of CronExpression '* * * * *' is invalid.
        at 
org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:122)
        at 
org.apache.camel.impl.engine.InternalRouteStartupManager.doWarmUpRoutes(InternalRouteStartupManager.java:306)
        at 
org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:189)
        at 
org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRoutes(InternalRouteStartupManager.java:147)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2821)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2503)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2458)
        at 
org.apache.camel.support.service.BaseService.start(BaseService.java:113)
        at 
org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2094)
        at 
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:313)
        at org.apache.camel.quarkus.main.CamelMain.doStart(CamelMain.java:94)
        at 
org.apache.camel.support.service.BaseService.start(BaseService.java:113)
        at 
org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:140)
        at 
org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
        ... 10 more
   Caused by: java.lang.RuntimeException: CronExpression '* * * * *' is invalid.
        at 
org.quartz.CronScheduleBuilder.cronSchedule(CronScheduleBuilder.java:111)
        at 
org.apache.camel.component.quartz.QuartzEndpoint.createTrigger(QuartzEndpoint.java:497)
        at 
org.apache.camel.component.quartz.QuartzEndpoint.addJobInScheduler(QuartzEndpoint.java:373)
        at 
org.apache.camel.component.quartz.QuartzEndpoint.doStart(QuartzEndpoint.java:329)
        at 
org.apache.camel.support.service.BaseService.start(BaseService.java:113)
        at 
org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:113)
        at 
org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:183)
        at 
org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:120)
        ... 23 more
   Caused by: java.text.ParseException: Unexpected end of expression.
        at org.quartz.CronExpression.buildExpression(CronExpression.java:494)
        at org.quartz.CronExpression.<init>(CronExpression.java:276)
        at 
org.quartz.CronScheduleBuilder.cronSchedule(CronScheduleBuilder.java:107)
        ... 30 more
   ```
   
   
   ### Camel K version
   
   2.2.0


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to