jenkinsci/jenkins · warning · Failure
{0} is not a Jenkins plugin
Error message
{0} is not a Jenkins plugin What it means
Failure thrown when a file upload during plugin installation does not have a .jpi or .hpi extension. The message comes from hudson.model.Messages.Hudson_NotAPlugin. Jenkins only accepts Jenkins Plugin Interface (.jpi) or legacy Hudson Plugin Interface (.hpi) archives.
Source
Thrown at core/src/main/java/hudson/PluginManager.java:1944
List<DiskFileItem> items = upload.parseRequest(req);
String string = items.get(1).getString();
if (string != null && !string.isBlank()) {
// this is a URL deployment
fileName = string;
copier = new UrlPluginCopier(fileName);
} else {
// this is a file upload
FileItem fileItem = items.getFirst();
fileName = Util.getFileName(fileItem.getName());
copier = new FileUploadPluginCopier(fileItem);
}
if ("".equals(fileName)) {
return new HttpRedirect("advanced");
}
// we allow the upload of the new jpi's and the legacy hpi's
if (!fileName.endsWith(".jpi") && !fileName.endsWith(".hpi")) {
throw new Failure(hudson.model.Messages.Hudson_NotAPlugin(fileName));
}
// first copy into a temporary file name
File t = File.createTempFile("uploaded", ".jpi", tmpDir);
tmpDir.deleteOnExit();
t.deleteOnExit();
// TODO Remove this workaround after FILEUPLOAD-293 is resolved.
Files.delete(Util.fileToPath(t));
try {
copier.copy(t);
} catch (Exception e) {
// Exception thrown is too generic so at least limit the scope where it can occur
throw new ServletException(e);
}
copier.cleanup();
final String baseName = identifyPluginShortName(t);
View on GitHub (pinned to 2e228ff40b)
Solutions
- Ensure the uploaded file is a valid Jenkins plugin archive (.jpi).
- If building a custom plugin, run 'mvn hpi:hpi' or 'mvn package' to produce the .hpi/.jpi.
- Validate the file extension before uploading in automation scripts.
Example fix
// before
File file = new File("my-plugin.zip");
// upload fails: not a Jenkins plugin
// after
File file = new File("my-plugin.jpi");
// ensure it was built with: mvn hpi:hpi Defensive patterns
Strategy: validation
Validate before calling
if (!fileName.endsWith(".jpi") && !fileName.endsWith(".hpi")) {
throw new IllegalArgumentException("File must be a .jpi or .hpi plugin archive: " + fileName);
} Type guard
public static boolean isJenkinsPluginArchive(String fileName) {
return fileName != null && (fileName.endsWith(".jpi") || fileName.endsWith(".hpi"));
} Prevention
- Only upload .jpi or .hpi files through the plugin upload form.
- Build plugins with 'mvn hpi:hpi' to produce the correct archive format.
- Validate file extension in automation scripts before upload.
When it happens
Trigger: Uploading a file via the plugin upload form (doUpload) where the filename does not end in .jpi or .hpi — e.g., .zip, .jar, .tar.gz, or a file with no extension.
Common situations: A user accidentally uploads a generic JAR, ZIP, or the wrong file type through the Advanced > Upload Plugin form; or an automated deployment script sends the wrong archive.
Related errors
- Ambiguous plugin: {0}
- No such plugin: {0}
- Malformed plugin attribute: {0}
- Null value not allowed as an environment variable: ${key}
- invalid iconSize
AI-assisted analysis of jenkinsci/jenkins@2e228ff40b (2026-08-14).
Data as JSON: /api/errors/e324f657dcbc87b6.
Report an issue: GitHub.