You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What Operating System are you using (both controller, and any agents involved in the problem)?
Running in Docker.
Jenkins-Master: jenkinsci/blueocean:latest
Node doing the Checkout: jenkins/agent:latest (custom dockerfile used to update LFS to latest version)
Versions on Node:
git version 2.30.2
git-lfs/3.1.4 (GitHub; linux amd64; go 1.17.8)
Reproduction steps
Added a multi-branch pipeline using Bitbucket OAuth (Repository discovered via Credentials & Owner)
Attempted to do a 'checkout scm'-step in the first stage of my pipeline
Checkout fails if LFS-files are present in the repository
Expected Results
LFS files are pulled from the relevant LFS-repository for the Bitbucket-Repo set for the jenkins-project
Actual Results
Pulling the files fails with the following error:
batch request: missing protocol: "<unknown>"
Failed to fetch some objects from '<unknown>'
Anything else?
It looks like the 'endpoint' is not being set in the LFS-environment
I have tried pulling with --skip-smudge before the checkout scm and doing a manual git lfs pull, with the same result.
Tried both with & without the 'Git LFS pull after checkout'-behaviour in the project-configuration (on jenkins). The result is always the same: Missing protocol: "unknown"
Output of logging-attempt below (tokens & identifiers replaced):
(Skipped copying empty config, this is pre-checkout)
Check out from version control:
The recommended git tool is: NONE
using credential Bitbucket_OAuth
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository [https://x-token-auth:{**TOKEN**}@bitbucket.org/**USER**/**REPO**.git](https://x-token-auth:**TOKEN**@bitbucket.org/**USER**/**REPO**.git)
> git init /home/jenkins/agent/workspace/BuildTest_master # timeout=10
Fetching upstream changes from https://x-token-auth@bitbucket.org/**USER**/**REPO**.git
> git --version # timeout=10
> git --version # 'git version 2.30.2'
using GIT_ASKPASS to set credentials OAuth-Credentials for Bitbucket Repositories
> git fetch --no-tags --force --progress -- [https://x-token-auth:{**TOKEN**}@bitbucket.org/**USER**/**REPO**.git](https://x-token-auth:**TOKEN**@bitbucket.org/**USER**/**REPO**.git) +refs/heads/master:refs/remotes/origin/master # timeout=10
Avoid second fetch
Checking out Revision ec926cd8e6735a2451a44354d052bbb97efb7713 (master)
> git config remote.origin.url [https://x-token-auth:{**TOKEN**}@bitbucket.org/**USER**/**REPO**.git](https://x-token-auth:**TOKEN**@bitbucket.org/**USER**/**REPO**.git) # timeout=10
> git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master # timeout=10
> git config core.sparsecheckout # timeout=10
> git checkout -f ec926cd8e6735a2451a44354d052bbb97efb7713 # timeout=10
Commit message: "no message"
First time build. Skipping changelog.
[Bitbucket] Notifying commit build result
Can not determine Jenkins root URL or Jenkins URL is not a valid URL regarding Bitbucket API. Commit status notifications are disabled until a root URL is configured in Jenkins global configuration.
IllegalStateException: Jenkins URL cannot start with http://localhost/
I believe the issue is here.. Shouldn't "Endpoint" be filled at this point?
@sskjames I finally managed to do a workaround for it.
I added a 'normal' set of credentials (username & App-password) to Jenkins.
Then, when pulling (checkout scm), I skip LFS. Afterwards I set the lfs-url to the one using the Username & App-Password, then do a LFS pull with those:
sh 'git lfs install --skip-smudge' // Required because LFS is currently failing
script {
def scmVars = checkout scm
// Workaround for LFS: Manually set the LFS-URL using Username & App Password, then do a pull using those instead of the OAuth
// Remove everything up to @bitbucket.org from the Git URL (strip out the Bitbucket OAuth-credentials)
echo "Performing LFS-Workaround to fix issue with LFS not working when using OAuth-credentials"
def partialURL = sh(returnStdout: true, script: """echo $scmVars.GIT_URL | sed -e 's/https:\\/\\/.*:.*@bitbucket.org//'""")
partialURL = partialURL.replace('\0', '').replace('\n', '') // Remove Null-Char & End-Line
withCredentials([usernamePassword(credentialsId: 'Bitbucket_Basic', passwordVariable: 'BB_APP_PASS', usernameVariable: 'BB_USER')]) {
// Generate new LFS-URL using Username & App-Password
def LFSUrl = 'https://$BB_USER:$BB_APP_PASS@bitbucket.org' + partialURL + '/info/lfs'
sh "git config lfs.url ${LFSUrl}" // Set as LFS-URL for the pull
sh 'git lfs pull' // Pull LFS-files using workaround-config
}
}
I ran into this too when using oAuth. A simpler workaround is to use a username and app password for the entire job then add "Git LFS pull after checkout" to the job as well. That worked for me.
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Running in Docker.
Jenkins-Master: jenkinsci/blueocean:latest
Node doing the Checkout: jenkins/agent:latest (custom dockerfile used to update LFS to latest version)
Versions on Node:
git version 2.30.2
git-lfs/3.1.4 (GitHub; linux amd64; go 1.17.8)
Reproduction steps
Expected Results
LFS files are pulled from the relevant LFS-repository for the Bitbucket-Repo set for the jenkins-project
Actual Results
Pulling the files fails with the following error:
Anything else?
It looks like the 'endpoint' is not being set in the LFS-environment
I have tried pulling with --skip-smudge before the
checkout scm
and doing a manualgit lfs pull
, with the same result.Tried both with & without the 'Git LFS pull after checkout'-behaviour in the project-configuration (on jenkins). The result is always the same: Missing protocol: "unknown"
Output of logging-attempt below (tokens & identifiers replaced):
(Skipped copying empty config, this is pre-checkout)
I believe the issue is here.. Shouldn't "Endpoint" be filled at this point?
Config for good measure:
The text was updated successfully, but these errors were encountered: