Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-21240

Outbound proxy with authentication doesn't work for remote agents

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 9.0.0
    • 6.10.6, 7.2.2
    • Agents
    • None

    Description

      Issue Summary

      Outbound proxy with authentication doesn't work for remote agents.

      Steps to Reproduce

      1. Setup a squid proxy that requires basic auth.
      2. Configure wrapper.conf to route via outbound proxy:
        wrapper.java.additional.3=-Dhttp.proxyHost=localhost
        wrapper.java.additional.4=-Dhttp.proxyPort=3128
        wrapper.java.additional.5=-Dhttp.proxyUser=user
        wrapper.java.additional.6=-Dhttp.proxyPassword=pass
        

      Expected Results

      Agent HTTP client responds to Proxy-Authenticate challenge with Proxy-Authorization details.

      Challenge response expectations for proxies detailed here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication

      Actual Results

      Agent does not send Proxy-Authorization header initially which is aligned with no preemptive authentication, but it then however does not send another request with Proxy-Authorization after it receives 407 challenge from the proxy with Proxy-Authenticate details for modes of authentication.

      Exchange observed in atlassian-bamboo-agent.log file:

      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,209 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 >> "CONNECT url HTTP/1.1[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,209 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 >> "Host: url[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,209 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5.5 (Java/1.8.0_201)[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,209 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 >> "[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,235 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "HTTP/1.1 407 authenticationrequired[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,235 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Via: ...[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Date: Wed, 03 Feb 2021 02:16:47 GMT[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Content-Type: text/html[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Cache-Control: no-cache[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Content-Length: 2106[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "X-Frame-Options: deny[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Proxy-Connection: Keep-Alive[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Proxy-Authenticate: NTLM[\r][\n]"
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,236 DEBUG [WrapperSimpleAppMain] [wire] http-outgoing-0 << "Proxy-Authenticate: Basic realm="..."[\r][\n]"
      ...
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 2021-02-03 12:15:01,267 ERROR [WrapperSimpleAppMain] [AgentContext] An error has occurred when requesting fingerprint: HTTP/1.1 407 authenticationrequired
      INFO   | jvm 1    | 2021/02/03 12:15:01 | Exiting due to fatal exception.
      INFO   | jvm 1    | 2021/02/03 12:15:01 | com.atlassian.bamboo.agent.bootstrap.RemoteAgentHttpException: Response: [HTTP/1.1 407 authenticationrequired] received after fingerprint request.
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at com.atlassian.bamboo.agent.bootstrap.AgentContext.initFingerprint(AgentContext.java:156)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at com.atlassian.bamboo.agent.bootstrap.AgentContext.initServerSession(AgentContext.java:101)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at com.atlassian.bamboo.agent.bootstrap.AgentContext.run(AgentContext.java:88)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.run(AgentBootstrap.java:112)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at com.atlassian.bamboo.agent.bootstrap.AgentBootstrap.main(AgentBootstrap.java:51)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at java.lang.reflect.Method.invoke(Method.java:498)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:349)
      INFO   | jvm 1    | 2021/02/03 12:15:01 | 	at java.lang.Thread.run(Thread.java:748)
      

      This is where it ends.

      Workaround

      No workaround known workaround available. Need to connect directly to your Bamboo Server without using an outbound proxy, or use a proxy that does not require authentication.

      Attachments

        Issue Links

          Activity

            People

              72548a1cec6d Wioletta Dys
              jowen@atlassian.com Jeremy Owen
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: