Check and Update Credentials
The error message indicates that the authentication failed because user interactivity is disabled in the Jenkins environment. This usually happens when the credentials used are incorrect or not properly configured.
Solution: Double-check the Jenkins credentials. Ensure that the ‘Username and password’ credentials are correct, and use a Personal Access Token (PAT) as the password if necessary. After updating the credentials, go back to the URL field and press TAB to prompt Jenkins to validate the URL again.
Use the Credentials Plugin
If you are using Jenkins agent agents, you should use the credentials plugin to manage your Git credentials. Create a new credential for your Bitbucket user and add it to your Git checkout configuration.
Unset the ‘credential.helper’ Git Config Variable
Sometimes, the issue can be resolved by unsetting the ‘credential.helper’ git config variable. This has been reported to fix similar issues where the Jenkins build hangs during the fetch command.
Solution: Run the following commands to unset the ‘credential.helper’ git config variable:
git config --global --unset credential.helper
Check DNS and Proxy Settings
The issue might also be related to DNS resolution or proxy settings on the Jenkins server. Ensure that the DNS and server access are correctly configured.
Remove Corporate Proxy
If you are behind a corporate proxy, it might be causing the issue. Try removing the proxy settings in Jenkins.
Solution: Go to ‘Manage Jenkins → Manage Plugins → Advanced Settings’ and remove the proxy settings.
Update Known Hosts
If the host key for the Git server is unknown or invalid, you might need to update the .ssh/known_hosts file.
Solution: Delete the line with the host from your .ssh/known_hosts file and manually connect to the host using SSH to accept the host key again.
Command line git was not provided with credentials that allow it to authenticate with the remote repository. Since the repository URL is https, then the credential should be a username / password credential that allows access to the remote repository. Create it from inside the Jenkins “Credentials” page and use that credential in the job definition.