Jenkins, BitBucket and Proxy Errors 128 and 502

Viewed 401

I have Jenkins configured to poll bitbucket periodically and download/build/deploy my app if there have been any changes (git push). It works perfectly when I'm running Jenkins on my Windows PC behind a corporate VPN.

The problem I have is when trying to do the same on a Linux (Ubuntu 16.04.7 LTS) box residing inside the corporate network that has a proxy server configured.

Here's what my Jenkins Plugin Advanced tab looks like: enter image description here

Here's what my Pipeline SCM looks like: enter image description here

I've also tried disabling the proxy server by adding these lines to the top of the file at /etc/default/jenkins

unset http_proxy
unset https_proxy
unset HTTP_PROXY
unset HTTPS_PROXY

I restarted Jenkins after making those changes and also removed the jenkins proxy config.

I've also mirrored my repo at gitlab and I get the same errors when Jenkins is configured with gitlab as I do with bitbucket.

Thoughts?

1 Answers

This is how I'd go about solving the problem:

  • Try to complete the process without Jenkins. That is, writing a script of sorts that checks BitBucket and builds your app. If this fails, then the problem is with the machine, not Jenkins.

If the machine is at fault:

  • Check its VPN configuration. Have the script working then try again with Jenkins.

Else (Jenkins is at fault):

  • Consider using the BitBucket hook for Jenkins.
  • If you're already using it (which you could let us know if so) or don't intend to use it, ensure that Jenkins is well-configured, as suggested by Carsten Hilber on Jenkins' Atlassian site:

The settings were different between Jenkins and the bash. When building, jenkins loaded some proxy configuration that were set in a .gitconfig for the Jenkins user. When removing this, everything ran as expected.

Related