How to bypass the Reverse Proxy used by a Bamboo Server in an Agent connection
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
要約
This article covers possible solutions to overcome Agent communication problems while transferring Artifacts to and from the Bamboo server.
If you are attempting this in order to fix artifact transfer problems (rejections, timeouts, etc.). Make sure the Proxy server supports HTTP/1.1: Agent upload of artifacts fails to set Content-Length in HTTP/1.1. Guiding questions:
- Is HTTP/1.0 compatibility turned on?
- Are there any configuration options turned on related to chunked transfer encoding?
環境
- Bamboo Server or Data Center
- Remote or Elastic Agent
- Artifact transfers from and to the Bamboo instance
診断
The Bamboo Server and Remote Agents may report issues while transferring Artifacts when a Load Balancer or Reverse Proxy is configured between both elements. Though Load Balancers are normally welcome on Bamboo setups, there may be cases where they may interfere with proper traffic and end up creating issues such as the reported error below on a Bamboo Agent logs at <Bamboo-Agent-Home>/atlassian-bamboo-agent.log
.
INFO | jvm 1364 | 2024/10/14 10:00:33 | 2024-10-14 10:00:33,728 INFO [0-BAM::RemoteAgent-80139::Agent:pool-4-thread-1] [TaskExecutorImpl] Starting task 'Download release contents' of type 'com.atlassian.bamboo.plugins.bamboo-artifact-downloader-plugin:artifactdownloadertask'
.................................
INFO | jvm 1364 | 2024/10/14 10:05:39 | java.net.SocketException: Connection reset
INFO | jvm 1364 | 2024/10/14 10:05:39 | at java.net.SocketInputStream.read(SocketInputStream.java:186) ~[?:?]
Bamboo Elastic Agents may encounter issues when the Bamboo URL resolves to an IP address different from the one hosted on the Bamboo Server machine. This occurs because Bamboo establishes a tunnel to the Elastic Agent, which then attempts to connect back to the Bamboo Server using that URL. If the URL resolves to an external IP address, the server may try to connect to that location using external routes, leading to instability or failed connections. This phenomenon is better explained by this KB article:
ソリューション
Remote Agents
- Stop Bamboo
- Edit the
<Bamboo-Install>/conf/server.xml
file - Add a new HTTP connector without the attributes (proxyName and proxyPort) pointing to a different port
- Start Bamboo
Stop the Remote Agent
Update the <URL:PORT> used by your Agent to match new connector added. On your
<Bamboo-Agent-Home>/conf/wrapper.conf
, modify thewrapper.app.parameter.2
property to point to the Bamboo proxy-bypass URL and port.- Restart the agent
Elastic Agents
- Stop Bamboo
Add the following system property in your Bamboo startup JVM (more details on Configuring your system properties)
setenv.sh-Dbamboo.ec2.agent.endpoint=http://localhost:8085
Make sure to replace port 8085 with the Tomcat port configured in your Bamboo instance.
You may need to updatebamboo.jms.broker.client.uri
to match the non-proxied URL.- Start Bamboo
- Start a new Elastic Agent