为什么我的 NuGet 库从 nuget push 返回 500? [英] Why does my NuGet Gallery return 500 from nuget push?
问题描述
我在我工作的 Web 服务器(在 IIS 7.0 下)上设置了新的 NuGet 库.该站点本身已设置并运行良好.我们可以通过网站本身注册帐户、确认电子邮件地址,甚至上传新的包裹.
I set up the new NuGet Gallery on a web server (under IIS 7.0) where I work. The site itself is set up and runs fine. We are able to register accounts, confirm email addresses, and even upload a new package through the site itself.
我们的自动构建脚本需要能够将新构建的 NuGet 包推送到库.当我使用 NuGet 的 push 命令时:
Our automated build scripts need to be able to push newly built NuGet packages to the gallery. When I use NuGet's push command:
nuget.exe push build\nuget\BaconAndEggs.1.0.0.1.nupkg 1451002a-8c63-4174-b7ed-73dd3e7bcdf0 -Source http://somenearbyserver/
我得到以下结果:
Pushing BaconAndEggs 1.0.0.1 to 'http://somenearbyserver/'...
Failed to process request. 'Internal Server Error'.
The remote server returned an error: (500) Internal Server Error..
该网站可以很好地上传新包,但命令行不行.如果我在 fiddler 运行的情况下尝试 push 命令,它会在执行 push 命令时观察到两个连续的请求.一个似乎是触摸网站以确保它在那里,而第二个是实际的推送命令.
The website is able to upload a new package just fine, but command line isn't. If I try the push command with fiddler running, it observes two consecutive requests while executing the push command. One appears to be touching the site to make sure it's there, while the second is the actual push command.
Request 1: GET http://somenearbyserver/ 200 OK
Request 2: PUT http://somenearbyserver/api/v2/package/ 500 Internal Server Error
PUT 请求的内容是正确的,它包含 API 密钥和有效负载.查看 Web 服务器,事件查看器中没有错误,elmah 也没有发现任何内容.
The content of the PUT request is correct, it contains the API key and the payload. Looking on the web server, there are no errors in the event viewer and elmah doesn't catch anything.
Fiddler 将此显示为对 PUT 的响应:
Fiddler shows this as the response to the PUT:
HTTP/1.1 500 Internal Server Error
Content-Type: text/html
Server: Microsoft-IIS/7.0
X-Powered-By: ASP.NET
Date: Wed, 18 Jan 2012 20:21:08 GMT
Connection: close
Content-Length: 1208
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>500 - Internal server error.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
<div class="content-container"><fieldset>
<h2>500 - Internal server error.</h2>
<h3>There is a problem with the resource you are looking for, and it cannot be displayed.</h3>
</fieldset></div>
</div>
</body>
</html>