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

usrlib is not added to classpath when using containers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.19.0
    • 1.19.1
    • flink-docker
    • None
    • Docker

    Description

      We use flink-docker to create a "standalone" application, with a Dockerfile like...
       

      FROM flink:1.18.1-java17
      COPY application.jar /opt/flink/usrlib/artifacts/
      

      However, after upgrading to 1.19.0 we found our application would not start. We saw errors like the following in the logs:

      org.apache.flink.util.FlinkException: Could not load the provided entrypoint class.
         at org.apache.flink.client.program.DefaultPackagedProgramRetriever.getPackagedProgram(DefaultPackagedProgramRetriever.java:230)
         at org.apache.flink.container.entrypoint.StandaloneApplicationClusterEntryPoint.getPackagedProgram(StandaloneApplicationClusterEntryPoint.java:149)
         at org.apache.flink.container.entrypoint.StandaloneApplicationClusterEntryPoint.lambda$main$0(StandaloneApplicationClusterEntryPoint.java:90)
         at org.apache.flink.runtime.security.contexts.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:28)
         at org.apache.flink.container.entrypoint.StandaloneApplicationClusterEntryPoint.main(StandaloneApplicationClusterEntryPoint.java:89)
         Caused by: org.apache.flink.client.program.ProgramInvocationException: The program's entry point class 'XXXXXXXXX' was not found in the jar file.
      
      .....
      
      Classpath: /opt/flink/lib/flink-cep-1.19.0.jar:/opt/flink/lib/flink-connector-files-1.19.0.jar:/opt/flink/lib/flink-csv-1.19.0.jar:/opt/flink/lib/flink-json-1.19.0.jar:/opt/flink/lib/flink-scala_2.12-1.19.0.jar:/opt/flink/lib/flink-table-api-java-uber-1.19.0.jar:/opt/flink/lib/flink-table-planner-loader-1.19.0.jar:/opt/flink/lib/flink-table-runtime-1.19.0.jar:/opt/flink/lib/log4j-1.2-api-2.17.1.jar:/opt/flink/lib/log4j-api-2.17.1.jar:/opt/flink/lib/log4j-core-2.17.1.jar:/opt/flink/lib/logback-classic-1.5.6.jar:/opt/flink/lib/logback-core-1.5.6.jar:/opt/flink/lib/slf4j-api-2.0.13.jar:/opt/flink/lib/flink-dist-1.19.0.jar::::
      

      We were able to fix the issue by placing the application.jar in /opt/flink/lib instead. My guess is that the usrlib directory isn't being added to the classpath by the shell scripts that launch flink from a container.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jenglandohalo Josh England
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: