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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Joel Ng
Hello,

I'm getting this strange issue where the checkout command doesn't seem to checkout the latest commit.

This is my error:
[Pipeline] checkout
14:52:51  The recommended git tool is: NONE
14:52:51  using credential repo-access
14:52:51   > git rev-parse --is-inside-work-tree # timeout=10
14:52:51  Fetching changes from the remote Git repository
14:52:51   > git config remote.origin.url [hidden email]:redacted.git # timeout=10
14:52:52  Fetching upstream changes from [hidden email]:redacted.git
14:52:52   > git --version # timeout=10
14:52:52   > git --version # 'git version 2.23.3'
14:52:52  using GIT_SSH to set credentials Git access
14:52:52   > git fetch --tags --force --progress -- [hidden email]:redacted.git +refs/heads/*:refs/remotes/origin/* # timeout=10
14:52:54   > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
14:52:54   > git rev-parse origin/master^{commit} # timeout=10

This is my checkout command:
scmVars = checkout scm: [
    $class: 'GitSCM',
    userRemoteConfigs: [[credentialsId: "${GIT_CREDENTIALS}", url: "${GIT_URL}"]]
]

This repository has no "master" branch, it only has a "development" branch.

From the docs (https://www.jenkins.io/doc/pipeline/steps/workflow-scm-step/) it says that leaving the branch empty means it will scan all branches, so I was expecting it to checkout the "development" branch. But it seems to be attempting to grab the "master" branch. Why is that?

Thanks in advance!
Regards,
Joel

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3a1c8643-b888-4576-a7fa-45b6bda50d36n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

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

Mark Waite-2
In this case, since you're inside a pipeline that is running, I don't think that you want to scan all branches.  I think that you want to use the branch that was already determined by the multibranch pipeline that started the job.  So long as you are inside a multibranch pipeline, the settings for the 

On Fri, Oct 16, 2020 at 6:07 AM 'Joel Ng' via Jenkins Users <[hidden email]> wrote:

This is my checkout command:
scmVars = checkout scm: [
    $class: 'GitSCM',
    userRemoteConfigs: [[credentialsId: "${GIT_CREDENTIALS}", url: "${GIT_URL}"]]
]


scmVars = checkout scm: [
    $class: 'GitSCM',
    branches: scm.branches,
    userRemoteConfigs: scm.userRemoteConfigs
]

There is an example here if you'd like to see something more in context.
 
This repository has no "master" branch, it only has a "development" branch.

From the docs (https://www.jenkins.io/doc/pipeline/steps/workflow-scm-step/) it says that leaving the branch empty means it will scan all branches, so I was expecting it to checkout the "development" branch. But it seems to be attempting to grab the "master" branch. Why is that?

Thanks in advance!
Regards,
Joel

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3a1c8643-b888-4576-a7fa-45b6bda50d36n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHxwrtDgedJyBU0XinUK2W00k%2Bb%2BSz1p393o4kEsLRAqg%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

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

Joel Ng
Ah! Thank you so much, it's finally working as expected.

This problem was driving me mad

On Friday, October 16, 2020 at 8:21:41 PM UTC+8 Mark Waite wrote:
In this case, since you're inside a pipeline that is running, I don't think that you want to scan all branches.  I think that you want to use the branch that was already determined by the multibranch pipeline that started the job.  So long as you are inside a multibranch pipeline, the settings for the 

On Fri, Oct 16, 2020 at 6:07 AM 'Joel Ng' via Jenkins Users <[hidden email]> wrote:

This is my checkout command:
scmVars = checkout scm: [
    $class: 'GitSCM',
    userRemoteConfigs: [[credentialsId: "${GIT_CREDENTIALS}", url: "${GIT_URL}"]]
]


scmVars = checkout scm: [
    $class: 'GitSCM',
    branches: scm.branches,
    userRemoteConfigs: scm.userRemoteConfigs
]

There is an example here if you'd like to see something more in context.
 
This repository has no "master" branch, it only has a "development" branch.

From the docs (https://www.jenkins.io/doc/pipeline/steps/workflow-scm-step/) it says that leaving the branch empty means it will scan all branches, so I was expecting it to checkout the "development" branch. But it seems to be attempting to grab the "master" branch. Why is that?

Thanks in advance!
Regards,
Joel

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/3a1c8643-b888-4576-a7fa-45b6bda50d36n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e10487a-3dc5-4bd9-8766-db348cf0543dn%40googlegroups.com.