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

怎甘沉沦 提交于 2020-01-07 02:59:11

问题


I use the Jenkins Artifactory plugin. Artifactory is installed beside Nginx server. Sometimes, Jenkins return an error on upload:

[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.


回答1:


This problem is an Nginx problem. When I try to use "PUT" action from an other software (ex : DNC), I have an Nginx error message, not Artifactory. This is why Artifactory is unable to understand it.

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

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

500M represents the maximum size of your artifact you need to upload.

more informations here: http://www.cyberciti.biz/faq/linux-unix-bsd-nginx-413-request-entity-too-large/



来源:https://stackoverflow.com/questions/35922145/jenkins-artifactory-plugin-give-unexpected-character-when-trying-to-upload-large

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!