MongoDB的C#驱动报错Server instance 127.0.0.1:27017 is no longer connected的解决方案
使用C#的MondoDB驱动,一直没问题。结果最近,MongoCursor的ToList方法,取列表,总是报错
Server instance 127.0.0.1:27017 is no longer connected
数据什么的也是正常。
最后终于发现导致问题出现的原因。虽然解决方法不是很完美,但是也还解决问题了。
如果有其它好的解决方法的同学可以和我交流,微信:Jeff520888
错误信息如下:
<html>
<head>
<title>Server instance 127.0.0.1:27017 is no longer connected.</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head>
<body bgcolor="white">
<span><H1>“/”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1>
<h2> <i>Server instance 127.0.0.1:27017 is no longer connected.</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> 说明: </b>执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
<br><br>
<b> 异常详细信息: </b>System.InvalidOperationException: Server instance 127.0.0.1:27017 is no longer connected.<br><br>
<b>源错误:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code>
执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。</code>
</td>
</tr>
</table>
<br>
<b>堆栈跟踪:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
[InvalidOperationException: Server instance 127.0.0.1:27017 is no longer connected.]
MongoDB.Driver.MongoServerInstance.AcquireConnection() +140
MongoDB.Driver.MongoServer.AcquireConnection(MongoServerInstance serverInstance) +259
MongoDB.Driver.MongoCursorConnectionProvider.AcquireConnection() +56
MongoDB.Driver.Operations.QueryOperation`1.KillCursor(IConnectionProvider connectionProvider, Int64 cursorId) +44
MongoDB.Driver.Operations.<Execute>d__0.<>m__Finally6() +55
MongoDB.Driver.Operations.<Execute>d__0.System.IDisposable.Dispose() +211
MongoDB.Driver.Operations.<Execute>d__0.MoveNext() +598
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +406
System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
DAL.MongoHelper`1.Find(String collection, IMongoQuery query, String[] fields, String[] sortBys, Int32 skip, Int32 limit, Int64& totalNum) +934
DAL.Service.CommonService.GetNodePageList(MongoPageCriteria criteria) +146
DAL.Service.AppService.GetOrderListForPage(MongoPageCriteria criteria, Order ord) +5114
Admin.BLL.AppManager.GetOrderListForPage(MongoPageCriteria criteria, Order order) +51
Admin.View.OrderList.BindData() +807
Admin.View.OrderList.OnLoad(EventArgs e) +516
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
</pre></code>
</td>
</tr>
</table>
<br>
<hr width=100% size=1 color=silver>
<b>版本信息:</b> Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.1016
</font>
</body>
</html>
<!--
[InvalidOperationException]: Server instance 127.0.0.1:27017 is no longer connected.
在 MongoDB.Driver.MongoServerInstance.AcquireConnection()
在 MongoDB.Driver.MongoServer.AcquireConnection(MongoServerInstance serverInstance)
在 MongoDB.Driver.MongoCursor`1.MongoCursorConnectionProvider.AcquireConnection()
在 MongoDB.Driver.Operations.QueryOperation`1.KillCursor(IConnectionProvider connectionProvider, Int64 cursorId)
在 MongoDB.Driver.Operations.QueryOperation`1.<Execute>d__0.<>m__Finally6()
在 MongoDB.Driver.Operations.QueryOperation`1.<Execute>d__0.System.IDisposable.Dispose()
在 MongoDB.Driver.Operations.QueryOperation`1.<Execute>d__0.MoveNext()
在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
在 DAL.MongoHelper`1.Find(String collection, IMongoQuery query, String[] fields, String[] sortBys, Int32 skip, Int32 limit, Int64& totalNum)
在 DAL.Service.CommonService.GetNodePageList(MongoPageCriteria criteria)
在 DAL.Service.AppService.GetOrderListForPage(MongoPageCriteria criteria, Order ord)
在 Admin.BLL.AppManager.GetOrderListForPage(MongoPageCriteria criteria, Order order)
在 Admin.View.OrderList.BindData()
在 Admin.View.OrderList.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException]: 引发类型为“System.Web.HttpUnhandledException”的异常。
在 System.Web.UI.Page.HandleError(Exception e)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.view_orderlist_aspx.ProcessRequest(HttpContext context) 位置 c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\7b58857c\5cb9b318\App_Web_0b0m0xbf.18.cs:行号 0
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!--
此错误页可能包含敏感信息,因为 ASP.NET 通过 <customErrors mode="Off"/> 被配置为显示详细错误消息。请考虑在生产环境中使用 <customErrors mode="On"/> 或 <customErrors mode="RemoteOnly"/>。-->
MongoDB的C#驱动报错Server instance 127.0.0.1:27017 is no longer connected的解决方案的更多相关文章
- MySQL数据源驱动报错
报错信息:MySQL数据源驱动报错: 1.mysql8.0以上版本需要连接数据库的JDBC驱动也是8.0版本以上 com.mysql.cj.jdbc.Driver 2.MySQL高版本需要指明是否需要 ...
- 安装sql server managerment studio报错"The instance id is required but it is missing"
问题描述: 今天在安装sql server managerment studio的时候提示报错"The instance id is required but it is missing&q ...
- python 3.5.2安装mysql驱动报错
python 3.5.2安装mysql驱动报错 python 3.5.2安装mysql驱动时出现如下异常: [root@localhost www]# pip install mysql-connec ...
- koa项目用mongoose与mongodb交互,始终报错FormModel is not defined
koa项目用mongoose与mongodb交互,始终报错FormModel is not defined,就是自己定义的model实例始终不能找到,但是明明定义了,这时候就要看大小写了,当创建一个m ...
- Linux 下报错:A Java RunTime Environment (JRE) or Java Development Kit (JDK) must解决方案
一.报错环境:在Linux mint下,前几天还用得很好的的eclipse,今天开机不知为什么这样. Linux 下报错:A Java RunTime Environment (JRE) or Jav ...
- vue安装之后的报错处理---chromedriver@2.35.0 install: `node install.js`
报错:chromedriver@2.35.0 install: `node install.js` 这个错误的解决方法就是在你创建的项目目录,比如你创建的项目叫myVue,然后你就要在myVue这个目 ...
- Scrapy安装报错 Microsoft Visual C++ 14.0 is required 解决办法
Scrapy安装报错 Microsoft Visual C++ 14.0 is required 解决办法原因:Scrapy需要的组 twisted 需要 C++环境编译. 方法一:根据错误提示去对应 ...
- 报错:ipython 6.5.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but you'll have prompt-toolkit 2.0.15 which is incompatible.
pip install imagededup 时,报错:ipython 6.5.0 has requirement prompt-toolkit<2.0.0,>=1.0.15, but y ...
- hive报错 Another instance of Derby may have already booted the database
刚装好hive后,启动之后showtables;等正常,退出之后再进入,就发现会报错 Caused by: ERROR XSDB6: Another instance ofDerbymay have ...
随机推荐
- 关于随机数、方法重载和System.out.println()的认识
(1)使用纯随机数发生器编写一个指定数目内数字的程序(类真随机数) 源代码: package Demo1; public class trueRandom { long Multiplier = 45 ...
- !! MACD战法总结
我现在只发技术,不预测大盘.其实说实话,大盘不用预测,只要按照guoweijohn战法,有买入信号就入,有卖出信号就出..你也会成为股神..不是吹牛,且听慢慢分解 股市有三种市场: 一.牛市 二.震荡 ...
- web前端 ajax请求报415/400错
一.当使用jQuery 的ajax发送请求时 1.请求路劲没有出错并且不存在跨域,出现415错误 解决方法:在ajax请求中加上contentType: 'application/json', $.a ...
- jQuery-使用hover(fn,fn)函数监听mouseover和mouseout两个事件
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- c# 集合中有数字、字符的Orderby排序
string[] things= new string[] { "105", "101", "102", "103", ...
- caffe训练脚本文件时遇到./build/tools/caffe: not found
原文转载:https://blog.csdn.net/zhongshaoyy/article/details/53502373 cifar10训练步骤如下: (1)打开终端,应用cd切换路径,如 cd ...
- binTreepreorderTraversal二叉树前序遍历
原题 Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binar ...
- Lua 可变参数之arg与select
function TestFunc(...) local arg = { ... } --Lua .2以后不再支持默认arg参数,{}与...之间要有空格 print("输入的参数个数:&q ...
- 转:安装PHP出现make: *** [sapi/cli/php] Error 1 解决办法
ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_ctor':/home/king/PHP-5.2.13/ext/iconv/ ...
- 【转】Spotlight实时监控Windows Server 2008
Windows Server 2008作为服务器平台已逐渐被推广和应用,丰富的功能和良好的稳定性为其赢得了不错的口碑.但是和Windows Server 2003相比,其系统的自我监控功能并没有多大的 ...