AI-powered Jenkins plugin that explains pipeline and job failures with human-readable insights.
👉 Watch the hands-on demo on YouTube — setup, run, and see how AI explains your Jenkins job failures.
Tired of digging through long Jenkins logs to understand what went wrong?
Explain Error Plugin leverages AI to automatically interpret job and pipeline failures—saving you time and helping you fix issues faster.
Whether it’s a compilation error, test failure, or deployment hiccup, this plugin turns confusing logs into human-readable insights.
- 🔍 One-click error analysis on any console output
- ⚙️ Pipeline-ready with a simple
explainError()
step - 💡 AI-powered explanations via OpenAI GPT models, Google Gemini or local Ollama models
- 🤖 Smart provider management — LangChain4j handles most providers automatically
- 🎯 Customizable: set provider, model, API endpoint, log filters, and more
- Jenkins 2.479.3+
- Java 17+
- AI API Key (OpenAI or Google)
-
Install via Jenkins Plugin Manager:
- Go to
Manage Jenkins
→Manage Plugins
→Available
- Search for "Explain Error Plugin"
- Click
Install
and restart Jenkins
- Go to
-
Manual Installation:
- Download the
.hpi
file from releases - Upload via
Manage Jenkins
→Manage Plugins
→Advanced
- Download the
- Go to
Manage Jenkins
→Configure System
- Find the "Explain Error Plugin Configuration" section
- Configure the following settings:
Setting | Description | Default |
---|---|---|
Enable AI Error Explanation | Toggle plugin functionality | ✅ Enabled |
AI Provider | Choose between OpenAI, Google Gemini, or Ollama | OpenAI |
API Key | Your AI provider API key | Get from OpenAI or Google AI Studio |
API URL | AI service endpoint | Automatically handled by LangChain4j for most providers, or specify a custom endpoint such as http://localhost:11434 for Ollama. |
AI Model | Model to use for analysis | Required. Specify the model name offered by your selected AI provider |
- Click "Test Configuration" to verify your setup
- Save the configuration
This plugin supports Configuration as Code for automated setup. Use the explainError
symbol in your YAML configuration:
OpenAI Configuration:
unclassified:
explainError:
enableExplanation: true
provider: "OPENAI"
apiKey: "${AI_API_KEY}"
model: "gpt-5-nano"
Google Gemini Configuration:
unclassified:
explainError:
enableExplanation: true
provider: "GEMINI"
apiKey: "${AI_API_KEY}"
model: "gemini-2.0-flash"
Ollama Configuration:
unclassified:
explainError:
enableExplanation: true
provider: "OLLAMA"
apiUrl: "http://localhost:11434"
model: "gemma3:1b" # gpt-oss, deepseek-r1, etc
Environment Variable Example:
export AI_API_KEY="your-api-key-here"
This allows you to manage the plugin configuration alongside your other Jenkins settings in version control.
- Models:
gpt-5-nano
,gpt-4
,gpt-4-turbo
- API Key: Get from OpenAI Platform
- Endpoint: Automatically handled by LangChain4j
- Best for: Comprehensive error analysis with excellent reasoning
- Models:
gemini-2.0-flash
,gemini-2.0-pro
- API Key: Get from Google AI Studio
- Endpoint: Automatically handled by LangChain4j
- Best for: Fast, efficient analysis with competitive quality
- Models:
gemma3:1b
,gpt-oss
,deepseek-r1
, and any model available in your Ollama instance - API Key: Not required by default (unless your Ollama server is secured)
- Endpoint:
http://localhost:11434
(or your Ollama server URL) - Best for: Private, local, or open-source LLMs; no external API usage or cost
Use explainError()
in your pipeline (e.g., in a post
block):
pipeline {
agent any
stages {
stage('Build') {
steps {
script {
// Your build steps here
sh 'make build'
}
}
}
}
post {
failure {
// Automatically explain errors when build fails
explainError()
}
}
}
Optional parameters:
explainError(
maxLines: 500,
logPattern: '(?i)(error|failed|exception)'
)
Output appears in the sidebar of the failed job.
Works with Freestyle, Declarative, or any job type.
- Go to the failed build’s console output
- Click Explain Error button in the top
- View results directly under the button
Issue | Solution |
---|---|
API key not set | Add your key in Jenkins global config |
Auth or rate limit error | Check key validity, quota, and provider plan |
Button not visible | Ensure Jenkins version ≥ 2.479.3, restart Jenkins after installation |
Enable debug logs:
Manage Jenkins
→ System Log
→ Add logger for io.jenkins.plugins.explain_error
- Use
explainError()
inpost { failure { ... } }
blocks - Apply
logPattern
to focus on relevant errors - Monitor your AI provider usage to control costs
- Keep plugin updated regularly
- GitHub Issues for bug reports and feature requests
- Contributing Guide if you'd like to help
- Security concerns? Email [email protected]
Licensed under the MIT License.
Built with ❤️ for the Jenkins community. If you find it useful, please ⭐ us on GitHub!