Common Intermediate Mistakes in Jenkins
The traps that catch people who already know the basics: what each mistake looks like, why it hurts later, and the simple habit that avoids it, from controllers and secrets to timeouts, plugins, backups and pull requests.
Beginners make loud mistakes. A build fails, an error appears, and the problem is fixed within the hour. Intermediate users make quiet ones. The pipeline works. The builds are green. Everything seems fine, until one day the controller runs out of disk, or a secret shows up in a log, or an upgrade breaks half the jobs, or a build hangs all weekend. The mistake had been sitting there for months, waiting for the right moment.
This guide is about those quiet mistakes. They are common because they are easy to make: each one is a reasonable shortcut on the day it is taken. They are costly because the bill arrives later, often at an inconvenient time, and often to someone who did not make the original choice.
The guide starts from zero for every term, uses everyday pictures to make ideas stick, and treats each mistake in the same way: what it looks like, why people make it, what goes wrong, and the small habit that prevents it. Read it as a friendly review of your own Jenkins setup, not as a list of blame.
1What Are Intermediate Mistakes?
A plain-language first look before any details.
Jenkins is a free, open-source automation server that builds, tests and delivers software. Its work is written as a pipeline, a recipe stored in a text file called the Jenkinsfile. A pipeline is divided into stages, such as Build, Test and Deploy, and each stage contains steps, the single actions Jenkins performs.
An intermediate mistake is a habit that works well enough while a system is small, and quietly causes trouble as it grows. It is different from a beginner mistake in one important way: nothing breaks at once. The pipeline is green. The team is happy. The cost is deferred.
Think of a home cook who has learned to make good dinners. The dinners are tasty, so nothing seems wrong. But the cook stores raw chicken above vegetables, never checks the fridge temperature, and keeps old spices for ten years. None of it matters for months. Then one day somebody gets ill. The cook was skilled at cooking, but had not yet learned kitchen safety. Intermediate Jenkins mistakes are mostly about safety, upkeep and scale, not about making pipelines run.
A mistake is not a moral failing. It is a cost that has not yet been noticed. The goal of this guide is to help you notice it while it is still cheap.
The mistakes fall into a few families: where work runs, how it is configured, how secrets are handled, how waiting and failure are treated, how the system is maintained and how people are given access. Each chapter takes one mistake and follows the same pattern, so you can read them in any order.
2Why These Mistakes Happen
The plateau between “it works” and “it lasts.”
The plateau
Learning Jenkins has two steps. First you learn to make things work: create a job, write a pipeline, get a green build. That takes weeks. Then you must learn to make things last: keep them safe, fast, recoverable and understandable by other people. That takes years, mostly because the lessons arrive slowly, through incidents. Many people stop learning after the first step, because everything appears to be fine.
Common causes
Deadline pressure
The quick fix is chosen because the deadline is near. The proper fix is postponed, and then forgotten.
Growth nobody planned
A setup built for five people slowly serves fifty. Habits that were harmless become expensive.
Copy and paste culture
Examples from the internet are copied without understanding the assumptions behind them.
No feedback
Nothing tells you a habit is risky until it fails. Green builds feel like proof of good practice.
Nobody owns the platform
Jenkins is everyone’s tool and nobody’s job, so upkeep is nobody’s priority.
Trusting defaults
Defaults suit a demo, not a production system. Many risky settings are simply the ones nobody changed.
A shortcut is taken
Someone builds on the controller, or pastes a token into a script, because it is quick.
It works
Nothing goes wrong, so the shortcut is copied into other jobs.
It spreads
Ten jobs, then fifty, now use the same pattern. Removing it becomes a project.
The bill arrives
An incident, an audit or an upgrade exposes the cost, all at once and at a bad time.
3Core Concepts You Need First
A handful of small ideas that make every later chapter easier.
Blast radius
The blast radius of a mistake is how much damage it can do when it goes wrong. A mistake in one test job has a small blast radius. A mistake on the controller has a large one, because everything depends on it. Good habits keep blast radii small.
Configuration drift
Drift is what happens when things that should be identical slowly become different, such as two agents with different tool versions, or a job whose settings were edited by hand until nobody knows what it does.
Single point of failure
A single point of failure is one component whose failure stops everything. The Jenkins controller is one. Knowing this makes backups and protection of the controller a priority.
Reproducibility
A build is reproducible if running it again on the same code gives the same result. Floating versions, unpinned tools and leftover files break reproducibility.
Least privilege
Least privilege means giving each person, job and machine only the access it needs. It limits what a mistake or an attacker can reach.
Controller and agent
The controller is the main Jenkins server that schedules work and stores settings. Agents are the worker machines that run builds.
| Term | Simple meaning | Why it matters in this guide |
|---|---|---|
| Blast radius | How far damage spreads | Ranks which mistakes matter most |
| Drift | Things becoming different over time | Explains many mysterious failures |
| Single point of failure | One part everything relies on | Why the controller needs care |
| Reproducible | Same input, same result | Goal of pinning and cleaning |
| Least privilege | Only the access that is needed | Guides permissions and secrets |
| Technical debt | Shortcuts that must be repaid later | What intermediate mistakes create |
4Architecture: A Map of Where Mistakes Live
Six layers of a Jenkins setup, each with its own typical mistakes.
flowchart TD
P["People and process: permissions, reviews, ownership"] --> C["Controller: disk, plugins, backups, security"]
C --> A["Agents: labels, executors, drift, cleanup"]
A --> PL["Pipeline code: scripts, shell steps, errors, timeouts"]
PL --> S["Secrets and credentials: storage, printing, scope"]
S --> D["Delivery: triggers, pull requests, deployments"]
D --> O["Observability: logs, metrics, alerts"]
Read the diagram from top to bottom. People and process decide who can do what. The controller holds settings and history. Agents run the work. Pipeline code describes it. Secrets let it reach outside systems. Delivery connects it to source code and production. Observability lets you see it all. Mistakes tend to cluster by layer, and the layers depend on each other: careless permissions (top) can lead to a leaked secret (middle) which leads to a production incident (bottom).
| Layer | Typical mistakes | Chapters |
|---|---|---|
| People and process | Everyone is an administrator; nobody owns upkeep | 19, 23 |
| Controller | Builds on the controller; plugin sprawl; no backups; history bloat | 5, 16, 17, 19 |
| Agents | Label confusion; drift; leftover files | 14, 18 |
| Pipeline code | Heavy scripting; shell surprises; swallowed errors; missing timeouts; copy and paste | 8 to 13, 21 |
| Secrets | Secrets in scripts and logs | 7 |
| Delivery | Polling; trusting outside pull requests; deploying from anywhere | 20, 22, 25 |
| Observability | No monitoring; noisy logs; tolerated flaky tests | 24, 26 |
If you only have time to fix a few things, start with the top and middle layers: who has access, what runs on the controller and how secrets are stored. Those mistakes have the largest blast radius.
5Mistake 1: Running Builds on the Controller
The most common mistake, and one of the most dangerous.
What it looks like
A new Jenkins installation can run builds on the controller itself. It is convenient: no agents to set up. Many teams never change this, and builds keep running on the same machine that holds all the settings, history and secrets.
Why it hurts
flowchart LR
B["Build code runs on the controller"] --> R1["Can read credentials and settings"]
B --> R2["Can use the controller's memory and processor"]
B --> R3["Can fill the controller's disk"]
R1 --> X1["Secret theft by hostile or careless code"]
R2 --> X2["Slow web pages and stuck queue"]
R3 --> X3["Controller crash and no builds for anyone"]
- Security: build code runs next to every secret. A hostile pull request, a compromised dependency or a careless script can reach files that should be protected.
- Performance: heavy builds compete with the software that schedules everything, so the web page slows and queues stall.
- Stability: a runaway build can fill the disk or exhaust memory, and the controller goes down with it.
The fix
Set the number of executors on the built-in node to zero, and run everything on agents. Even one small agent is better than none. Agents can be simple virtual machines or short-lived containers.
Illustration: the runaway test
A test suite has a bug that writes gigabytes of log files. Running on the controller, it fills the disk in an hour. Jenkins stops responding, and nobody in the company can build anything until an administrator clears the disk. On an agent, the same bug fills only the agent’s disk, and the agent is replaced.
The argument “we are too small to need agents” is common and wrong. Small teams have secrets too. The setup takes an hour and removes the largest risk in the whole installation.
6Mistake 2: Configuring Everything by Hand
Clicking in the web page is easy. Reproducing it is not.
What it looks like
A job is created through the web form. A setting is tweaked. Another is added a month later by someone else. A plugin option is changed during an incident. After a year, the job works, but nobody can say exactly why, or recreate it if it were lost.
Why it hurts
- Drift: two jobs that should be alike are subtly different.
- No history: nobody knows who changed what, or why.
- No review: changes bypass the checks that code gets.
- No rebuild: if the controller is lost, the configuration is lost with it.
flowchart LR
subgraph HAND["Configured by hand"]
H1["Click in web page"] --> H2["Stored only on controller"]
H2 --> H3["Unknown history, hard to copy or restore"]
end
subgraph CODE["Configured as code"]
C1["Change in files"] --> C2["Reviewed and versioned"]
C2 --> C3["Applied automatically, easy to rebuild"]
end
The fix
Pipeline as code
Keep build logic in a Jenkinsfile in the repository, so it is versioned and reviewed with the code it builds.
Multibranch and folders
Let Jenkins discover branches and repositories automatically, instead of creating jobs by hand.
Configuration as Code
Describe controller settings, agent templates and security rules in files applied by the Configuration as Code plugin.
A list of plugins in version control
Keep the list of plugins and versions in a file, so a new controller can be built identically.
Ask: “If the controller disappeared tonight, how long would it take to rebuild it exactly as it is?” If the honest answer is “days, and we would forget things,” you are configured by hand.
7Mistake 3: Secrets in the Wrong Places
A secret that is easy to reach for you is easy to reach for others.
What it looks like
- A token pasted into the Jenkinsfile, or into a shell script in the repository.
- A password saved as an ordinary job parameter, visible on the build page.
- A secret printed to the log “just to check that it arrived.”
- One shared credential used everywhere, with wide permissions.
- A secret placed into a command using double quotes, so Jenkins bakes the real value into the command text.
Why it hurts
Repositories keep every version forever, so a secret removed today still lives in history. Logs are readable by many people and often copied into tickets and chat. Shared broad credentials turn one leak into a total compromise. And masking in logs is only a safety net: it hides exact copies of a bound secret, not changed versions or file contents.
| Habit | Problem | Better habit |
|---|---|---|
| Token written in the Jenkinsfile | Lives in repository history forever | Store in the credentials store and refer to it by ID |
| Password as a plain parameter | Visible in the build page and history | Use credentials, not parameters |
| Printing secrets to check them | Copies land in logs; masking may miss altered forms | Check only that a variable is set, never its value |
| Double-quoted commands with secrets | Real value is placed in the command text | Use single quotes so the shell reads the variable |
| One broad credential for everything | One leak opens everything | Separate, narrow credentials per purpose and environment |
| Secrets bound for the whole pipeline | Long exposure window | Bind only around the steps that need them |
A secret that has been committed or printed is compromised, even if you delete the line. Revoke it at its source, create a new one and update Jenkins. Speed matters more than blame.
Illustration: the ten-second commit
A developer commits a token for ten seconds, realizes the mistake and deletes it in the next commit. Automated scanners on public code hosts find it within minutes. The token is used to create cloud machines that mine cryptocurrency, and the team gets a large bill. Storing the token in the credentials store from the start would have prevented all of it.
8Mistake 4: No Deadlines, No Cleanup
A build with no time limit is a build that may never end.
What it looks like
Pipelines have no timeout anywhere. A test waits for a network answer that never comes. A deployment tool asks a question nobody sees. An approval prompt sits unanswered over a long weekend. Nothing turns red. The build simply keeps running.
Why it hurts
- Each hung build holds an executor, a work slot on an agent. A handful of them can freeze a small fleet.
- On cloud machines billed by time, hangs cost real money.
- Nobody is alerted, because nothing has failed.
- Approvals left open for days may be answered later, deploying stale code.
The fix
Set a pipeline-level limit
A last-resort deadline for the entire run, so no build lives forever.
Give stages realistic budgets
Base them on recent durations plus a margin, and review them regularly.
Guard every external wait
Wrap polling, calls to outside systems and approval prompts in timeouts.
Clean up after interruptions
An expired timeout ends the run as aborted. Use the post section’s aborted and cleanup conditions to stop helper services and destroy temporary environments.
Alert on aborted
An alert that listens only to failures will miss timeouts, because they end as aborted, not failed.
A timeout written as a bare number means minutes. Always write the unit, so a reader cannot mistake thirty seconds for thirty minutes.
Illustration: the forgotten test environment
A pipeline creates a temporary cloud environment for tests. A test hangs, the build is stopped by hand on Friday, and nothing tears the environment down. It runs for eleven days before somebody notices the bill. A timeout plus an aborted cleanup block that destroys the environment would have ended the story on Friday evening.
9Mistake 5: Holding Executors While Waiting
A machine slot occupied by a build that is doing nothing.
What it looks like
An approval prompt, a long sleep or a wait for an outside event is written inside an agent block. The build holds an executor for the entire wait. Because agents have a fixed number of executors, waiting builds quietly reduce the capacity available to everyone else.
flowchart LR
subgraph BAD["Executor held while waiting"]
B1["Agent allocated"] --> B2["Build and test"]
B2 --> B3["Wait for approval, executor idle"]
B3 --> B4["Deploy"]
end
subgraph GOOD["Executor released while waiting"]
G1["Agent allocated"] --> G2["Build and test, stash outputs"]
G2 --> G3["Agent released"]
G3 --> G4["Wait for approval with no agent"]
G4 --> G5["New agent allocated"]
G5 --> G6["Deploy"]
end
Why it hurts
With ten executors and three builds waiting for approval, a third of your capacity is idle but unavailable. Queues grow while machines do nothing. The problem is invisible on a quiet system and painful on a busy one.
The fix
- Place approvals and long waits in their own stage with no agent, or use the declarative input directive, which pauses before an agent is allocated.
- Before releasing the agent, save any files you need, using stash for small files or an artifact repository for large ones.
- Always give the wait a timeout.
- Allocate a fresh agent afterwards for the steps that follow.
After the wait, the workspace on the old agent may be gone. Steps that assume the files are still there will fail. Plan for the hand-over of files, or you trade one mistake for another.
10Mistake 6: Heavy Logic in the Pipeline Script
The pipeline script runs on the controller, not on the agent.
What it looks like
Pipelines that parse large files, loop over thousands of items, build long strings and do complex calculations in the pipeline’s own script language. It works on a quiet day. It is slow, uses a lot of memory, and gets worse the more pipelines run at once.
Why it hurts
The commands you run through steps execute on the agent. But the script that decides what happens next runs on the controller, inside a special engine that can pause and resume so that pipelines survive restarts. This engine is slower than ordinary code and uses controller memory. A few pipelines doing heavy work in it can slow every other pipeline.
flowchart LR
subgraph CT["Controller"]
SC["Pipeline script logic"]
end
subgraph AG["Agent"]
CM["Commands and tools"]
end
SC -->|"short instructions"| CM
CM -->|"short results"| SC
HV["Heavy loops and parsing"] -.->|"wrong place"| SC
HV -.->|"right place"| CM
Related traps
- Objects that cannot be saved. Because pipelines save their progress, some kinds of objects, such as certain iterators or regular-expression matchers, cannot be stored, and holding one across a step causes a “not serializable” error.
- Behavior that differs from ordinary code. Some familiar language features work differently inside the pipeline engine. Test unusual constructs before relying on them.
- Special helper functions. Jenkins lets you mark a function so that it runs as ordinary code, which is faster, but such a function cannot call pipeline steps.
If your pipeline script has loops with more than a few dozen passes, or parses files, move that work into a shell script or a small program, and let the pipeline read the short answer.
11Mistake 7: Shell Step Surprises
Each shell step is a fresh, short-lived world.
Most pipelines are mostly shell steps. Understanding how they behave prevents a family of confusing bugs.
| Surprise | What really happens | Better habit |
|---|---|---|
| “I changed directory in one step, but the next step is somewhere else” | Each shell step starts a new process in the workspace; a directory change does not carry over | Use the pipeline’s directory step to wrap steps that need another folder |
| “I set a variable in one step, but the next step cannot see it” | Variables set inside a shell script vanish when that step ends | Pass values through pipeline variables or files |
| “The step passed, but a command in the middle failed” | In a pipe, only the last command’s result counts unless the shell is told otherwise | Turn on the shell’s pipe-failure option in scripts that use pipes |
| “The step is green even though a tool reported an error” | A trailing “or true” or “ignore errors” flag hides the failure | Remove blanket ignores; handle specific expected failures explicitly |
| “The log is full of every command I ran” | Jenkins runs shell steps in a mode that prints each command | Understand this, and never put secrets into command text |
| “It works on my agent but not on another” | Different tools or versions installed | Use container images or pinned tool installers |
| “Special characters break my command” | Quotes and spaces are interpreted by the shell | Quote variables and validate outside input |
Long scripts
When a shell step grows beyond a handful of lines, it becomes hard to read and impossible to test outside Jenkins. Move it into a script file in the repository, run it as a single command and test it on a laptop. The pipeline stays short, and the script can be reused and reviewed as normal code.
Illustration: the green build with a hidden failure
A step runs a tool and pipes its output through a formatter. The tool crashes, but the formatter succeeds, so the step reports success. For weeks, the pipeline is green while the tool never completes. Enabling the shell’s pipe-failure option exposes the crash on the very next run.
12Mistake 8: Swallowing Errors and Misreading Results
A green build that hides a problem is worse than a red one.
What it looks like
- Wrapping steps so failures are ignored, then forgetting why.
- Treating yellow (unstable) builds as if they were green.
- Using retries to make failures disappear, without looking at why they happen.
- Alerts that listen only to failures, so aborted and unstable runs pass in silence.
- Reading the color of a build instead of reading the reason.
The results, explained
| Result | Color | Meaning | Common misreading |
|---|---|---|---|
| Success | Blue or green | All steps passed | Assuming it also means all checks ran |
| Unstable | Yellow | Build finished but something softer went wrong, often failing tests | Releasing it as if it were fine |
| Failure | Red | A step failed hard | Rerunning until green instead of investigating |
| Aborted | Gray | Stopped by a person, a timeout or a newer build | Assuming nobody needs to know |
flowchart TD
E["A step fails"] --> Q{"Is the failure expected and harmless?"}
Q -->|"No"| F["Let the build fail and alert"]
Q -->|"Yes, optional check"| S["Mark unstable, keep going, alert owners"]
Q -->|"Yes, known flaky"| R["Retry with a limit, count every retry, track the flake"]
S --> D["Decide: can unstable builds be released?"]
R --> T["Fix or quarantine the flaky part"]
The fixes
- Use error-catching wrappers deliberately. The step that catches an error and continues can set a chosen result, such as unstable. Use it only for genuinely optional checks, and leave a comment saying why.
- Decide what yellow means. Either block releases from unstable builds, or make yellow trigger a visible alert with an owner.
- Limit retries. Retry only the specific operation known to be flaky, cap the number of attempts and report each retry.
- Alert on unsuccessful. The post section’s unsuccessful condition covers failure, unstable and aborted together.
A check that is allowed to fail forever is not a check. If a warning has been ignored for six months, either fix it or remove it. Otherwise it teaches everyone that red and yellow do not matter.
13Mistake 9: Misusing the Post Section
The end-of-run block is powerful and often misplaced.
The post section runs when a stage or pipeline ends and reacts to the result. It has named conditions such as always, failure, success, unstable, aborted, changed, fixed, regression and cleanup, run in a fixed order with cleanup last. Intermediate users often use it in ways that cause trouble.
| Mistake | Consequence | Better habit |
|---|---|---|
| Deleting the workspace in always | Later conditions, such as failure alerts, find files gone | Save reports in always, delete in cleanup, which runs last |
| Alerting on every failure | Noisy channel; people mute it | Alert on regression, celebrate on fixed |
| Alerting only on failure | Timeouts and unstable builds pass unnoticed | Handle aborted and unstable too |
| File steps in a pipeline-level post when no agent is declared at the top | Error about a missing context, because there is no workspace | Put file steps in stage-level post blocks or request an agent |
| Doing real work in post | Hidden deployments, blurred meaning of “finished” | Keep post for wrap-up; deploy in a stage |
| A failing notification changing the build result | A good build turns red because chat was down | Make notification steps tolerant of outside outages |
| Never testing the failure path | The first time it runs is the first time it is needed | Break a test branch on purpose to see alerts and cleanup |
Illustration: the disappearing report
A team deletes the workspace in the always condition, and publishes test reports in the failure condition. Because always runs first, the reports are gone before failure runs, so failed builds never have reports. Moving the deletion to cleanup fixes it in one edit.
Think of post as a closing checklist for a shop: rescue the takings, tell the manager, then lock the door. The order matters, and locking the door first defeats the rest.
14Mistake 10: Workspaces and Leftover State
Yesterday’s files quietly affect today’s build.
A workspace is the folder on an agent where a build downloads code and writes output. On long-lived agents, workspaces are reused, and whatever a previous build left behind is still there. That is sometimes useful, as a cache. It is also a source of the most confusing failures in Jenkins.
Works here, fails there
A build passes on one agent because a leftover file exists, and fails on another where it does not.
Passes after a rerun
The first run fails, the second succeeds because the first left the needed file behind.
Disk full
Dozens of old workspaces for dead branches occupy the agent’s disk.
Stale results
Old test reports or compiled files are mistaken for new ones.
Secrets left behind
Temporary files with credentials remain readable by later builds on the same machine.
Concurrent overlap
Two builds of the same job share files or step on each other unless workspaces are kept separate.
The fixes
- Prefer ephemeral agents, such as containers created for one build, so every build starts clean by design.
- Clean at the end of builds that handled sensitive data, using the cleanup condition of the post section.
- Clean at the start when you need certainty and can afford the re-download.
- Run a fully clean build on a schedule, to prove that nothing depends on leftovers.
- Remove old workspaces automatically, and take agents offline when disk space runs low.
Cleaning everything on every build is safe but slow. Keep caches for downloads and compiled dependencies, keyed by exact versions, and keep the final steps clean. Speed and cleanliness are traded, not opposed.
15Mistake 11: Unpinned Versions Everywhere
If the ingredients change silently, the recipe changes silently.
What it looks like
The pipeline uses whatever version of a tool, image or library is the newest today. A container image is referred to by the tag latest. A dependency has a floating version range. A shared library is loaded from the moving tip of a branch. A plugin is updated whenever someone clicks the button. Everything works, until the morning when an upstream project publishes a change and your unchanged code suddenly fails.
| Floating thing | What can go wrong | Pinned alternative |
|---|---|---|
| Container image tag “latest” | The image changes under you; builds differ day to day | Use a specific version tag, or an exact content digest |
| Dependency ranges | A new release breaks the build with no code change | Use lock files with exact versions |
| Tool installed at build time without version | Different agents get different versions | Pin the version in the image or installer |
| Shared library from a branch tip | A library change instantly affects every pipeline | Pin to a tagged release and upgrade deliberately |
| Plugins updated ad hoc | Surprise behavior changes on the controller | Keep a versioned plugin list and upgrade on a schedule |
| Jenkins itself on the latest weekly release | Newest changes, least testing | Follow a long-term-support line and upgrade with care |
The two-sided lesson
Pinning makes builds reproducible, but pinned things go stale and miss security fixes. The healthy pattern is pin and update on purpose: keep exact versions, and have a regular, tested routine for moving them forward, ideally automated with a tool that proposes updates as reviewable changes.
Illustration: the Monday morning surprise
A team’s builds have used the same image tag for a year. On Monday an upstream maintainer publishes a new image under that tag with a different default setting. Every pipeline fails at once, although nobody changed a line of code. Pinning to an exact version would have kept Monday quiet, and the upgrade would have happened at a time and place of the team’s choosing.
16Mistake 12: Plugin Sprawl and Risky Updates
Plugins are Jenkins’ strength and its most common source of trouble.
What it looks like
Over the years, every problem is answered with another plugin. Nobody removes old ones. Updates are applied all at once on the production controller, on a Friday, without a copy to test on. When something breaks, nobody knows which plugin caused it.
Why it hurts
- Every plugin adds memory use, start-up time and security surface.
- Plugins depend on each other, and one update can force others.
- Abandoned plugins stop receiving security fixes.
- Untested updates can break jobs, and reversing them is hard.
flowchart TD
A["Update available"] --> B["Read release notes and security advisories"]
B --> C["Take a fresh backup"]
C --> D["Apply on a test controller with copied configuration"]
D --> E["Run sample and critical pipelines"]
E --> F{"All good?"}
F -->|"Yes"| G["Schedule update on production in a quiet window"]
F -->|"No"| H["Hold back, report problem, plan alternative"]
G --> I["Verify, keep rollback plan ready"]
Healthy plugin habits
Remove what you do not use
Review the list twice a year, and remove plugins that no job depends on.
Prefer maintained plugins
Check when a plugin was last updated and whether it has known security problems. Avoid abandoned ones.
Keep the list in version control
A file of plugin names and versions lets you rebuild identically and review changes.
Update on a test copy first
Even a small test controller with a few sample pipelines catches most breakages.
Act on security advisories quickly
Security fixes are the updates worth hurrying. Others can wait for the routine.
Use the long-term-support line
The long-term-support releases receive extra testing and fixes, and suit production better than the weekly releases.
17Mistake 13: No Backups, or Untested Ones
The controller is a single point of failure, and it holds everything.
What it looks like
Either nobody has thought about backups, or a backup job exists but has never been restored. The Jenkins home folder sits on one disk. When the disk fails, or an upgrade goes wrong, the team discovers how much lived only there: job definitions, credentials, build history, keys, plugin settings.
flowchart LR
S["Schedule regular backup of Jenkins home"] --> E["Encrypt and store off the machine"]
E --> T["Regularly restore to a test controller"]
T --> V["Verify jobs, credentials and agents work"]
V --> R{"Restore works?"}
R -->|"Yes"| D["Record time taken and update runbook"]
R -->|"No"| F["Fix the backup and repeat"]
F --> S
What to protect
| Item | Why it matters | Note |
|---|---|---|
| Job and folder definitions | The work itself | If configured as code, they can be rebuilt from repositories |
| System configuration | Security settings, agents and clouds | Configuration as Code makes this reproducible |
| Credentials and encryption keys | Without the keys, stored secrets cannot be read | Back up both together, and protect the backup like the vault it is |
| Plugin list and versions | Rebuild the same behavior | Keep in version control |
| Build history | Audit and troubleshooting | Decide how much you truly need |
| Workspaces and caches | Rebuildable | Usually excluded from backups |
The habits
- Back up regularly and store copies away from the controller machine.
- Protect backups carefully. A backup contains the vault and its key; encrypt it and restrict who can read it.
- Practice the restore at least twice a year, and time it. An untested backup is a hope, not a plan.
- Reduce what needs backing up by putting configuration and pipelines in code.
A controller whose disk fills up can corrupt its own data. Monitor free space on the Jenkins home, and discard old builds before it becomes an emergency.
18Mistake 14: Label, Executor and Agent Confusion
Where a build runs matters as much as what it does.
| Mistake | Consequence | Better habit |
|---|---|---|
| “Any agent” everywhere | A job needing Linux tools lands on a Windows agent and fails at random | Request labels that describe real requirements |
| One label and one small pool per project | Some pools full, others idle, queues despite spare capacity | Label by capability; share large pools |
| Too many executors on a machine | Builds compete for processor and memory and all slow down | Match executors to cores and typical use |
| Stages with an agent and a when rule, without the early-check option | An agent is allocated for a stage that will be skipped | Evaluate the condition before allocating the agent |
| A new agent for every tiny stage | Repeated queue waits, checkouts and setup | Keep continuous work on one agent; release only for long waits |
| Default checkout in every stage | The same code downloaded again and again | Skip the default checkout and fetch once |
| Hand-built long-lived agents | Drift; nobody can recreate them | Build agents from versioned images |
| Agents with no monitoring | A full disk or broken tool fails many builds before anyone notices | Use node monitors and alerts; take bad agents offline |
Illustration: the skipped stage that still took a machine
A deployment stage has its own agent and a rule that it should only run on the main branch. On every other branch, Jenkins still requests an agent, waits for one, and only then discovers that the stage is skipped. On a busy day, pull requests wait several minutes for a machine they do not use. Evaluating the rule before allocating the agent removes the wait completely.
Keep a short, documented list of labels, each with a plain promise, such as “linux: a Linux machine with a container runtime.” A label nobody can explain should be retired.
19Mistake 15: History Bloat and Missing Job Options
Everything you keep costs disk, memory and load time.
By default, Jenkins keeps every build of every job forever, along with its logs and archived files. On a busy system this grows without limit, until the controller’s disk fills, pages load slowly and start-up takes many minutes.
Build discarder
Set a limit on how many builds and how many days of history each job keeps. Twenty to fifty builds are enough for most jobs.
Artifact retention
Archived files take the most space. Keep them for fewer builds than the logs, or move them to external storage.
Disable concurrent builds
Where overlapping runs of the same job are harmful or pointless, stop them, or cancel the older run.
Timestamps
Cost almost nothing and turn a log into a timeline. Add them to every pipeline.
Orphaned jobs
In multibranch setups, set a rule for removing jobs of deleted branches quickly.
Stale jobs
Jobs nobody has run in a year should be archived or deleted, not left to clutter.
Put the options in one place
Because these options are per job, teams forget them on new jobs. The reliable fix is to include them in a shared template or library, so every new pipeline starts with sensible history limits, timestamps and a timeout without anyone remembering.
Illustration: the ten-thousand-job controller
A controller manages twelve thousand jobs, mostly stale branch jobs with unlimited history. Start-up takes twenty minutes and pages are slow. After removing dead jobs, capping history at twenty builds and cleaning archived files, start-up falls to four minutes, and the interface feels fast again.
20Mistake 16: Polling and Scheduling Mistakes
How builds get started matters as much as what they do.
| Mistake | Consequence | Better habit |
|---|---|---|
| Polling the repository every minute | Constant load on Jenkins and the source server; still slower than an event | Use webhooks for speed, and a slow scan as a safety net |
| Scheduling every job at the top of the hour | Hundreds of jobs start at once, overwhelming agents and services | Use the hash symbol in schedules so Jenkins spreads start times |
| Nightly builds that overlap into the morning | Machines busy when the day shift arrives | Set deadlines and timeouts; stagger schedules |
| Relying on schedules for freshness | Changes wait hours before feedback | Trigger on events; use schedules for slow, wide checks |
| Webhook silently broken | Builds only start at the next scan, and nobody knows why | Check delivery history at the code host; alert on missing triggers |
| Building every push of every branch | Wasted capacity on experiments | Filter branches, build pull requests and important branches |
The hash symbol
Jenkins schedules use a syntax similar to the classic cron format. In it, a special hash symbol in place of a fixed number means “pick a value for this job, spread across the range.” Instead of every nightly job starting at exactly two o’clock, they start at various times across the hour. It is a tiny change that prevents a daily traffic jam.
Illustration: the top-of-the-hour storm
A hundred and twenty jobs are all scheduled for midnight. Every night at midnight the queue jumps to 120, agents are overwhelmed, cloud machines are created in a burst and hit quotas, and the source server rate-limits Jenkins. Spreading the schedules across the hour makes the storm disappear without changing what any job does.
21Mistake 17: Copy-Paste Jenkinsfiles and Library Misuse
Reuse is good. Uncontrolled copying and uncontrolled sharing are both problems.
The copy-paste problem
A working Jenkinsfile is copied into fifty repositories. Each copy is then edited slightly. A year later, no two are the same, a security fix must be applied fifty times, and new joiners cannot tell which version is right.
The shared library answer, and its traps
A shared library is a reusable module of pipeline code that many Jenkinsfiles can call. It solves duplication, but brings its own mistakes.
Good use of libraries
- Standard stages for build, test and deploy in one place.
- Security and quality steps applied consistently.
- Short Jenkinsfiles that say what, not how.
- Pinned to tagged versions with a release process.
- Small, tested and documented functions.
Common misuse
- Loading the library from a moving branch tip, so one change breaks everyone at once.
- Putting heavy logic into library functions, which runs on the controller.
- A huge library that slows the start of every build.
- No tests, so changes are risky.
- Making the library so flexible that nobody understands it.
The healthy path
- Treat the library as a product: version it, test it, document it and release it with notes.
- Let projects pin to a released version and upgrade deliberately.
- Keep the functions thin, delegating heavy work to commands on agents.
- Provide a few opinionated standard pipelines rather than infinite options.
Some duplication is healthier than a wrong abstraction. Move logic into the library once three or more repositories genuinely need the same thing, not when the first one does.
22Mistake 18: Trusting Pull Requests From Strangers
When the build recipe lives in the code, whoever writes the code writes the recipe.
What it looks like
A public or shared repository builds every pull request automatically, including those from copies of the repository owned by outsiders. The pipeline has access to credentials and to internal systems. Everything works, and nobody thinks about what a malicious pull request could do.
Why it hurts
A pull request can change the Jenkinsfile. If Jenkins runs the changed file with access to secrets, an outsider can print them, send them elsewhere or use them to reach internal systems. Even well-meaning contributors can accidentally leak secrets through debug output.
flowchart TD
PR["Pull request opened"] --> W{"From the same repository?"}
W -->|"Yes"| TR["Trusted: full pipeline"]
W -->|"No, from a fork"| TP{"Author trusted by policy?"}
TP -->|"Yes"| TR
TP -->|"No"| UT["Untrusted: use target branch Jenkinsfile"]
UT --> NS["No secrets, isolated disposable agent, tests only"]
TR --> ST["Status reported to pull request"]
NS --> ST
The habits
Choose a trust policy
Branch source plugins let you decide whose pull requests are trusted, from nobody to everyone. Pick the strictest that suits your project.
Use the trusted Jenkinsfile
For untrusted changes, run the pipeline file from the target branch, so the outsider cannot rewrite the recipe.
No secrets for pull requests
Bind credentials only in builds of protected branches and tags.
Isolate the agents
Run untrusted builds on disposable agents in a separate network segment.
Protect branches
Require reviews for changes to the Jenkinsfile and for merges to important branches.
Assume that any code that runs in a build can read everything that build can read. Then make sure builds of untrusted code can read nothing valuable.
23Mistake 19: Loose Permissions and Shared Accounts
Access is granted in a hurry and revoked never.
| Mistake | Consequence | Better habit |
|---|---|---|
| Setup option “logged-in users can do anything” left on | Every account is an administrator | Use a matrix or role-based model with least privilege |
| Anonymous users can read everything | Job names, logs and settings visible to anyone who reaches the address | Require login; restrict read access |
| Shared accounts such as “ci-admin” | Nobody is accountable; audit trail is empty | Individual accounts through single sign-on |
| Many administrators | Administrators can run arbitrary scripts on the controller and read every secret | Keep the group small and review it |
| Everyone can edit every job | Accidental and malicious changes | Grant rights per folder and team |
| Departed staff keep access | Unnecessary exposure | Tie access to the company directory so offboarding is automatic |
| Turning off protective defaults for convenience | Weakens protections such as request forgery checks and agent-to-controller limits | Leave protections on; solve the underlying need properly |
| Script console open to many | Full control of the controller through a web form | Restrict to a few administrators and log its use |
Illustration: the shared account
A team uses one shared login for automation and for administrators, “because it is easier.” When a production job is deleted by mistake, nobody can say who did it. After moving to individual accounts with roles, the next incident is traced in minutes, and most incidents stop because people know their actions are visible.
Give access in folders. Each team gets full rights on its own folder and read-only or no rights elsewhere. The default for a new person becomes safe, and new jobs inherit the protection automatically.
24Mistake 20: Tolerating Flaky Tests and Blind Retries
A red build that means nothing teaches everyone to ignore red.
What it looks like
A flaky test sometimes passes and sometimes fails on the same code. It might depend on timing, on shared data or on an outside service. Teams learn to press “rebuild” until the build is green, and eventually add automatic retries that hide the problem completely.
Why it hurts
- Real failures hide among the noise, because everyone assumes a red build is probably flaky.
- Reruns waste capacity and time, often doubling the cost of a pipeline.
- Trust in the pipeline erodes, and people begin to merge on red.
- Silent retries hide genuine intermittent bugs in the product itself.
| Response | Effect | Verdict |
|---|---|---|
| Rerun until green | Hides the flake; wastes time | Avoid as a habit |
| Automatic retry of the whole build | Doubles cost; hides real intermittent bugs | Avoid |
| Retry one specific flaky operation, capped, with every retry reported | Protects against transient outside faults | Acceptable, with visibility |
| Quarantine the flaky test into a separate, non-blocking job | Frees the main gate while the fix is planned | Good, with an owner and a deadline |
| Fix the cause | Removes the flake permanently | Best |
Habits that work
- Track which tests fail intermittently, and show the list to the team.
- Give each flaky test an owner and a deadline, or remove it.
- Replace fixed sleeps in tests with waits for a condition, and make tests independent of each other’s data.
- Report every retry in the log and in a metric, so retries never become invisible.
Illustration: the retry that hid a real bug
A team adds three automatic retries to a failing integration test. Green returns, and everyone relaxes. Weeks later, customers report occasional duplicate orders. The “flaky” test had been detecting a genuine race condition in the product. The retries had been quietly hiding a real bug from the only check that could see it.
25Mistake 21: Deploying From the Wrong Place
The path to production should be narrow, explicit and recorded.
What it looks like
- A deploy stage without any branch condition, so any branch can deploy.
- Deployment conditions written as “run unless it is a pull request,” so a new kind of branch reaches production by accident.
- Deployment credentials available to every build, including builds of outside pull requests.
- No approval before production, and no record of who released what.
- Approval prompts that wait forever, so stale builds can be approved days later.
- Deployment steps that are not safe to run twice, followed by blind retries.
flowchart LR
C["Code pushed"] --> Q{"Build type"}
Q -->|"Pull request"| PR["Build and test only, no secrets"]
Q -->|"Feature branch"| FB["Build and test only"]
Q -->|"Main branch"| MB["Build, test, deploy to staging"]
MB --> AP["Approval by named group with timeout"]
AP --> PROD["Deploy to production with scoped credentials"]
PROD --> REC["Record who, what and when"]
The habits
Say where deployment is allowed
Write conditions that name the branches or tags allowed to deploy, not the ones excluded.
Scope credentials
Bind deployment credentials only in trusted builds and only around the deploy steps.
Approve with accountability
Use a named approver group, a timeout, and record the approver’s name.
Make deployments repeatable
Design steps so running them twice is safe, and verify state before acting.
One deployment at a time
Use locks or milestones so two builds cannot deploy to the same environment together, and old builds cannot overwrite newer ones.
Have a rollback
Know how to go back before you go forward, and rehearse it.
The dangerous condition is the one written in the negative. “Deploy unless this is a pull request” allows every future kind of build. “Deploy only if this is the main branch” allows exactly one.
26Mistake 22: Flying Blind: No Monitoring and Messy Logs
If you cannot see the system, you will learn about problems from your users.
What it looks like
Nobody watches the queue, the disk, the controller’s memory or the number of failed builds. Problems are discovered when somebody complains. Logs are enormous, full of noise and progress bars, so real errors are hard to find, and secrets have more chances to slip in.
| What to watch | Why | Warning sign |
|---|---|---|
| Queue length and wait time | Shows capacity shortage or label problems | Waits of more than a minute for common labels |
| Controller disk and memory | Full disks and memory pressure crash the controller | Free space shrinking week by week |
| Agents online and their health | Broken agents fail many builds | Agents offline or repeatedly disconnecting |
| Build duration trends | Slow drift is invisible day to day | Rising median or slow tail |
| Failure and abort rates | Shows health of code and pipelines | A sudden jump |
| Webhook deliveries | Broken triggers delay builds silently | Failed deliveries at the code host |
| Backup success | An unnoticed failed backup is no backup | No successful backup in the last day |
| Security advisories for your version | Known holes get exploited | Unpatched advisories |
Log hygiene
- Use quiet modes and disable progress bars in routine builds.
- Write verbose details to a file, and archive it only when a build fails.
- Turn debug output on only while investigating.
- Keep timestamps on, and print short summaries with links to reports.
- Never print environment dumps that may contain secrets.
You do not need a large monitoring platform on day one. A single dashboard showing queue wait, free disk, agents online and build duration trends already catches most of the trouble described in this guide.
27A Self-Audit: How Healthy Is Your Jenkins?
A quick review you can do in an afternoon.
flowchart LR
L1["Level 1: Works: builds run and go green"] --> L2["Level 2: Safe: no builds on controller, secrets in the store, least privilege"]
L2 --> L3["Level 3: Reliable: timeouts, cleanup, backups tested, pinned versions"]
L3 --> L4["Level 4: Reproducible: everything as code, agents from images"]
L4 --> L5["Level 5: Observable and improving: metrics, alerts, regular reviews"]
| Question | Healthy answer | If not |
|---|---|---|
| Do builds run on the controller? | No; built-in executors are zero | Chapter 5 |
| Could you rebuild the controller from code and backups? | Yes, and it was tested | Chapters 6 and 17 |
| Do any secrets appear in code, parameters or logs? | No | Chapter 7 |
| Does every pipeline have a timeout? | Yes, at pipeline level at least | Chapter 8 |
| Are approvals and long waits outside agents? | Yes, with timeouts | Chapter 9 |
| Are alerts wired to aborted and unstable as well as failed? | Yes | Chapters 12 and 13 |
| Are images, libraries and tools pinned? | Yes, with a routine for updates | Chapter 15 |
| Is the plugin list short, current and in version control? | Yes | Chapter 16 |
| Do jobs keep a limited history? | Yes | Chapter 19 |
| Do you use webhooks and spread scheduled jobs? | Yes | Chapter 20 |
| Are outside pull requests built without secrets? | Yes | Chapter 22 |
| Are permissions role-based and individual? | Yes | Chapter 23 |
| Are flaky tests tracked and fixed? | Yes | Chapter 24 |
| Can only named builds reach production? | Yes | Chapter 25 |
| Do you watch queue, disk, agents and durations? | Yes | Chapter 26 |
Score each row yes or no. Fix the “no” answers in the order of blast radius: access and secrets first, then the controller and backups, then reliability, then speed and polish.
28Patterns That Prevent Mistakes
Instead of remembering twenty rules, build a few habits into the system.
Pattern 1: A standard pipeline template
Provide a shared library and a starter template that already include a timeout, timestamps, history limits, safe post handling and a cleanup block. New pipelines start with good habits without anyone remembering them.
Pattern 2: Everything as code, applied automatically
Controller settings, agents, plugins and jobs live in version control and are applied by tooling. Any change is reviewed, and any environment can be rebuilt.
Pattern 3: Thin controller, disposable agents
The controller runs no builds. Builds run on fresh containers that are destroyed afterwards, so leftovers, drift and untrusted code cannot accumulate.
Pattern 4: Trust tiers
Untrusted builds run on isolated agents with no secrets. Trusted builds of protected branches receive narrow, short-lived credentials.
Pattern 5: Update train
Pin versions, and move them forward on a regular schedule with tests on a copy first. Security fixes ride an express lane.
Pattern 6: Guardrails in the platform
Enforce limits centrally, such as a maximum timeout, required history limits and denied dangerous steps, so that individual pipelines cannot skip them by accident.
Pattern 7: A regular review rhythm
Twice a year, review plugins, permissions, labels, stale jobs, backups and the self-audit table. Put it in the calendar, because nobody does it otherwise.
Pattern 8: Blameless incident notes
When something goes wrong, write a short note about what happened and what habit would have prevented it, and add that habit to the template or the audit list.
29When a “Mistake” Is Acceptable: Trade-offs
Context decides. A shortcut is only a mistake if you did not choose it.
Not every item in this guide is wrong in every situation. A personal test installation on a laptop may run builds on the controller. A prototype may have hand-made jobs. What turns a shortcut into a mistake is not knowing you took it, or not noticing when the situation changes.
Acceptable shortcuts, on purpose
- Building on the controller in a throwaway lab with no secrets.
- Clicking together a job for a one-week experiment.
- Skipping timeouts on a pipeline that runs for seconds locally.
- Keeping a few duplicated Jenkinsfiles while the pattern is still forming.
- Relaxed durability for pipelines that are cheap to rerun.
Not acceptable, even when busy
- Secrets in code or logs.
- Untrusted code with access to credentials.
- No backups of a system others depend on.
- Shared administrator accounts.
- Deployments that any branch can trigger.
| Shortcut | Benefit | Cost | When it is fine |
|---|---|---|---|
| Hand-configured jobs | Fast to create | Drift; no rebuild | Short-lived experiments |
| Long-lived agents | Warm caches, instant starts | Drift and leftovers | Special hardware, with regular rebuilds |
| Floating versions | Always current | Surprise breakage | Non-critical tooling with quick rollback |
| Generous retries | Fewer red builds | Hidden bugs and waste | Known transient faults, capped and reported |
| Global credentials | Easy sharing | Large blast radius | Low-risk, read-only secrets |
Write down the shortcuts you have chosen and why, with a date to revisit them. A documented shortcut is a decision. An undocumented one is a future incident.
30Real-World and Industry Examples
How these mistakes show up in the kinds of organizations that run Jenkins at scale.
A fast-growing startup
A team that started with one Jenkins on one server for six developers finds itself, two years later, with sixty developers on the same server, builds running on the controller and credentials pasted in scripts. The fixes are the same as the earliest ones in this guide: agents, a credentials store and configuration as code.
An online retailer
Retail teams with hundreds of builds a day feel queue and scheduling mistakes first: everyone scheduled at midnight, waiting builds holding executors and no cancellation of outdated builds. Small changes to schedules and waits return capacity without new hardware.
A bank
Regulated firms are audited for permissions, approvals and evidence. Shared accounts, missing approver names and untested backups are the findings that hurt most. Individual accounts, role-based access and recorded approvals answer them.
An open-source project
Public projects meet strangers’ pull requests every day. They learn quickly, sometimes painfully, that trust policies, the target branch’s Jenkinsfile and secret-free pull request builds are not optional.
A mobile team
Mobile builds are slow and machines are expensive. Hung device tests without timeouts, executors held during approvals and leftover workspaces on scarce machines are their typical mistakes, and timeouts plus cleanup are their typical cure.
A company after an upgrade weekend
A team updates thirty plugins at once on production and discovers on Monday that half their pipelines fail. With no test copy and no fresh backup, they spend three days untangling it. Afterwards they adopt a test controller and an update routine, and never repeat the weekend.
31A Complete Story: A Team’s Year of Quiet Fixes
Follow one imaginary team through a review of their own Jenkins.
A team of forty developers runs Jenkins that “just works.” After a scare, a colleague named Priya proposes a small review using the self-audit table. It takes an afternoon and finds many “no” answers.
The scare
A test hangs over a weekend and holds three executors until Monday. Queues build up, and nobody knew until people complained.
The audit
Priya scores the self-audit. Builds run on the controller, no pipeline has a timeout, secrets sit in three Jenkinsfiles, there is no tested backup and everybody is an administrator.
Week one: the biggest blast radii
They revoke and replace the exposed secrets and move them into the credentials store. They set the controller’s executors to zero and add three container agents.
Week two: access
They move to individual accounts with roles by folder, and shrink the administrator group from twenty-two to three.
Week three: reliability
They add a starter template with a timeout, timestamps, history limits and a cleanup block. Approvals move outside agents with time limits. Alerts now cover aborted and unstable runs.
Week four: recovery
They schedule encrypted backups off the machine and perform their first restore. It takes six hours and reveals two missing pieces, which they fix. The next restore takes ninety minutes.
Months two to four: hygiene
They pin image tags and shared library versions, prune plugins from 140 to 62, move configuration into code, and spread scheduled jobs across the hour.
A quiet year
Six months later a plugin has a security advisory. They update a test copy, run the sample pipelines and patch production the same afternoon. Another weekend, a test hangs again, a timeout fires, the temporary environment is destroyed, and an alert appears. Nobody loses a weekend.
None of these steps needed new products or a large budget. They needed an afternoon of honest review and a few weeks of small, ordered fixes. The team’s Jenkins looked exactly the same from the outside, and behaved very differently on the days that mattered.
32Troubleshooting Guide: From Symptom to Likely Mistake
When something goes wrong, this table points at the habit behind it.
| Symptom | Likely mistake | First check |
|---|---|---|
| Jenkins pages slow, builds start late | Builds or heavy scripts on the controller; history bloat | Built-in executors; controller memory and disk; job history |
| Controller disk keeps filling | No build discarder; large artifacts stored on the controller | History limits and artifact size |
| Executors busy but nothing running | Waits held inside agents; hung builds | Approval prompts and sleeps inside agent blocks; timeouts |
| Builds pass on one agent, fail on another | Drift and leftover workspaces | Tool versions; workspace contents |
| Pipeline suddenly fails with no code change | Floating versions | Image tags, dependency ranges, library and plugin versions |
| Green build, but a step clearly failed | Swallowed errors; pipes without failure detection | Error-catching wrappers; ignored exit codes |
| No alert for a hung or timed-out build | Alerts only on failure | Aborted and unstable handling in post |
| Reports missing on failed builds | Workspace deleted too early in post | Move deletion to cleanup |
| Everyone starts jobs at midnight | Fixed schedules | Use the hash symbol in schedules |
| Update broke many jobs | Untested plugin updates | Test copy, update notes, rollback plan |
| Secret found in a log | Printing or double-quoted commands | Revoke it; fix quoting; review bindings |
| Unknown person changed a job | Shared accounts; loose permissions | Individual logins; roles by folder |
| Deployment happened from a feature branch | Negative or missing branch condition | Positive conditions; scoped credentials |
A calm debugging routine
- Describe the symptom precisely, including when it started.
- Ask what changed: code, pipeline, plugin, agent image, upstream version.
- Check the layer: controller, agent, pipeline code, secrets, delivery or people.
- Read the log with timestamps to find the exact moment things diverged.
- Fix the cause and add the habit to the template or the audit, so it cannot return.
33Plain-English Glossary
Every important word in this guide in one place.
| Word | Simple meaning |
|---|---|
| Jenkins | A free automation server that builds, tests and delivers software. |
| Pipeline | A written recipe of the steps Jenkins follows. |
| Jenkinsfile | The text file holding the pipeline, stored with the code. |
| Stage and step | A named phase, and a single action inside it. |
| Controller | The main Jenkins server that schedules work and stores settings. |
| Agent | A worker machine or container that runs builds. |
| Executor | A slot on an agent that runs one build at a time. |
| Workspace | The folder on an agent where a build works. |
| Blast radius | How far the damage of a mistake can spread. |
| Drift | Things that should match slowly becoming different. |
| Least privilege | Giving only the access that is needed. |
| Post section | A block that reacts when a stage or pipeline ends. |
| Timeout | A deadline after which a step is stopped. |
| Aborted | The gray result for runs stopped by a person, a timeout or a newer build. |
| Unstable | The yellow result for builds that finished with soft problems. |
| Flaky test | A test that sometimes passes and sometimes fails on the same code. |
| Pinning | Fixing an exact version instead of accepting whatever is newest. |
| Shared library | A reusable module of pipeline code. |
| Configuration as Code | Describing Jenkins settings in files applied automatically. |
| Webhook | An automatic message from the code host telling Jenkins something changed. |
| Fork | A personal copy of a repository, often owned by an outsider. |
34Frequently Asked Questions
Short answers to the questions that come up most often.
35Summary and Key Takeaways
The whole story in a few lines.
Intermediate Jenkins mistakes are quiet shortcuts that work today and cost more tomorrow: builds on the controller, hand-made configuration, secrets in the wrong places, missing deadlines and cleanup, executors held during waits, heavy scripts on the controller, swallowed errors, floating versions, plugin sprawl, untested backups, loose permissions, trusting outside pull requests and deployments from anywhere. They share one cure: make good habits automatic through templates, code, guardrails and regular reviews, and fix the largest blast radius first.
Key Takeaways
- Quiet mistakes are the costly ones. They work on the day they are made and fail later, so review your setup before something forces you to.
- Protect the largest blast radius first. Secrets, the controller, backups and permissions come before speed and polish.
- Run builds on agents, never on the controller. Set its executors to zero, and keep the pipeline script thin.
- Put everything in code. Pipelines, settings, plugin lists and agent images should be versioned, reviewed and rebuildable.
- Give every wait an end and every run a cleanup. Use timeouts, release executors during long waits and alert on aborted and unstable results.
- Pin, test and update on purpose. Fix versions of images, libraries, tools and plugins, and move them forward through a tested routine with a fresh backup.
- Trust narrowly and watch constantly. Use least privilege, keep secrets away from untrusted builds, allow deployment only from named places, and monitor queue, disk, agents and durations.