apache/seatunnel · warning

Remove invalid jar when inject jars into config

Error message

Remove invalid jar when inject jars into config: {}

What it means

FlinkExecution.injectJarsToConfig filters the jar URL list before injecting plugin jars into the job config: any URL whose backing file does not exist on the local filesystem is dropped with this warning. This prevents Flink from failing later on a missing classpath entry, but means a requested jar is silently excluded from the job.

Solutions

  1. Run sh bin/install-plugin.sh (matching version) to restore missing connector jars under connectors/.
  2. Verify each referenced jar path exists on the machine submitting the job (ls the path from the warning).
  3. Correct or remove the stale jar entry from the config/plugin settings.

Example fix

// before (config references missing jar)
jarPaths = "/opt/seatunnel/connectors/connector-fake-2.3.x.jar"
// after
jarPaths = "/opt/seatunnel/connectors/connector-console-2.3.x.jar"  // path verified to exist
Defensive patterns

Strategy: validation

Validate before calling

for (String jar : jarPaths.split(";")) {
    if (!new java.io.File(jar).exists()) {
        throw new IllegalStateException("Missing jar: " + jar);
    }
}

Prevention

When it happens

Trigger: registerPlugin -> injectJarsToConfig iterates jar URLs (e.g. from the plugin directory or configured jar list) and a file was deleted, moved, or the URL path does not resolve on the driver node (e.g. cluster vs local path mismatch).

Common situations: Plugin directory incomplete after install-plugin.sh; jars referenced from a node where they were not shipped; typos in jar paths; stale URLs after an upgrade that changed connector artifact names.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/92659ceb4fc1666a. Report an issue: GitHub.

Appendix: source

Thrown at seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/execution/FlinkExecution.java:214

        jarPaths.addAll(jarDependencies);
    }

    private Config registerPlugin(Config config, Collection<URL> jars) {
        config =
                this.injectJarsToConfig(
                        config, ConfigUtil.joinPath("env", "pipeline", "jars"), jars);
        return this.injectJarsToConfig(
                config, ConfigUtil.joinPath("env", "pipeline", "classpaths"), jars);
    }

    private Config injectJarsToConfig(Config config, String path, Collection<URL> jars) {
        List<URL> validJars = new ArrayList<>();
        for (URL jarUrl : jars) {
            if (new File(jarUrl.getFile()).exists()) {
                validJars.add(jarUrl);
                LOGGER.info("Inject jar to config: {}", jarUrl);
            } else {
                LOGGER.warn("Remove invalid jar when inject jars into config: {}", jarUrl);
            }
        }

        if (config.hasPath(path)) {
            Set<URL> paths =
                    Arrays.stream(config.getString(path).split(";"))
                            .map(
                                    uri -> {
                                        try {
                                            return new URL(uri);
                                        } catch (MalformedURLException e) {
                                            throw new RuntimeException(
                                                    "the uri of jar illegal:" + uri, e);
                                        }
                                    })
                            .collect(Collectors.toSet());
            paths.addAll(validJars);

View on GitHub (pinned to cf67b549a7)