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

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

本文介绍了Jenkins Artifactory插件在尝试上传大型工件时给出了意外字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Jenkins Artifactory插件. Artifactory安装在Nginx服务器旁边.有时,詹金斯(Jenkins)在上传时返回错误:

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.

推荐答案

此问题是Nginx问题.当我尝试从其他软件(例如DNC)使用"PUT"操作时,出现Nginx错误消息,而不是Artifactory.这就是Artifactory无法理解它的原因.

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

结果:

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

您需要在Nginx配置文件中增加client_max_body_size:/etc/nginx/nginx.conf

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代表您需要上传的工件的最大大小.

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

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

这篇关于Jenkins Artifactory插件在尝试上传大型工件时给出了意外字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 10:00