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 提要的 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(在同一个局域网中)上发出相同的命令时,一切顺利。我还能尝试进一步调试出了什么问题?

4

2 回答 2

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.

p/s:会将此作为评论,但我没有足够的声誉。

于 2016-03-23T23:31:29.643 回答
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
于 2015-12-23T15:32:06.507 回答