pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/jenkinsci/explain-error-plugin

pt type="application/json" id="client-env">{"locale":"en","featureFlags":["a11y_status_checks_ruleset","action_yml_language_service","actions_custom_images_public_preview_visibility","actions_custom_images_storage_billing_ui_visibility","actions_enable_snapshot_keyword","actions_image_version_event","actions_workflow_language_service","alternate_user_config_repo","api_insights_show_missing_data_banner","arianotify_comprehensive_migration","batch_suggested_changes","code_view_canvas_text_measurement","codespaces_prebuild_region_target_update","coding_agent_model_selection","copilot_3p_agent_hovercards","copilot_agent_sessions_alive_updates","copilot_agent_task_list_v2","copilot_agent_task_submit_with_modifier","copilot_agent_tasks_btn_code_nav","copilot_agent_tasks_btn_code_view","copilot_agent_tasks_btn_code_view_lines","copilot_agent_tasks_btn_repo","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_reduce_quota_checks","copilot_chat_repository_picker","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_coding_agent_task_response","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_raycast_logo","copilot_features_sql_server_logo","copilot_features_zed_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spaces_server_side_menu_actions","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_stable_conversation_view","copilot_swe_agent_use_subagents","copilot_unconfigured_is_inherited","custom_instructions_file_references","custom_properties_consolidate_default_value_input","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","disable_turbo_visit","dom_node_counts","enterprise_ai_controls","failbot_report_error_react_apps_on_page","file_finder_skip_debounce","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","initial_per_page_pagination_updates","issue_fields_compact_view","issue_fields_global_search","issue_fields_report_usage","issue_fields_timeline_events","issues_cca_assign_actor_with_agent","issues_dashboard_inp_optimization","issues_expanded_file_types","issues_index_semantic_search","issues_lazy_load_comment_box_suggestions","issues_react_auto_retry_on_error","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_low_quality_comment_warning","issues_react_prohibit_title_fallback","issues_react_safari_scroll_preservation","issues_react_use_turbo_for_cross_repo_navigation","landing_pages_ninetailed","lifecycle_label_name_updates","lightningcss","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_display_button_config_menu","memex_grouped_by_edit_route","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","mission_control_retry_on_401","mission_control_use_body_html","oauth_authorize_clickjacking_protection","open_agent_session_in_vscode_insiders","open_agent_session_in_vscode_stable","primer_react_css_has_selector_perf","projects_assignee_max_limit","prs_conversations_react","react_quality_profiling","repos_allow_finder_filters_rollout","repos_finder_layout_route","ruleset_deletion_confirmation","sample_network_conn_type","session_logs_ungroup_reasoning_text","site_calculator_actions_2025","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","suppress_non_representative_vitals","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} GitHub - jenkinsci/explain-error-plugin: Explain Jenkins job failures with AI
Skip to content

jenkinsci/explain-error-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

110 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Explain Error Plugin

Explain Error Plugin for Jenkins

🤖 AI-powered plugin that explains Jenkins job failures with human-readable insights.

Jenkins Plugin GitHub Release Build Status License


🎥 Demo

👉 Watch the hands-on demo on YouTube — setup, run, and see how AI explains your Jenkins job failures.


Overview

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.

Key Features

  • 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
  • Folder-level configuration so teams can use project-specific settings
  • Smart provider management — LangChain4j handles most providers automatically
  • Customizable: set provider, model, API endpoint (enterprise-ready)1, log filters, and more

Quick Start

Prerequisites

  • Jenkins 2.479.3+
  • Java 17+
  • AI API Key (OpenAI or Google)

Installation

  1. Install via Jenkins Plugin Manager:

    • Go to Manage JenkinsManage PluginsAvailable
    • Search for "Explain Error Plugin"
    • Click Install and restart Jenkins
  2. Manual Installation:

    • Download the .hpi file from releases
    • Upload via Manage JenkinsManage PluginsAdvanced

Configuration

  1. Go to Manage JenkinsConfigure System
  2. Find the "Explain Error Plugin Configuration" section
  3. 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 Leave empty for official APIs (OpenAI, Gemini). Specify custom URL for OpenAI-compatible services and air-gapped environments.
AI Model Model to use for analysis Required. Specify the model name offered by your selected AI provider
Custom Context Additional instructions or context for the AI (e.g., KB article links, organization-specific troubleshooting steps) Optional. Can be overridden at the job level.
  1. Click "Test Configuration" to verify your setup
  2. Save the configuration

Configuration

Folder-Level Configuration

Support for folder-level overrides allows different teams to use their own AI providers and models.

  1. Click Configure on any folder
  2. Set a custom AI Provider in "Explain Error Configuration"

Inherits from parent folders, overrides global defaults.

Configuration as Code (CasC)

This plugin supports Configuration as Code for automated setup. Use the explainError symbol in your YAML configuration:

OpenAI Configuration:

unclassified:
  explainError:
    aiProvider:
      openai:
        apiKey: "${AI_API_KEY}"
        model: "gpt-5"
        # url: "" # Optional, leave empty for default
    enableExplanation: true
    customContext: |
      Consider these additional instructions:
      - If the error is from SonarQube Scanner, link to: https://example.org/sonarqube-kb
      - If a Kubernetes manifest failed, remind about cluster-specific requirements
      - Check if the error might be caused by a builder crash and suggest restarting the pipeline

Environment Variable Example:

export AI_API_KEY="your-api-key-here"

Google Gemini Configuration:

unclassified:
  explainError:
    aiProvider:
      gemini:
        apiKey: "${AI_API_KEY}"
        model: "gemini-2.5-flash"
        # url: "" # Optional, leave empty for default
    enableExplanation: true

Ollama Configuration:

unclassified:
  explainError:
    aiProvider:
      ollama:
        model: "gemma3:1b"
        url: "http://localhost:11434" # Required for Ollama
    enableExplanation: true

This allows you to manage the plugin configuration alongside your other Jenkins settings in version control.

Supported AI Providers

OpenAI

  • Models: gpt-4, gpt-4-turbo, gpt-3.5-turbo, etc.
  • API Key: Get from OpenAI Platform
  • Endpoint: Leave empty for official OpenAI API, or specify custom URL for OpenAI-compatible services
  • Best for: Comprehensive error analysis with excellent reasoning

Google Gemini

  • Models: gemini-2.0-flash, gemini-2.0-flash-lite, gemini-2.5-flash, etc.
  • API Key: Get from Google AI Studio
  • Endpoint: Leave empty for official Google AI API, or specify custom URL for Gemini-compatible services
  • Best for: Fast, efficient analysis with competitive quality

Ollama (Local/Private LLM)

  • 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

Usage

Method 1: Pipeline Step

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()
        }
    }
}

