简体   繁体   English

Jenkins Artifactory插件在尝试上传大型工件时给出了意外字符

[英]Jenkins Artifactory plugin give Unexpected character when trying to upload large artifacts

I use the Jenkins Artifactory plugin. 我使用Jenkins Artifactory插件。 Artifactory is installed beside Nginx server. Artifactory安装在Nginx服务器旁边。 Sometimes, Jenkins return an error on upload: 有时,Jenkins在上传时返回错误:

[main] ERROR org.jfrog.build.extractor.maven.BuildInfoClientBuilder - Failed while reading the response from: PUT https://XXXX.XXX/XX-XXXXXXX-XXX/com/XXXX/XXXX/xxxxxxxx/xxxxxxx-api/1.0.0-SNAPSHOT/xxxxxxx-api-1.0.0-SNAPSHOT-jar-with-dependencies.jar;build.timestamp=1457104033410;build.name=xxxxxxx-build;build.number=75 HTTP/1.1
org.codehaus.jackson.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')

This error is only when the file is larger then a specific size. 仅当文件大于特定大小时才会出现此错误。

This problem is an Nginx problem. 此问题是Nginx问题。 When I try to use "PUT" action from an other software (ex : DNC), I have an Nginx error message, not Artifactory. 当我尝试从其他软件(例如DNC)使用“ PUT”操作时,收到Nginx错误消息,而不是Artifactory。 This is why Artifactory is unable to understand it. 这就是Artifactory无法理解它的原因。

PUT https://XXXX.XXX/XX-XXXXXXX-XXX/com/XXXX/XXXX/xxxxxxxx/xxxxxxx-api/1.0.0-SNAPSHOT/xxxxxxx-api-1.0.0-SNAPSHOT-jar-with-dependencies.jar;build.timestamp=1457104033410;build.name=xxxxxxx-build;build.number=75 HTTP/1.1

Result: 结果:

<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.8.1</center>
</body>
</html>

You need to increase the client_max_body_size in your Nginx config file: /etc/nginx/nginx.conf 您需要在Nginx配置文件中增加client_max_body_size:/etc/nginx/nginx.conf

# set client body size to 500M #
client_max_body_size 500M;

500M represents the maximum size of your artifact you need to upload. 500M代表您需要上传的工件的最大大小。

more informations here: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/ 此处提供更多信息: http : //www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM