DNU恢复失败,https GET超时。

3

我在使用'dnu restore'恢复NuGet包时遇到了一些问题。

root@esomimx6s:~/TestASP5/src/TestASP5# dnu -v restore
Could not determine OS version information. Defaulting to the empty string.
Microsoft .NET Development Utility Mono-arm-1.0.0-rc1-16231

  GET https://api.nuget.org/v3/index.json
Restoring packages for /home/root/TestASP5/src/TestASP5/project.json
Attempting to resolve dependency TestASP5 >= 1.0.0
Attempting to resolve dependency Microsoft.AspNet.Server.Kestrel >= 1.0.0-rc1-final
  GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
Attempting to resolve dependency TestASP5 >= 1.0.0
Attempting to resolve dependency Microsoft.AspNet.Server.Kestrel >= 1.0.0-rc1-final
Warning: FindPackagesById: Microsoft.AspNet.Server.Kestrel
  HTTP request timed out. Retrying.
  GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
Warning: FindPackagesById: Microsoft.AspNet.Server.Kestrel
  HTTP request timed out. Retrying.
  GET https://api.nuget.org/v3/index.jsonFindPackagesById()?id='Microsoft.AspNet.Server.Kestrel'
Error: FindPackagesById: Microsoft.AspNet.Server.Kestrel
  HTTP request timed out. Exiting.
----------
System.Threading.Tasks.TaskCanceledException: A task was canceled.
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00078> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at System.Net.Http.HttpClientHandler+<SendAsync>c__async0.MoveNext () <0x7484c988 + 0x010af> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x7414d6f0 + 0x0001b> in <filename unknown>:0
  at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext () <0x74863400 + 0x00343> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.Restore.NuGet.HttpSource+<GetAsync>d__11.MoveNext () <0x748ef960 + 0x00813> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.Restore.NuGet.NuGetv2Feed+<FindPackagesByIdAsyncCore>d__25.MoveNext () <0x73e53e50 + 0x00617> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RemoteWalkProvider+<FindLibrary>d__6.MoveNext () <0x73e530c8 + 0x0018b> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibrary>d__9.MoveNext () <0x73e6dae0 + 0x003eb> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibraryByVersion>d__8.MoveNext () <0x73e6c908 + 0x007d3> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibraryMatch>d__6.MoveNext () <0x73e60d38 + 0x00a57> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<FindLibraryEntry>d__5.MoveNext () <0x741114b8 + 0x0029f> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<CreateGraphNode>d__2.MoveNext () <0x7410fd28 + 0x0055f> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreOperations+<CreateGraphNode>d__2.MoveNext () <0x7410fd28 + 0x00adf> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreCommand+<CreateGraphNode>d__71.MoveNext () <0x7410f418 + 0x0015b> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x7485ee40 + 0x0001b> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreCommand+<RestoreForProject>d__69.MoveNext () <0x74133ad8 + 0x01b5f> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x73e40098 + 0x00017> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreCommand+<>c__DisplayClass68_0+<<Execute>b__2>d.MoveNext () <0x741331a8 + 0x001bb> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7414dfc0 + 0x00024> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7414d960 + 0x00053> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7414d780 + 0x0008b> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x748f16e0 + 0x0003f> in <filename unknown>:0
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0x748f1698 + 0x00017> in <filename unknown>:0
  at Microsoft.Dnx.Tooling.RestoreCommand+<Execute>d__68.MoveNext () <0x7498cde8 + 0x009bf> in <filename unknown>:0
----------
Restore failed
A task was canceled.

Feeds used:
    https://api.nuget.org/v3/index.json

我使用的是自定义的Linux镜像,安装了Mono 4.2.2:

root@esomimx6s:~/TestASP5/src/TestASP5# mono --version
Mono JIT compiler version 4.2.2 (Stable 4.2.2.10/7b87787 Sun Dec 20 18:22:52 CET 2015)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
    TLS:           __thread
    SIGSEGV:       normal
    Notifications: epoll
    Architecture:  armel,vfp+hard
    Disabled:      none
    Misc:          softdebug
    LLVM:          supported, not enabled.
    GC:            sgen
root@esomimx6s:~/TestASP5/src/TestASP5# dnvm --version
 1.0.0-rc2-15546
root@esomimx6s:~/TestASP5/src/TestASP5# dnu --version
Could not determine OS version information. Defaulting to the empty string.
Microsoft .NET Development Utility
 Version:      1.0.0-rc1-16231
 Type:         Mono
 Architecture: arm
 OS Name:      Linux
 Runtime Id:   linux-arm

当我查找nuget feed的IP地址时,它似乎没有被阻止:
root@esomimx6s:~/TestASP5/src/TestASP5# resolveip api.nuget.org
IP address of api.nuget.org is 68.232.34.200
root@esomimx6s:~/TestASP5/src/TestASP5# ping 68.232.34.200
PING 68.232.34.200 (68.232.34.200): 56 data bytes
64 bytes from 68.232.34.200: seq=0 ttl=53 time=28.921 ms
64 bytes from 68.232.34.200: seq=1 ttl=53 time=28.859 ms
^C
--- 68.232.34.200 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 28.859/28.890/28.921 ms

当我在同一局域网中使用BeagleBone Black执行相同的命令时,一切正常。我可以尝试什么其他方法来进一步调试出错的原因?

2个回答

1
我找到了解决方案。我知道HTTPS GET请求需要安装一定数量的证书。但是,由于错误信息并未指出身份验证是问题所在,我认为这不是问题所在。然而,这确实是我的问题根源......
我通过运行以下命令来解决它:
mono /usr/lib/mono/4.5/certmgr.exe -ssl -m https://go.microsoft.com
mono /usr/lib/mono/4.5/certmgr.exe -ssl -m https://nuget.org
mono /usr/lib/mono/4.5/certmgr.exe -ssl -m https://api.nuget.org
mono /usr/lib/mono/4.5/mozroots.exe --import --sync

1

我遇到了与在 Fedora 23 上描述的相同的问题。错误信息确实会让人产生误解,使用 mozroots 运行同步可以解决此问题。

mono /usr/lib/mono/4.5/mozroots.exe --import --sync

运行后的输出如下:
Importing certificates into user store...
140 new root certificates were added to your trust store.
Import process completed.

附言:我本来想将这个内容放在评论中,但是我没有足够的声望。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接