Unlock Instant AI Debugging with Jenkins’ New Explain Error Plugin
The Explain Error Plugin adds an AI‑powered button to Jenkins build logs that automatically sends failure details to OpenAI for analysis, offering a one‑click error explanation via the explainError() pipeline step, with configurable models, API keys, and support for both pipeline and freestyle jobs.
Plugin Overview
The Explain Error Plugin is an OpenAI‑based Jenkins extension that automatically parses failed build logs and generates readable error explanations. It works with both Pipeline and Freestyle jobs.
One‑click analysis of console output errors.
Pipeline support via the explainError() step.
AI‑driven explanations using OpenAI GPT models.
Two Web UI views for AI results.
Customizable settings: model, API endpoint, log filters, etc.
Key Features
Console button “Explain Error” added to the top of the build page.
Pipeline step explainError() can be triggered on failure.
Supports model selection (e.g., GPT‑3.5‑turbo).
Configuration as Code (CasC) compatible.
Log filtering with regular expressions.
Prerequisites
Jenkins version ≥ 2.479.3
Java version ≥ 17
OpenAI API key
Installation
Install via Jenkins Plugin Manager: Manage Jenkins → Manage Plugins → Available → Search “Explain Error Plugin” .
Configuration
After installation, go to Manage Jenkins → Configure System and locate “Explain Error Plugin Configuration” to set the OpenAI API key, API URL (default https://api.openai.com/v1/chat/completions), and model (default gpt-3.5-turbo).
Configuration can also be managed with Jenkins Configuration as Code, for example:
unclassified:
explainError:
enableExplanation: true
apiKey: "${AI_API_KEY}"
apiUrl: "https://api.openai.com/v1/chat/completions"
model: "gpt-3.5-turbo"Usage
In a Pipeline
Place the step inside a post { failure { … } } block to trigger analysis on failure:
post {
failure {
explainError()
}
}You can also specify maximum lines and a log pattern:
explainError(
maxLines: 500,
logPattern: '(?i)(error|failed|exception)'
)In the Console
Open the failed build’s console output, click the “Explain Error” button at the top, and view the AI‑generated analysis below the button.
Future Plans
Error caching to avoid duplicate OpenAI calls.
Support for additional AI models such as Google Gemini, Claude, DeepSeek.
Conclusion
The plugin is fully open source; contributions are welcome via its GitHub repository.
GitHub: https://github.com/jenkinsci/explain-error-plugin
DevOps Engineer
DevOps engineer, Pythonista and FOSS contributor. Created cpp-linter, commit-check, etc.; contributed to PyPA.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
