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

PackagedProgram.extractContainedLibraries fails on Windows

    XMLWordPrintableJSON

    Details

      Description

      Submitting a jar that contains other jars on Windows fails with an exception:

      org.apache.flink.client.program.ProgramInvocationException: Unknown I/O error while extracting contained jar files.
              at org.apache.flink.client.program.PackagedProgram.extractContainedLibraries(PackagedProgram.java:752)
              at org.apache.flink.client.program.PackagedProgram.<init>(PackagedProgram.java:194)
              at org.apache.flink.client.cli.CliFrontend.buildProgram(CliFrontend.java:833)
              at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:201)
              at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1020)
              at org.apache.flink.client.cli.CliFrontend.lambda$main$9(CliFrontend.java:1096)
              at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
              at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1096)
      Caused by: org.apache.flink.client.program.ProgramInvocationException: An I/O error occurred while creating temporary file to extract nested library 'lib/antrunner.jar'.
              at org.apache.flink.client.program.PackagedProgram.extractContainedLibraries(PackagedProgram.java:708)
              ... 7 more
      Caused by: java.io.IOException: Unable to create temporary file, C:\Users\XXX\AppData\Local\Temp\1751416743_6922010711856647205lib\antrunner.jar
              at java.io.File$TempDirectory.generateFile(Unknown Source)
              at java.io.File.createTempFile(Unknown Source)
              at java.io.File.createTempFile(Unknown Source)
              at org.apache.flink.client.program.PackagedProgram.extractContainedLibraries(PackagedProgram.java:702)
              ... 7 more
      

      PackagedProgram.extractContainedLibraries tries to replace all path separators using the platform-dependent File.separateChar, however the path separator for jars (and zips for that matter) is always /.

      final JarEntry entry = containedJarFileEntries.get(i);
      String name = entry.getName();
      name = name.replace(File.separatorChar, '_');
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Sergey Nuyanzin Sergey Nuyanzin
                Reporter:
                chesnay Chesnay Schepler
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: