生产服务器上的500错误 - Web API [英] 500 error on production server - Web API

查看:134
本文介绍了生产服务器上的500错误 - Web API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我们在生产服务器上部署了一个web api 2服务,每件事都运行正常,有一天我们开始从其中一个获得500错误服务



我们通过一些lamda表达式调查了一个方法显示un handel null异常的错误代码



我们为重现问题所采取的步骤 -



步骤1.



我们指出生产服务器的开发代码,并试图重现问题 - 但它没有帮助代码工作正常。



步骤2.



我们没有从生产部署站点获取所有dll到使用数据库测试环境 - 代码在这里工作正常。无法重新生成问题。



步骤3.



我们将相同的dll重新部署到生产站点(我们之前仅从生产中复制过)...



代码开始工作,我们无法检查问题的根本原因。因为我们无法重现它,但突然之间为什么重新部署相同的dll解决了这个问题。



任何猜测???

解决方案

您是否有StackTrace或有关此错误的任何其他详细信息?



500错误是相当通用的服务器端错误,可能表明各种事情(编译问题,例外等)。您可以考虑暂时禁用web.config中的自定义错误,以便解决此问题。此外,您可以尝试在浏览器中使用开发人员工具(F12)并监控网络流量(这将允许您查看特定呼叫的请求/响应,并更深入地查看它们以检查错误)。



Fiddler也是解决这类问题的绝佳工具。

   


Hi ,

we had an web api 2 service deployed on production server, every thing was working fine and one day we have started getting 500 error from one of the sevice

We looked into the error codes its showing un handel null exception from one method by some lamda expression

Steps that we did to reproduce the issue-

Step 1.

We pointed out the dev code to production server and tried to reproduce the issue - but it didn't helped the code works fine.

Step 2.

We haven taken all the dll's from production deployment site to test environment with database - the code works fine over here too . Not able to re produce issue.

Step 3.

We redeployed the same dll to production site ( which we have copied earlier from production only)...

And code started working, we are unable to check what was the root cause of the issue. as we were not able to reproduce it, but then all of sudden why redeployment of same dll has resolved the issue.

any guesses ???

解决方案

Do you have a StackTrace or any other details regarding this error?

A 500 error is fairly generic server-side error that could indicate a variety of things (compilation issues, exceptions etc). You might consider disabling custom errors within your web.config temporarily so that you can troubleshoot this issue. Additionally, you might try using the Developer Tools (F12) within your browser and monitoring the Network traffic (this will allow you to see the Request / Response of your specific calls and look into them a bit deeper to check for errors).

Fiddler is also an excellent tool for troubleshooting issues like these.


这篇关于生产服务器上的500错误 - Web API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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