Could not build the program from JAR file

Viewed 4721

I am running Flink on local cluster, after compiling the package I ran

flink run -c com.gurustreams.flink.EntryPoint \
    /Users/jeremy.zhang/workspace/guru-streams/flink/target/scala-2.11/guru-streams-flink-assembly-0.0.1.jar \
    --stream-name KafkaReadExample

and got this error:

Could not build the program from JAR file.

I also tried to run the jar file from Flink dashboard and turned up this error:

org.apache.flink.client.program.ProgramInvocationException: The program plan could not be fetched - the program aborted pre-maturely.

System.err: (none)

System.out: (none)
2 Answers

The Flink CLI says "Could not build the program from JAR file" if a FileNotFoundException exception is thrown during the process of packaging up your JAR file along with the other things it needs from your CLASSPATH. Something appears to be misconfigured somewhere.

If you look in the logs you should find more information to help debug this.

Normally the logs will be in the log directory of your flink installation, on each node of your cluster. You can examine them using the Flink dashboard. For a local cluster, the jobmanager logs can be viewed at http://localhost:8081/#/jobmanager/log. For the taskmanagers, go to http://localhost:8081/#/taskmanagers, select a taskmanager, and then click on Logs.

When something goes wrong, it can be helpful to look at both the jobmanager and taskmanager logs for clues.

Another simple, yet overlooked possibility for this exception is simply running out of disk space, which can happen quite quickly after messing around a little bit with Flink on a small VM.

Related