前几天在使用基于 mono 的 dnx 中的 dnu restore 命令安装 nuget 包包时,遇到了 “Cannot handle address family” 错误,错误详情如下:

Cannot handle address family 61712
Stacktrace: at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Net.Dns.GetHostByName_internal (string,string&,string[]&,string[]&) <0xffffffff>
at System.Net.Dns.GetHostByName (string) <0x00054>
at System.Net.ServicePoint.get_HostEntry () <0x00219>
at System.Net.WebConnection.Connect (System.Net.HttpWebRequest) <0x001d4>
at System.Net.WebConnection.InitConnection (object) <0x002ea>
at System.Net.WebConnection.<WebConnection>m__0 (object) <0x00024>
at System.Runtime.Remoting.Messaging.AsyncResult.WaitCallback_Context (object) <0x00058>
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x001c6>
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x00020>
at System.Runtime.Remoting.Messaging.AsyncResult.<AsyncResult>m__0 (object) <0x00022>
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) <0xffffffff> Native stacktrace: mono() [0x4a1ce8]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10340) [0x7f96c8e7e340]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x39) [0x7f96c8adfcc9]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7f96c8ae30d8]
mono() [0x6318c6]
mono() [0x6316b3]
mono() [0x631769]
mono() [0x62b0b5]
mono() [0x57a5e6]
[0x40bb793e] Debug info from gdb: =================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================

在 github 上提交 issue 之后,从回复中得知这是 mono 的一个 bug,有人已经向 mono 提交了这个 bug ,详见 Use "Dns.GetHostEntry" or "Dns.GetHostByName",sometime throw error "Cannot handle address family xxxxx" 。

当时错误一直存在,怎么也无法完成 dnu restore 。后来,过了一段时间再操作,突然就好了。

后来,遇到了好几次这个问题,都是出现错误后,过一段时间就好了。

今天再次遇到,突然想到,是不是 dns 缓存的原因,清一下 dns 缓存试试。

service nscd restart

重启 nscd 之后,错误立马消失。

为了进一步确认真的是这个原因,后来找到了一个方法重现问题 —— 删除 ~/.dnx/packages 文件夹,然后重新编译 dnx 。

在 dnx 编译过程中 dnu restore 时,多次出现“Cannot handle address family”的问题,每次都能通过 service nscd restart 解决。

解决dnu restore时的“Cannot handle address family”问题的更多相关文章

  1. [DNX]解决dnu restore时找不到Newtonsoft.Json的问题

    在Mac上用最新版的dnx 1.0.0-beta5-11855进行dnu restore,出现下面的错误: System.IO.FileNotFoundException: Could not loa ...

  2. 【nginx】解决Nginx重启时提示nginx: [emerg] bind() to 0.0.0.0:80错误

    Nginx是一款轻量级的Web服务器,特点是占有内存少,并发能力强,因而使用比较广泛,蜗牛今天在一个VPS上重启Nginx时提示“nginx: [emerg] bind() to 0.0.0.0:80 ...

  3. 解决Nginx重启时提示nginx: [emerg] bind() to 0.0.0.0:80错误

    Nginx是一款轻量级的Web服务器,特点是占有内存少,并发能力强,因而使用比较广泛,蜗牛今天在一个VPS上重启Nginx时提示“nginx: [emerg] bind() to 0.0.0.0:80 ...

  4. 解决Gradle编译时出现: 编码GBK的不可映射字符

    解决Gradle编译时出现: 编码GBK的不可映射字符 在build.gradle文件中加入如下内容: [compileJava, compileTestJava]*.options*.encodin ...

  5. SpringMVC学习系列-后记 解决GET请求时中文乱码的问题

    SpringMVC学习系列-后记 解决GET请求时中文乱码的问题 之前项目中的web.xml中的编码设置: <filter> <filter-name>CharacterEnc ...

  6. 使用XmlInclude解决WebService调用时无法识别子类的异常

    一.定义抽象类及子类,WebMethod实际返回子类参数 //使用XmlInclude解决WebService调用时无法识别子类的异常 [System.Xml.Serialization.XmlInc ...

  7. 教你50招提升ASP.NET性能(十五):解决性能问题时不要低估UI的价值

    (26)Don’t underestimate the value of the UI when tackling performance problems 招数26: 解决性能问题时不要低估UI的价 ...

  8. 部署SharePoint解决方式包时遇到的问题

    部署SharePoint解决方式包时遇到的问题 近期我在使用STSADM.EXE命令部署解决方式包的时候.遇到一个问题.很的难搞.         创建WSP文件非常easy.加入到解决方式库也非常e ...

  9. 通过freemarker生成一个word,解决生成的word用wps打开有问题的问题,解决出word时中文文件名乱码问题,解决打开出word时打开的word出现问题的问题,出图片,解决动态列表

     通过freemarker制作word比较简单 步骤:制作word模板.制作方式是:将模板word保存成为xml----在xml的word模板中添加相应的标记----将xml的word文件的后缀名 ...

随机推荐

  1. CString转换成char*

    CString转换成char* :charSource = (char*)strSource.GetBuffer(0); 法2:charSource = (char*)strSource.GetBuf ...

  2. 升级 DNX 和 DNVM

    升级命令: dnvm upgrade -u dnvm upgrade -u –runtime CoreCLR -u 表示 unstable(不稳定),不带 -u 表示升级到最新稳定(stable)版本 ...

  3. ORACLE恢复数据

    ORACLE恢复删除表或表记录 一:表的恢复      对误删的表,只要没有使用PURGE永久删除选项,那么从flash back区恢复回来希望是挺大的.一般步骤有: 1.从flash back里查询 ...

  4. Tank游戏需求分析兼项目计划发布!

    项目计划 1.   编写目的 此需求文档旨在明确本游戏项目的详细规则和操作方法,供用户理解项目实现的具体功能,并作为项目详细设计开发的基础. 2.   项目背景 市面上游许多魔性小游戏,让广大玩家根本 ...

  5. JQuery中$(document)是什么意思有什么作用

    $(document).ready(fn):当DOM载入就绪可以查询及操纵时绑定一个要执行的函数,因为它可以极大地提高web应用程序的响应速度 首先我解释一下jQuery jQuery有一个用来作为D ...

  6. expecting SSH2_MSG_KEX_ECDH_REPLY ssh_dispatch_run_fatal问题解决

    设置client的mtu ifconfig eth0 mtu 576 Ultimately, I added the following to /etc/ssh/ssh_config: Host * ...

  7. linux关闭防火墙

    查看防火墙状态: sudo service iptables status linux关闭防火墙命令: sudo service iptables stop linux启动防火墙命令: sudo se ...

  8. reason: '-[__NSCFNumber rangeOfCharacterFromSet:]: unrecognized selector sent to instance

    类型的不匹配,把类型转化对应的数据类型,例: model.price 是模型数据,其值为1550: cell.label.text = [NSString stringWithFormat:@&quo ...

  9. STS 代码提示快捷键 和 注解提示的修改

    window->Preferences window->Preferences

  10. AngularJS学习--- AngularJS中的模板template和迭代器过滤filter step2 step3

    1.AngularJS 模板---step2: mvc(Model-View-Controller)模式在后端用的比较多,在前端也是一样的常用; 在AngularJS中,一个视图是模型通过HTML模板 ...