jenkinsci/jenkins · error · IOException

Failed to load: {0} ({1} {2})

Error message

Failed to load: {0} ({1} {2})

What it means

Thrown during plugin initialization when the dependencyErrors map is non-empty, meaning one or more required plugin dependencies are missing, disabled, or too old. The message is built from Messages.PluginWrapper_failed_to_load_plugin_2 (plugin long name, short name, version) followed by a newline-separated list of each specific dependency failure. This prevents a plugin from activating in a broken state.

Source

Thrown at core/src/main/java/hudson/PluginWrapper.java:1018

                if (isDependencyObsolete(d, dependency)) {
                    versionDependencyError(Messages.PluginWrapper_obsolete_2(dependency.getLongName(), dependency.getShortName(), dependency.getVersion(), d.version), dependency.getVersion(), d.version);
                } else {
                    dependencies.add(d);
                }
            }
        }
        if (!dependencyErrors.isEmpty()) {
            NOTICE.addPlugin(this);
            StringBuilder messageBuilder = new StringBuilder();
            messageBuilder.append(Messages.PluginWrapper_failed_to_load_plugin_2(getLongName(), getShortName(), getVersion())).append(System.lineSeparator());
            for (Iterator<String> iterator = dependencyErrors.keySet().iterator(); iterator.hasNext(); ) {
                String dependencyError = iterator.next();
                messageBuilder.append(" - ").append(dependencyError);
                if (iterator.hasNext()) {
                    messageBuilder.append(System.lineSeparator());
                }
            }
            throw new IOException(messageBuilder.toString());
        }
    }

    private boolean isDependencyObsolete(Dependency d, PluginWrapper dependency) {
        return ENABLE_PLUGIN_DEPENDENCIES_VERSION_CHECK && dependency.getVersionNumber().isOlderThan(new VersionNumber(d.version));
    }

    /**
     * Called when there appears to be a core or plugin version which is too old for a stated dependency.
     * Normally records an error in {@link #dependencyErrors}.
     * But if one or both versions {@link #isSnapshot}, just issue a warning (JENKINS-52665).
     */
    private void versionDependencyError(String message, String actual, String minimum) {
        if (isSnapshot(actual) || isSnapshot(minimum)) {
            LOGGER.log(WARNING, "Suppressing dependency error in {0} v{1}: {2}", new Object[] {getShortName(), getVersion(), message});
        } else {
            dependencyErrors.put(message, false);
        }

View on GitHub (pinned to 2e228ff40b)

Solutions

  1. Read the full dependency error list in the exception message — each line names the specific dependency and its problem (missing, disabled, or version too old with expected vs. actual).
  2. Install or upgrade the named dependency plugin to at least the required version listed in the error.
  3. If a dependency is disabled, re-enable it from Manage Jenkins → Manage Plugins or restart Jenkins after fixing the dependency's own failure.
  4. If version checking is blocking a legitimately-compatible snapshot, ensure at least one side is a snapshot build so the check is relaxed, or update to a release version that satisfies the constraint.
Defensive patterns

Strategy: try-catch

Validate before calling

// Before loading a plugin programmatically, verify dependencies
PluginWrapper.PluginInstance instance = ...;
for (Dependency d : plugin.getDependencies()) {
    PluginWrapper dep = jenkins.getPluginManager().getPlugin(d.shortName);
    if (dep == null) {
        throw new IllegalStateException("Missing required dependency: " + d.shortName + " >= " + d.version);
    }
    if (dep.getVersionNumber().isOlderThan(new VersionNumber(d.version))) {
        throw new IllegalStateException("Dependency " + d.shortName + " too old: have " + dep.getVersion() + " need " + d.version);
    }
}

Try / catch

try {
    pluginWrapper.resolvePluginDependencies();
} catch (IOException e) {
    // e.getMessage() contains the plugin name and each dependency error line
    LOGGER.log(Level.SEVERE, "Plugin dependency resolution failed: " + e.getMessage(), e);
    // handle: install missing deps, downgrade, or skip
}

Prevention

When it happens

Trigger: Called at the end of the dependency-resolution pass in PluginWrapper: a required dependency is not installed at all, an installed dependency is disabled (dependency.isActive() == false), or an installed dependency version is older than the version declared in this plugin's MANIFEST.MF (and version checking is enabled via ENABLE_PLUGIN_DEPENDENCIES_VERSION_CHECK). If either side is a snapshot, the error is suppressed to a warning instead (JENKINS-52665).

Common situations: Installing a new plugin .hpi/.jpi that declares a dependency on a plugin version newer than what is currently deployed; upgrading Jenkins core to a version where a previously-working plugin's transitive dependencies are no longer compatible; a dependency plugin failed to load for its own reasons, leaving this plugin's dependency unsatisfied; optional dependency exists but is disabled.

Related errors


AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14). Data as JSON: /api/errors/16de9a9d6e48e1ab. Report an issue: GitHub.