Bamboo build fails to publish artifact due to HTTP 413 Request Entity Too Large.
Problem
Bamboo build fails to publish artifact due to HTTP 413 Request Entity Too Large.
Diagnosis
The following is present in the remote agent log; <bamboo-agent-home>/atlassian-bamboo-agent.log:
INFO | jvm 1 | 2017/07/24 08:53:46 | 2017-07-24 08:53:46,212 INFO [0-BAM::remote-agent-name::Agent:pool-3-thread-1] [AbstractArtifactManager] Publishing [Artifact-Name] for PROJ-PLAN-JOB-#: 1 file(s) matching [**/*] in directory /home/bamboo/bamboo-agent-home/xml-data/build-dir/PROJ-PLAN-JOB
INFO | jvm 1 | 2017/07/24 08:53:46 | 2017-07-24 08:53:46,213 INFO [0-BAM::remote-agent-name::Agent:pool-3-thread-1] [AbstractArtifactManager] Trying to publish the artifact with handler: com.atlassian.bamboo.build.artifact.BambooRemoteArtifactHandler
INFO | jvm 1 | 2017/07/24 08:53:50 | 2017-07-24 08:53:50,240 INFO [0-BAM::remote-agent-name::Agent:pool-3-thread-1] [BambooArtifactHttpTransport] Finished writing the artifact to the output stream, time elapsed: 3.994 s
INFO | jvm 1 | 2017/07/24 08:53:50 | 2017-07-24 08:53:50,241 ERROR [0-BAM::remote-agent-name::Agent:pool-3-thread-1] [BambooArtifactHttpTransport] Unexpected HTTP status code: HTTP/1.1 413 Request Entity Too Large
The error is not present in the build log. The build log simply states:
error 24-Jul-2017 08:53:50 Unable to publish artifact [Artifact-Name]:
Cause
The Reverse Proxy or Load Balancer handling HTTP traffic between the remote agent and Bamboo Server is rejecting the request because it's too large.
Resolution
Increase this limit in the proxy configuration. For example:
NGINX: The
client_max_body_size
property, set in thenginx.conf
file will control this limit. See the NGINX documentation for more details:- Apache HTTPD:
LimitRequestBody
orLimitRequestFieldSize
in thehttpd.conf
file, or other appropriate Apache conf file. See the Apache documentation on these properties for further information: - IIS: Adjust the UploadReadAheadSize metabase property, like below by replacing <value in bytes> with the value in bytes. The default value is 48KB.
- cscript adsutil.vbs set w3svc/1/uploadreadaheadsize <value in bytes>