Running flink 1.16 as StandaloneApplication, check...
# troubleshooting
a
Running flink 1.16 as StandaloneApplication, checkpoints are stored in s3 bucket. But whenever i’m passing
-s <s3://bucket-name/checkpoints/000000/chk-20/>
or location to the manually created savepoint, i’m getting:
Copy code
Exception in thread "main" java.lang.NoSuchMethodError: 'boolean org.apache.commons.cli.CommandLine.hasOption(org.apache.commons.cli.Option)'
	at org.apache.flink.client.cli.CliFrontendParser.createSavepointRestoreSettings(CliFrontendParser.java:631)
	at org.apache.flink.container.entrypoint.StandaloneApplicationClusterConfigurationParserFactory.createResult(StandaloneApplicationClusterConfigurationParserFactory.java:90)
	at org.apache.flink.container.entrypoint.StandaloneApplicationClusterConfigurationParserFactory.createResult(StandaloneApplicationClusterConfigurationParserFactory.java:45)
	at org.apache.flink.runtime.entrypoint.parser.CommandLineParser.parse(CommandLineParser.java:51)
	at org.apache.flink.runtime.entrypoint.ClusterEntrypointUtils.parseParametersOrExit(ClusterEntrypointUtils.java:70)
	at org.apache.flink.container.entrypoint.StandaloneApplicationClusterEntryPoint.main(StandaloneApplicationClusterEntryPoint.java:58)
I’ve been all over documentation and feel like i’m missing something. Any help would be appreciated.
btw, whenever JM starts i see in the log:
No checkpoint found during restore.
Looked at the code, looks like it didn’t find any checkpoints, although there are at s3.
s
Looks like an issue with
org.apache.commons.cli.CommandLine
dependency.
I’d try checking dependency tree and seeing if there are any conflicts with apache commons version.
a
when i ran with
--help
the response was:
Copy code
usage: StandaloneApplicationClusterEntryPoint -c <configuration directory> [-D
       <property=value>] [-h <hostname>] [-j <job class name>] [-jid <job id>]
       [-n] [-r <rest port>] [-s <savepointPath>]
     -c,--configDir <configuration directory>   Directory which contains the
                                                configuration file
                                                flink-conf.yml.
     -D <property=value>                        use value for given property
     -h,--host <hostname>                       Hostname for the RPC service.
     -j,--job-classname <job class name>        Class name of the job to run.
     -jid,--job-id <job id>                     Job ID of the job to run.
     -n,--allowNonRestoredState                 Allow to skip savepoint state
                                                that cannot be restored. You
                                                need to allow this if you
                                                removed an operator from your
                                                program that was part of the
                                                program when the savepoint was
                                                triggered.
     -r,--webui-port <rest port>                Port for the rest endpoint and
                                                the web UI.
     -s,--fromSavepoint <savepointPath>         Path to a savepoint to restore
                                                the job from (for example
                                                hdfs:///flink/savepoint-1537).
but i’m getting
org.apache.commons.cli.CommandLine
from flink, it’s not like i’m importing in my part of code or etc.
s
if you place your jar file in
/opt/flink/lib
for example, one of your transitive dependencies might affect flink’s classpath as well
a
omg
you are right
i had a classpath collision issue couple months ago. Such a headache
r
Hi, it’s Ron from @Aviv Dozorets team. We added the dependency
Copy code
<dependency>
  <groupId>commons-cli</groupId>
  <artifactId>commons-cli</artifactId>
  <version>1.5.0</version>
</dependency>
to our pom and it solved the issue. (Just in case someone in following this thread)