I'm receiving the following error in my Jenkins console output when it tries to access the Bitbucket repository and fails with the following error:
fatal: unable to access 'https://username:****@bitbucket.org/workspacename/reponame.git/': Port number ended with 'F'
I have used the Jenkins declarative pipeline script on my Jenkins server to retrieve the Bitbucket repository to pull the repo.
I have entered the Bitbucket login and password in Jenkins's manage credential and used that credential id in the script to authenticate the repository.
stage('Pull from Bitbucket') {
steps {
withCredentials([usernamePassword(credentialsId: 'credentialsidnumber', passwordVariable: 'BITBUCKET_PASS', usernameVariable: 'BITBUCKET_USER')]) {
script {
sh """
git pull https://${BITBUCKET_USER}:${BITBUCKET_PASS}@bitbucket.org/workspacename/reponame.git/ main --allow-unrelated-histories
echo "pulling main from Bitbucket"
"""
}
}
}
}
So can any know this issue why it occur and how we can resolve this ?
Hi @Biztech-Devops and welcome to the community!
Are you using your account's password for authentication? I've seen this error occur with passwords that have special characters.
Regardless of that, we have deprecated the use of account passwords for Git over HTTPS and API, so the account's password will not work even if it doesn't contain special characters. If you want to clone, pull, or push to a repo with Basic Authentication via HTTPS, you will need to generate an app password and use that instead of your account's password.
You can find more info on app passwords and how to generate one here:
The app password should be used along with the username (you are already doing that). Please make sure that you use the username of your account, listed here:
Please feel free to let me know how it goes and if you need further assistance.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.