Your Jenkins build didn't trigger, and you have no idea why. You're not alone. I've lost count of how many times I've seen engineers stare at a green "Last Poll" timestamp, convinced the system is broken, only to discover the SCM polling configuration was silently failing for weeks. Jenkins PollSCM remains one of the most misunderstood—yet persistently relevant—build triggers in the CI/CD ecosystem. Even in 2026, with webhooks dominating the conversation, PollSCM quietly powers thousands of pipelines, especially in enterprise environments with strict network policies. This guide walks you through everything: how SCM polling actually works, how to configure it correctly, why it might fail, and when you should ditch it for a webhook.
What Is Jenkins PollSCM and How Does SCM Polling Work?
At its core, Jenkins PollSCM is a build trigger that periodically checks your source code repository for changes. If it detects a new commit, it kicks off a build. If nothing changed, it goes back to sleep. Simple, right? But the underlying mechanics are worth understanding before you start tweaking schedules.
The Core Mechanism Behind PollSCM
Here's the flow in its simplest form:
Developer commits → Jenkins polls → Change detected → Build triggered
When Jenkins polls, it doesn't download the entire repository. Instead, it compares the current state of the remote repository against the last known state it recorded. For Git, this typically means fetching the latest commit hash from the remote branch. If the hash differs from what Jenkins saw last time, it triggers a build. If they match, nothing happens.
This works across Git, SVN, Mercurial, and other SCM plugins, though the exact implementation varies. The Git plugin, for instance, uses git ls-remote to check for changes without performing a full fetch—a lightweight operation that keeps resource usage relatively low.
One thing I've learned the hard way: PollSCM doesn't work well with repositories that have frequent force-pushes or rewritten history. The hash comparison can miss changes if the remote branch is force-pushed to the same commit. It's a rare edge case, but worth knowing.
PollSCM vs. Build Periodically: Key Differences
This is the most common confusion I encounter. "Build Periodically" and "Poll SCM" look similar in the Jenkins UI, but they behave fundamentally differently.
| Trigger Type | When It Runs | Resource Usage | Best Use Case |
|---|---|---|---|
| Poll SCM | Only when changes are detected in the repository | Low—polls are lightweight, but they still consume CPU/network | Projects with infrequent commits where you want to avoid unnecessary builds |
| Build Periodically | On a fixed schedule, regardless of changes | Higher—builds run even when nothing changed | Scheduled maintenance tasks, nightly integration tests, report generation |
| The distinction matters more than most people think. I've seen teams configure "Build Periodically" thinking they were polling, then wonder why Jenkins was running builds every hour with zero new commits. If you want builds only when code changes, PollSCM is your answer. If you need a build at 2 AM every day regardless of what happened, use Build Periodically. |
How to Configure Jenkins PollSCM Schedule with Cron Expressions
Setting up PollSCM is straightforward, but the cron syntax trips up more people than you'd expect. Let me walk you through both the UI and Pipeline approaches.
Step-by-Step: Setting Up PollSCM in the Jenkins UI
-
Navigate to the job's Configure page — From the Jenkins dashboard, click on your job, then select "Configure" from the left sidebar.
-
Scroll to the "Build Triggers" section — This is where all trigger options live.
-
Check the "Poll SCM" checkbox — You'll see a text field labeled "Schedule" appear below it.
-
Enter your cron schedule — For example,
H/5 * * * *polls every 5 minutes. TheHsymbol is Jenkins' way of spreading load—it hashes the job name to determine a random offset within the specified period. This prevents all jobs from polling at exactly the same second, which would spike server load. -
Save and verify — Click "Save," then check the job's status page. You should see a "Poll SCM" link in the left sidebar with a timestamp showing when the last poll occurred.
A quick tip: if you're testing, start with * * * * * (every minute) to verify the configuration works, then adjust to a less aggressive schedule.
Declarative vs. Scripted Pipeline: PollSCM in Jenkinsfile
If you're using Pipeline jobs, you'll configure PollSCM directly in your Jenkinsfile. Here's how:
Declarative Pipeline:
pipeline {
agent any
triggers {
pollSCM('H/5 * * * *')
}
stages {
stage('Build') {
steps {
echo 'Building...'
}
}
}
}
Scripted Pipeline:
properties([
pipelineTriggers([
pollSCM('H/5 * * * *')
])
])
node {
stage('Build') {
echo 'Building...'
}
}
The syntax is similar, but there's a subtle difference: in declarative pipelines, the triggers block must appear at the top level, not inside a stage. I've seen this mistake cause silent failures—the pipeline runs fine, but the trigger never activates.
One more pitfall: if you're using a Multibranch Pipeline, PollSCM configured in the Jenkinsfile applies to all branches. You can't selectively enable it for specific branches without additional logic in your Jenkinsfile.
Cron Expression Cheat Sheet for Common Polling Frequencies
Here's a quick reference for the schedules I use most often:
| Cron Expression | Description |
|---|---|
* * * * * | Every minute (use for testing only) |
H/5 * * * * | Every 5 minutes |
H/15 * * * * | Every 15 minutes |
H * * * * | Once per hour |
H 0 * * * | Once per day at midnight |
H H(0-7) * * * | Once per day between midnight and 7 AM |
The H symbol is Jenkins' way of avoiding the "thundering herd" problem. If you have 50 jobs all configured to poll at * * * * *, they'll all hit the SCM at the same second. With H/5 * * * *, each job gets a random offset within each 5-minute window, spreading the load. |
Jenkins PollSCM Not Triggering? A Practical Troubleshooting Guide
This is the section I wish I'd had years ago. When PollSCM fails, it fails silently—no error messages, no alerts, just a build that never starts. Here's how to diagnose it systematically.
Check the PollSCM Log: Your First Diagnostic Step
Before you change anything, look at the logs. From your job's status page, click "Poll SCM" in the left sidebar. You'll see a log output that looks something like this:
Started on Feb 14, 2026 3:45:00 PM
Using strategy: Default
[poll] Last Built Revision: Revision 1234abcd (origin/main)
Found 1 remote revision on branch 'main'
Changes found
Or, if nothing changed:
Started on Feb 14, 2026 3:45:00 PM
Using strategy: Default
[poll] Last Built Revision: Revision 1234abcd (origin/main)
No changes
The "Last Poll" timestamp on the job's status page tells you when the last poll occurred. If that timestamp is old—say, hours ago when you configured polling every 5 minutes—something is preventing the poll from running at all.
Common Causes and Fixes for PollSCM Failures
Here are the top five issues I've encountered in production, ranked by frequency:
1. Authentication failures. This is the most common culprit. Jenkins needs valid credentials to access your SCM repository. If your SSH keys expired or your username/password changed, polls will fail silently. Check the Poll SCM log for messages like Authentication failed or Permission denied. Fix: Update the credentials in Jenkins under "Manage Jenkins" → "Credentials."
2. Incorrect cron expression syntax. A typo in your cron expression can cause Jenkins to ignore the schedule entirely. I once spent an hour debugging a configuration that had H/5 * * * * instead of H/5 * * * *—a missing space that made the expression invalid. Fix: Use Jenkins' built-in cron validation (the question mark icon next to the schedule field) to verify your syntax.
3. SCM plugin version incompatibility. After a Jenkins upgrade, I've seen Git plugin versions that break PollSCM. The plugin might fail to initialize the polling mechanism without throwing an obvious error. Fix: Check your plugin versions and update to the latest stable releases.
4. Network issues or firewall blocking SCM access. If Jenkins can't reach your SCM server, polls will fail. This is especially common in Dockerized environments where DNS resolution breaks. Fix: Test connectivity from the Jenkins host using git ls-remote or curl to verify network access.
5. Multibranch pipeline limitations. PollSCM in Multibranch pipelines has known quirks. The trigger might not work as expected if your Jenkinsfile is in a different repository than the code you're building. Fix: Consider using a separate polling job that triggers your main pipeline, or switch to webhooks.
PollSCM Timeout Issues: How to Diagnose and Resolve
Large repositories can cause polling timeouts. When Jenkins polls, it needs to contact the SCM server and retrieve the latest commit information. If your repository has thousands of branches or a slow network connection, this can exceed Jenkins' default timeout.
You can increase the timeout in Jenkins' global configuration: Navigate to "Manage Jenkins" → "Configure System" → "SCM Polling" and adjust the timeout value. The default is typically 300 seconds, but I've seen environments where 600 seconds was necessary.
The trade-off is real: longer timeouts mean polls can overlap, causing resource contention. If you're consistently hitting timeouts, consider whether PollSCM is the right choice for your repository size.
Jenkins PollSCM vs. Webhook: Which Trigger Should You Choose in 2026?
This debate has been going on for years, and the answer hasn't changed fundamentally—but the context has. Webhooks are more popular than ever, yet PollSCM still has its place.
Latency and Resource Consumption: A Data-Driven Comparison
Let's put some numbers on this:
| Metric | PollSCM | Webhook |
|---|---|---|
| Trigger latency | 0–5 minutes (depends on polling interval) | <1 second |
| Idle resource usage | 12 polls/hour (for 5-min interval), each consuming CPU/network | 0 requests when no events occur |
| Setup complexity | Simple—just a cron expression | Moderate—requires SCM-side configuration |
| Reliability | Depends on Jenkins being up and network connectivity | Depends on SCM server successfully sending the webhook |
| The latency difference is the most obvious trade-off. With a 5-minute polling interval, your build could start up to 5 minutes after a commit. For most teams, that's acceptable. For teams practicing continuous deployment with strict SLA requirements, it's not. |
Resource consumption is subtler. Each poll is a lightweight operation—git ls-remote for Git repositories—but it's not free. If you have 100 jobs polling every 5 minutes, that's 1,200 polls per hour hitting your SCM server. Webhooks, by contrast, send a single HTTP request per event.
When to Use PollSCM Over Webhooks (and Vice Versa)
Here's my practical decision framework:
Use PollSCM when:
- Your SCM doesn't support webhooks (some self-hosted Git servers don't)
- Your SCM is behind a firewall that blocks inbound connections
- You need a simple setup with minimal moving parts
- You're dealing with legacy infrastructure where webhook configuration is impractical
Use Webhooks when:
- You need real-time feedback for critical builds
- You're using GitHub, GitLab, or Bitbucket (all support webhooks natively)
- You want to minimize server load
- You have many jobs polling the same repository
A hybrid approach works well too: use a webhook as your primary trigger, with PollSCM as a fallback. If the webhook fails for any reason—network issues, SCM server misconfiguration—the polling mechanism catches the change within its interval. I've implemented this pattern for several clients, and it provides excellent resilience without sacrificing real-time triggering.
Advanced PollSCM Best Practices for Large Teams and Complex Pipelines
If you've made it this far, you're probably running PollSCM at scale. Here's how to keep it from becoming a bottleneck.
Optimizing Polling Frequency to Reduce Server Load
The H symbol is your friend. I've seen teams configure */5 * * * * for dozens of jobs, causing a spike in SCM server load every 5 minutes. Switching to H/5 * * * * spreads those polls across the 5-minute window, smoothing out the load curve.
For non-critical jobs, consider increasing the polling interval. A nightly build doesn't need to poll every 5 minutes—H H(0-7) * * * is usually sufficient. I've worked with teams that reduced their Jenkins server load by 40% just by adjusting polling frequencies based on job criticality.
Monitor your Jenkins server's load metrics. If you see CPU spikes correlating with polling intervals, you're polling too aggressively.
Securing PollSCM: Credential Management and Permissions
This is non-negotiable: never hardcode credentials in your Jenkinsfile or job configuration. Use Jenkins' credential store instead.
Here's a security checklist I recommend:
- Store SCM credentials in Jenkins' credential store, not in plain text
- Use SSH keys instead of passwords where possible
- Apply the principle of least privilege—the SCM account Jenkins uses should have read-only access to the repositories it polls
- Rotate credentials regularly (I recommend every 90 days)
- Audit access logs to detect unusual polling patterns
I've seen too many teams use a shared admin account for Jenkins SCM access. It works, but it's a security nightmare. A dedicated read-only account is easy to set up and significantly reduces risk.
PollSCM in Dockerized and Kubernetes-Based Jenkins Environments
Running Jenkins in containers introduces unique challenges for PollSCM. The most common issue I've encountered is DNS resolution failure—the Jenkins container can't resolve the SCM server's hostname.
If you're running Jenkins in Docker, ensure your container's DNS settings are correct. You might need to use the host's DNS server or configure a custom DNS in your Docker Compose file:
services:
jenkins:
dns:
- 8.8.8.8
- 8.8.4.4
Another consideration: Jenkins' home directory must be persisted on a volume. If the container restarts and loses its state, Jenkins forgets the last known repository state, which can cause unnecessary builds or missed triggers.
For Kubernetes deployments, ensure your Jenkins pod has network policies that allow outbound connections to your SCM server. I've seen cases where default network policies blocked all outbound traffic, causing PollSCM to fail silently.
FAQ
What is the difference between Poll SCM and webhook in Jenkins?
Poll SCM is a pull-based mechanism that checks your repository at fixed intervals (e.g., every 5 minutes) and triggers a build only when changes are detected. Webhooks are push-based—your SCM server sends an HTTP request to Jenkins the moment a change occurs, triggering a build in near real-time. The key trade-offs are latency (PollSCM introduces delay equal to your polling interval; webhooks are instant) and resource usage (PollSCM consumes resources on every poll even when nothing changed; webhooks only consume resources when events occur).
How do I check the last Poll SCM log in Jenkins?
Navigate to your job's status page and click "Poll SCM" in the left sidebar. This shows the most recent polling log, including the timestamp, the revision checked, and whether changes were found. Look for messages like "No changes" (nothing happened) or "Changes found" (a build should have been triggered). The "Last Poll" timestamp on the job's status page indicates when the most recent poll occurred.
Why is Jenkins Poll SCM not triggering my build?
The top five causes are: (1) authentication failures—your credentials expired or are incorrect; (2) incorrect cron expression syntax—a typo makes the schedule invalid; (3) SCM plugin version incompatibility—update your plugins; (4) network issues—Jenkins can't reach your SCM server; (5) Multibranch pipeline limitations—PollSCM doesn't work as expected in all Multibranch configurations. Check the Poll SCM log first to narrow down the cause.
Can I use Poll SCM with a multibranch pipeline?
Yes, but with limitations. PollSCM works with Multibranch pipelines when configured in the Jenkinsfile, but it applies to all branches. You can't selectively enable it for specific branches without additional logic. Additionally, if your Jenkinsfile is in a different repository than the code you're building, PollSCM might not work as expected. In that case, consider a separate polling job that triggers your main pipeline.
Conclusion
Jenkins PollSCM is a powerful, simple trigger mechanism that has stood the test of time. It's not flashy, and it's not real-time, but it's reliable, easy to configure, and works with virtually any SCM system. The trade-offs—latency and resource consumption—are real, but they're manageable with proper configuration.
The key takeaway: choose your trigger based on your team's needs, not on what's trendy. Webhooks are great for real-time feedback and minimal resource usage, but PollSCM remains the pragmatic choice for many enterprise environments. And when things go wrong, the troubleshooting steps I've outlined will help you diagnose and fix issues quickly.
Have you faced a tricky PollSCM issue? Share your experience in the comments below, or subscribe to our newsletter for more Jenkins tips and tricks.

