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

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

问题描述

我在我工作的 Web 服务器(在 IIS 7.0 下)上设置了新的 NuGet 库.该站点本身已设置并运行良好.我们可以注册帐户、确认电子邮件地址,甚至可以通过网站本身上传一个新包.

我们的自动化构建脚本需要能够将新构建的 NuGet 包推送到库.当我使用 NuGet 的推送命令时:

nuget.exe push build
ugetBaconAndEggs.1.0.0.1.nupkg 1451002a-8c63-4174-b7ed-73dd3e7bcdf0 - 来源 http://somenearbyserver/

我得到以下结果:

将 BaconAndEggs 1.0.0.1 推送到 'http://somenearbyserver/'...处理请求失败.'内部服务器错误'.远程服务器返回错误:(500) Internal Server Error..

网站可以正常上传新包,但命令行不行.如果我在 fiddler 运行的情况下尝试推送命令,它会在执行推送命令时观察到两个连续的请求.一个似乎正在触摸该站点以确保它在那里,而第二个是实际的推送命令.

请求 1: GET http://somenearbyserver/200 OK请求 2:PUT http://somenearbyserver/api/v2/package/500 内部服务器错误

PUT 请求的内容是正确的,它包含 API 密钥和有效负载.在 Web 服务器上查看,事件查看器中没有错误,并且 elmah 没有捕获任何内容.

Fiddler 将此显示为对 PUT 的响应:

HTTP/1.1 500 内部服务器错误内容类型:文本/html服务器:Microsoft-IIS/7.0X-Powered-By: ASP.NET日期:格林威治标准时间 2012 年 1 月 18 日,星期三 20:21:08连接:关闭内容长度: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"><头><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/><title>500 - 内部服务器错误.</title><style type="text/css"><!--body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}字段集{填充: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;背景颜色:#555555;}#content{margin:0 0 0 2%;位置:相对;}.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}--></风格></头><身体><div id="header"><h1>服务器错误</h1></div><div id="内容"><div class="content-container"><fieldset><h2>500 - 内部服务器错误.</h2><h3>你要找的资源有问题,无法显示.</h3></fieldset></div></div></身体></html>

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

可能是什么问题?

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

<上一页>应用程序NUGET"中的服务器错误互联网信息服务 7.0错误摘要HTTP 错误 500.0 - 内部服务器错误由于发生内部服务器错误,无法显示该页面.详细的错误信息模块 = LiveStreamingHandler通知 = MapRequestHandler处理程序 = WebDAV错误代码 = 0x80070585请求的 URL = http://somenearbyserver:80/api/v2/package/物理路径 = M:path o uget-galleryapiv2package登录方法 = 匿名登录用户 = 匿名

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

解决方案

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

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

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

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.

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
ugetBaconAndEggs.1.0.0.1.nupkg 1451002a-8c63-4174-b7ed-73dd3e7bcdf0 -Source http://somenearbyserver/

I get the following result:

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

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

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

I'm using NuGet Version: 1.6.21205.9031 from the command line.

What could the problem be?

EDIT: After enabling detailed error pages on the api folder in the site, I get this with the 500 response described above:

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	o
uget-galleryapiv2package
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.

解决方案

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

Right click the site in IIS > edit permissions > security

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

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

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