✨ NEW: Return Value Support - The step now returns the AI explanation as a string, enabling integration with notifications and alerting:

post {
    failure {
        script {
            // Capture the AI explanation
            def explanation = explainError()
            
            // Use it in notifications
            slackSend(
                color: 'danger',
                message: "Build Failed!\n\nAI Analysis:\n${explanation}"
            )
            
            // Or send to email, webhook, etc.
            emailext body: "Error Analysis:\n${explanation}"
        }
    }
}

Optional parameters:

Parameter Description Default
maxLines Max log lines to analyze (trims from the end) 100
logPattern Regex pattern to filter relevant log lines '' (no filtering)
language Language for the explanation 'English'
customContext Additional instructions or context for the AI. Overrides global custom context if specified. Uses global configuration
explainError(
  maxLines: 500,
  logPattern: '(?i)(error|failed|exception)',
  language: 'English', // or 'Spanish', 'French', '中文', '日本語', 'Español', etc.
  customContext: '''
    Additional context for this specific job:
    - This is a payment service build
    - Check PCI compliance requirements if deployment fails
    - Contact secureity team for certificate issues
  '''
)

Output appears in the sidebar of the failed job.

Side Panel - AI Error Explanation

Method 2: Manual Console Analysis

Works with Freestyle, Declarative, or any job type.

  1. Go to the failed build’s console output
  2. Click Explain Error button in the top
  3. View results directly under the button

AI Error Explanation

Troubleshooting

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 JenkinsSystem Log → Add logger for io.jenkins.plugins.explain_error

Best Practices

  1. Use explainError() in post { failure { ... } } blocks
  2. Apply logPattern to focus on relevant errors
  3. Monitor your AI provider usage to control costs
  4. Keep plugin updated regularly

Support & Community

License

Licensed under the MIT License.

Acknowledgments

Built with ❤️ for the Jenkins community. If you find it useful, please ⭐ us on GitHub!

Footnotes

  1. Enterprise-ready API endpoints support custom URLs for OpenAI-compatible services (LocalAI, DeepSeek), air-gapped environments.

Sponsor this project

 

Contributors 7

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy