ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

2,238 views
Skip to first unread message

Shiv Patel

unread,
Dec 22, 2021, 7:04:00 AM12/22/21
to Jenkins Users
Started by user admin [Pipeline] Start of Pipeline [Pipeline] node Running on Jenkins in C:\ProgramData\Jenkins\.jenkins\workspace\terraformCICD [Pipeline] { [Pipeline] stage [Pipeline] { (fetch_latest_code) [Pipeline] git Selected Git installation does not exist. Using Default The recommended git tool is: NONE using credential e7d2502e-6621-49c6-a934-813269c16141 > C:\Program Files\Git\bin\git.exe rev-parse --resolve-git-dir C:\ProgramData\Jenkins\.jenkins\workspace\terraformCICD\.git # timeout=10 Fetching changes from the remote Git repository > C:\Program Files\Git\bin\git.exe config remote.origin.url https://github.com/****/test # timeout=10 Fetching upstream changes from https://github.com/*****/test > C:\Program Files\Git\bin\git.exe --version # timeout=10 > git --version # 'git version 2.21.0.windows.1' using GIT_ASKPASS to set credentials > C:\Program Files\Git\bin\git.exe fetch --tags --force --progress -- https://github.com/****/test +refs/heads/*:refs/remotes/origin/* # timeout=10 > C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10 > C:\Program Files\Git\bin\git.exe rev-parse "origin/master^{commit}" # timeout=10 [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (TF Init&Plan) Stage "TF Init&Plan" skipped due to earlier failure(s) [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (Approval) Stage "Approval" skipped due to earlier failure(s) [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (TF Apply) Stage "TF Apply" skipped due to earlier failure(s) [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Finished: FAILURE

Melo Vi

unread,
Dec 22, 2021, 5:04:38 PM12/22/21
to Jenkins Users
Have you verified that the commit hash you are trying to build exists in your git repository?

Ivan Fernandez Calvo

unread,
Dec 23, 2021, 5:55:09 AM12/23/21
to Jenkins Users
if it is a relatively new repository on GitHub the default branch is ‘main’ not ‘master’ so you have to check you are passing that branch in the SCM configuration

Shiv Patel

unread,
Dec 23, 2021, 9:49:46 AM12/23/21
to Jenkins Users
I had tried using the main branch for the new git repo but still no lucks 

Started by user admin
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/workspace/terra
[Pipeline] {
[Pipeline] stage
[Pipeline] { (Checkout)
[Pipeline] checkout

The recommended git tool is: NONE
No credentials specified
 > /usr/bin/git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/terra/.git # timeout=10

Fetching changes from the remote Git repository
 > /usr/bin/git config remote.origin.url https://github.com/abc/new # timeout=10
Fetching upstream changes from https://github.com/abc/new
 > /usr/bin/git --version # timeout=10
 > git --version # 'git version 2.25.1'
 > /usr/bin/git fetch --tags --force --progress -- https://github.com/abc/new +refs/heads/*:refs/remotes/origin/* # timeout=10
 > /usr/bin/git rev-parse refs/remotes/origin/main^{commit} # timeout=10
 > /usr/bin/git rev-parse origin/main^{commit} # timeout=10

[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (terraform init)
Stage "terraform init" skipped due to earlier failure(s)

[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (terraform Action)
Stage "terraform Action" skipped due to earlier failure(s)

[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
Finished: FAILURE

kuisathaverat

unread,
Dec 23, 2021, 3:02:44 PM12/23/21
to jenkins...@googlegroups.com
the first execution and the second are different, the first one has configured credentials, and the second no, also one is using git and the other GitHub in the SCM configuration, If the repo is not public you'd need credentials, one is running in windows and the other in Linux. 

---

[Pipeline] git Selected Git installation does not exist. Using Default The recommended git tool is: NONE using credential e7d2502e-6621-49c6-a934-813269c16141 > C:\Program Files\Git\bin\git.exe rev-parse --resolve-git-dir C:\ProgramData\Jenkins\.jenkins\workspace\terraformCICD\.git # timeout=10
---

[Pipeline] { (Checkout)
[Pipeline] checkout
The recommended git tool is: NONE
No credentials specified
 > /usr/bin/git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/terra/.git # timeout=10
Fetching changes from the remote Git repository
 > /usr/bin/git config remote.origin.url https://github.com/abc/new # timeout=10
Fetching upstream changes from https://github.com/abc/new

---

The configuration should look like the following (changing your repo and credentials), you can test with the repo in the capture that is a public repository (https://github.com/elastic/apm-pipeline-library.git), test it with and without GitHub credentials.

Screenshot 2021-12-23 at 20.58.39.png

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/VZ3j-xB-zlk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/390a5c74-87b7-47aa-a4b9-2d479864a2c2n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages