为什么我的 NuGet 库从 nuget push 返回 500? [英] Why does my NuGet Gallery return 500 from nuget push?

查看:70
本文介绍了为什么我的 NuGet 库从 nuget push 返回 500?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我工作的 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>

</html>

我正在从命令行使用 NuGet 版本:1.6.21205.9031.

What could the problem be?

可能是什么问题?

编辑:在网站的 api 文件夹上启用详细的错误页面后,我得到了上述 500 响应:

Server Error in Application "NUGET" Internet Information Services 7.0 Error Summary HTTP Error 500.0 - Internal Server Error The page cannot be displayed because an internal server error has occurred. Detailed Error Information Module = LiveStreamingHandler Notification = MapRequestHandler Handler = WebDAV Error Code = 0x80070585 Requested URL = http://somenearbyserver:80/api/v2/package/ Physical Path = M:\path\to\nuget-gallery\api\v2\package\ Logon Method = Anonymous Logon User = Anonymous

还包括一些帮助文本、基于验证权限的建议等,但据我所知,权限没有问题.

There's also some help text included, suggestions based on verifying permissions and such, but as far as I can tell there's nothing wrong with the permissions.

推荐答案

我通过更改 IIS 用户的权限解决了这个问题.我为 IIS_IUSRS 添加了写入权限.

I fixed this issue by changing the permissions for the IIS user. I added write permissions to IIS_IUSRS.

右键单击IIS中的站点>编辑权限 >安全

从那里添加用户或组并授予他们写入权限.

From there you add the user or group and give them write permissions.

这篇关于为什么我的 NuGet 库从 nuget push 返回 500?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