// troubleshooting guide · jenkins
Jenkins Git 'Failed to Connect to Repository' Status Code 128
- Status
- Workaround available
- platforms:
- Jenkins (Git plugin), all OS
- updated:
- November 16, 2026
- reports:
- 4
- Method
- how we research
RUNBOOK · jenkins/git-status-code-1284 FIXES
// quick answer
Status 128 is git's generic failure: read the stderr line under it. Usually the job has no or wrong credentials, a token was rejected, or the jenkins user's SSH host key/known_hosts is missing.
Most likely fix: Select or fix credentials
How to fix it
// try these in order, the most common fix is first
FIX 1Select or fix credentials
- 01Job > Configure > Source Code Management > Credentials
- 02For HTTPS use Username with password where the password is a personal access token
- 03For SSH use SSH Username with private key and a git@ URL
Did this fix it?FIX 2Fix SSH host key verification
- 01Go to Manage Jenkins > Security > Git Host Key Verification Configuration
- 02Choose Accept first connection or Known hosts file, or as the jenkins user run ssh -T git@github.com once to add the host
Did this fix it?FIX 3Test as the jenkins user
- 01Run sudo -u jenkins git ls-remote <repo URL> on the controller or agent
- 02Fix whatever error appears there (auth, network, proxy) before retrying in Jenkins
Did this fix it?FIX 4Install or update git
- 01Check git --version on the node running the job
- 02Install a current git and set its path in Manage Jenkins > Tools > Git installations
Did this fix it?
SANDBOX · jenkins RUNS IN YOUR BROWSER
Try it: push, review, run CI and merge in a code host and cloud workspace
A hands-on Jenkins-style sandbox, including the spots where users get stuck. See where problems like this one start. 1-2 minutes, nothing is saved.
Symptoms
Job configuration shows 'Failed to connect to repository: Command "git ls-remote -h ... HEAD" returned status code 128', or builds fail with hudson.plugins.git.GitException ... returned status code 128.
Why it happens
- C-01No credential selected in the job's Source Code Management section
- C-02Password used instead of a personal access token, or the token expired
- C-03SSH key not authorized (Permission denied (publickey))
- C-04Host key verification failed because the host isn't in known_hosts
- C-05Git missing or too old on the controller/agent
// this guide also covers
- jenkins failed to connect to repository
- returned status code 128 jenkins
- jenkins git permission denied publickey
- jenkins host key verification failed
Still not working?
If Jenkins keeps failing, you're not alone. See every Jenkins problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other Jenkins errors
- Jenkins Build Stuck 'Waiting for Next Available Executor'
- Jenkins Build Stuck and Won't Abort
- Jenkins Plugins Failed to Load After Update
- Jenkins Not Starting: 'Job for jenkins.service failed'
- Jenkins java.lang.OutOfMemoryError: Java Heap Space
- Why Is Jenkins So Slow?
- Jenkins 'Scripts Not Permitted to Use Method' Error
- Jenkins GitHub Webhook Not Triggering Build