Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-26333

Repeated exception with DuplicateJobSubmissionException: Job has already been submitted

    XMLWordPrintableJSON

Details

    Description

      Hello,

      Recently due to log4j vulnerabilities, we have upgraded to Apache Flink 1.14.3. What we observed we are getting following exception, and because of it pod gets in crashloopback. We have seen this issues esp. during the time of upgrade or deployment time when existing pod is already running.

      Env:

      Deployed on : k8s
      Flink version: 1.14.3
      HA using zookeeper
      

      Logs:

      2022-02-23 05:13:14.555 ERROR 45 --- [t-dispatcher-17] c.b.a.his.service.FlinkExecutorService   : Failed to execute job
      
      org.apache.flink.util.FlinkException: Failed to execute job 'events rates calculation'.
              at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.executeAsync(StreamExecutionEnvironment.java:2056) ~[flink-streaming-java_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.program.StreamContextEnvironment.executeAsync(StreamContextEnvironment.java:137) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.program.StreamContextEnvironment.execute(StreamContextEnvironment.java:76) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1917) ~[flink-streaming-java_2.12-1.14.0.jar:1.14.0]
              at com.bmc.ade.his.service.FlinkExecutorService.init(FlinkExecutorService.java:37) ~[health-service-1.0.00.jar:1.0.00]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
              at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
              at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.4.jar:5.3.4]
              at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:917) ~[spring-context-5.3.4.jar:5.3.4]
              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:582) ~[spring-context-5.3.4.jar:5.3.4]
              at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.5.jar:2.5.5]
              at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.5.jar:2.5.5]
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.5.jar:2.5.5]
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.5.jar:2.5.5]
              at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.5.jar:2.5.5]
              at com.bmc.ade.his.HealthAndImpactServiceApplication.main(HealthAndImpactServiceApplication.java:19) ~[health-service-1.0.00.jar:1.0.00]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
              at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
              at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:355) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:222) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.ClientUtils.executeProgram(ClientUtils.java:114) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.runApplicationEntryPoint(ApplicationDispatcherBootstrap.java:253) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.lambda$runApplicationAsync$1(ApplicationDispatcherBootstrap.java:216) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
              at org.apache.flink.runtime.concurrent.akka.ActorSystemScheduledExecutorAdapter$ScheduledFutureTask.run(ActorSystemScheduledExecutorAdapter.java:171) ~[na:na]
              at org.apache.flink.runtime.concurrent.akka.ClassLoadingUtils.runWithContextClassLoader(ClassLoadingUtils.java:68) ~[na:na]
              at org.apache.flink.runtime.concurrent.akka.ClassLoadingUtils.lambda$withContextClassLoader$0(ClassLoadingUtils.java:41) ~[na:na]
              at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49) ~[na:na]
              at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[na:na]
      Caused by: org.apache.flink.runtime.client.DuplicateJobSubmissionException: Job has already been submitted.
              at org.apache.flink.runtime.client.DuplicateJobSubmissionException.ofGloballyTerminated(DuplicateJobSubmissionException.java:33) ~[flink-runtime-1.14.0.jar:1.14.0]
              at org.apache.flink.runtime.dispatcher.Dispatcher.submitJob(Dispatcher.java:307) ~[flink-runtime-1.14.0.jar:1.14.0]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
              at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.lambda$handleRpcInvocation$1(AkkaRpcActor.java:316) ~[na:na]
              at org.apache.flink.runtime.concurrent.akka.ClassLoadingUtils.runWithContextClassLoader(ClassLoadingUtils.java:83) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleRpcInvocation(AkkaRpcActor.java:314) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleRpcMessage(AkkaRpcActor.java:217) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.FencedAkkaRpcActor.handleRpcMessage(FencedAkkaRpcActor.java:78) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleMessage(AkkaRpcActor.java:163) ~[na:na]
              at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:24) ~[na:na]
              at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:20) ~[na:na]
              at scala.PartialFunction.applyOrElse(PartialFunction.scala:123) ~[scala-library-2.12.10.jar:na]
              at scala.PartialFunction.applyOrElse$(PartialFunction.scala:122) ~[scala-library-2.12.10.jar:na]
              at akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:20) ~[na:na]
              at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171) ~[scala-library-2.12.10.jar:na]
              at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172) ~[scala-library-2.12.10.jar:na]
              at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172) ~[scala-library-2.12.10.jar:na]
              at akka.actor.Actor.aroundReceive(Actor.scala:537) ~[na:na]
              at akka.actor.Actor.aroundReceive$(Actor.scala:535) ~[na:na]
              at akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:220) ~[na:na]
              at akka.actor.ActorCell.receiveMessage(ActorCell.scala:580) ~[na:na]
              at akka.actor.ActorCell.invoke(ActorCell.scala:548) ~[na:na]
              at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270) ~[na:na]
              at akka.dispatch.Mailbox.run(Mailbox.scala:231) ~[na:na]
              at akka.dispatch.Mailbox.exec(Mailbox.scala:243) ~[na:na]
              ... 5 common frames omitted
      

      Subsequent logs are:

      erBootstrap : Application failed unexpectedly:
      
      java.util.concurrent.CompletionException: org.apache.flink.runtime.messages.FlinkJobNotFoundException: Could not find Flink job (00000000000000000000000000000000)
              at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331) ~[na:na]
              at java.base/java.util.concurrent.CompletableFuture.uniApplyNow(CompletableFuture.java:670) ~[na:na]
              at java.base/java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:658) ~[na:na]
              at java.base/java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:2094) ~[na:na]
              at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.unwrapJobResultException(ApplicationDispatcherBootstrap.java:338) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.lambda$getApplicationResult$3(ApplicationDispatcherBootstrap.java:294) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[na:na]
              at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[na:na]
              at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
              at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[na:na]
              at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913) ~[na:na]
              at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
              at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578) ~[na:na]
              at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.getApplicationResult(ApplicationDispatcherBootstrap.java:300) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.lambda$runApplicationAsync$2(ApplicationDispatcherBootstrap.java:227) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072) ~[na:na]
              at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[na:na]
              at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073) ~[na:na]
              at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.runApplicationEntryPoint(ApplicationDispatcherBootstrap.java:265) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at org.apache.flink.client.deployment.application.ApplicationDispatcherBootstrap.lambda$runApplicationAsync$1(ApplicationDispatcherBootstrap.java:216) ~[flink-clients_2.12-1.14.0.jar:1.14.0]
              at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
              at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
              at org.apache.flink.runtime.concurrent.akka.ActorSystemScheduledExecutorAdapter$ScheduledFutureTask.run(ActorSystemScheduledExecutorAdapter.java:171) ~[na:na]
              at org.apache.flink.runtime.concurrent.akka.ClassLoadingUtils.runWithContextClassLoader(ClassLoadingUtils.java:68) ~[na:na]
              at org.apache.flink.runtime.concurrent.akka.ClassLoadingUtils.lambda$withContextClassLoader$0(ClassLoadingUtils.java:41) ~[na:na]
              at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:49) ~[na:na]
              at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) ~[na:na]
              at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[na:na]
      Caused by: org.apache.flink.runtime.messages.FlinkJobNotFoundException: Could not find Flink job (00000000000000000000000000000000)
              at org.apache.flink.runtime.dispatcher.Dispatcher.lambda$requestJobStatus$15(Dispatcher.java:603) ~[flink-runtime-1.14.0.jar:1.14.0]
              at java.base/java.util.Optional.orElseGet(Optional.java:369) ~[na:na]
              at org.apache.flink.runtime.dispatcher.Dispatcher.requestJobStatus(Dispatcher.java:597) ~[flink-runtime-1.14.0.jar:1.14.0]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
              at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.lambda$handleRpcInvocation$1(AkkaRpcActor.java:316) ~[na:na]
              at org.apache.flink.runtime.concurrent.akka.ClassLoadingUtils.runWithContextClassLoader(ClassLoadingUtils.java:83) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleRpcInvocation(AkkaRpcActor.java:314) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleRpcMessage(AkkaRpcActor.java:217) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.FencedAkkaRpcActor.handleRpcMessage(FencedAkkaRpcActor.java:78) ~[na:na]
              at org.apache.flink.runtime.rpc.akka.AkkaRpcActor.handleMessage(AkkaRpcActor.java:163) ~[na:na]
              at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:24) ~[na:na]
              at akka.japi.pf.UnitCaseStatement.apply(CaseStatements.scala:20) ~[na:na]
              at scala.PartialFunction.applyOrElse(PartialFunction.scala:123) ~[scala-library-2.12.10.jar:na]
              at scala.PartialFunction.applyOrElse$(PartialFunction.scala:122) ~[scala-library-2.12.10.jar:na]
              at akka.japi.pf.UnitCaseStatement.applyOrElse(CaseStatements.scala:20) ~[na:na]
              at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:171) ~[scala-library-2.12.10.jar:na]
              at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172) ~[scala-library-2.12.10.jar:na]
              at scala.PartialFunction$OrElse.applyOrElse(PartialFunction.scala:172) ~[scala-library-2.12.10.jar:na]
              at akka.actor.Actor.aroundReceive(Actor.scala:537) ~[na:na]
              at akka.actor.Actor.aroundReceive$(Actor.scala:535) ~[na:na]
              at akka.actor.AbstractActor.aroundReceive(AbstractActor.scala:220) ~[na:na]
              at akka.actor.ActorCell.receiveMessage(ActorCell.scala:580) ~[na:na]
              at akka.actor.ActorCell.invoke(ActorCell.scala:548) ~[na:na]
              at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:270) ~[na:na]
              at akka.dispatch.Mailbox.run(Mailbox.scala:231) ~[na:na]
              at akka.dispatch.Mailbox.exec(Mailbox.scala:243) ~[na:na]
              ... 5 common frames omitted
      
      2022-02-23 05:13:15.497 ERROR 45 --- [t-dispatcher-17] o.a.f.r.entrypoint.ClusterEntrypoint     : Fatal error occurred in the cluster entrypoint.
      

      What would it be causing this issue during deployment time? Any assistance as a workaround would be much appreciated.

      Also, i am seeing this issue only after upgrade from 1.14.2 to 1.14.3 .

      Reason for severity is critical because in our production env we saw this issue. To get rid of, we have deleted its state from zk.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              paragsomani Parag Somani
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: