Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kpm restore fails on Linux #197

Closed
justgage opened this issue Nov 15, 2014 · 10 comments
Closed

kpm restore fails on Linux #197

justgage opened this issue Nov 15, 2014 · 10 comments

Comments

@justgage
Copy link

I'm brand new to C# and Asp.net so this may be a dumb question but I was trying to follow the basic tutorial and when I run kpm restore it gives me this:

Restoring packages for /home/justgage/Dropbox/code/csharp/Home/samples/HelloWeb/project.json
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Kestrel'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Hosting'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'.
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics
  Error: SendFailure (Error writing headers)
Warning: FindPackagesById: Kestrel
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Kestrel'.
Warning: FindPackagesById: Microsoft.AspNet.Hosting
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Hosting'.
Warning: FindPackagesById: Microsoft.AspNet.StaticFiles
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'.
Warning: FindPackagesById: Microsoft.AspNet.Server.WebListener
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
Warning: FindPackagesById: Microsoft.AspNet.Diagnostics
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Diagnostics'.
Warning: FindPackagesById: Kestrel
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Kestrel'.
Warning: FindPackagesById: Microsoft.AspNet.Hosting
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Hosting'.
Warning: FindPackagesById: Microsoft.AspNet.StaticFiles
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.StaticFiles'.
Warning: FindPackagesById: Microsoft.AspNet.Server.WebListener
  Error: SendFailure (Error writing headers)
  GET https://www.nuget.org/api/v2/FindPackagesById()?Id='Microsoft.AspNet.Server.WebListener'.
Error: FindPackagesById: Microsoft.AspNet.Diagnostics
  Error: SendFailure (Error writing headers)
----------
Error: FindPackagesById: Kestrel
  Error: SendFailure (Error writing headers)
System.Net.WebException: Error: SendFailure (Error writing headers) ---> System.Net.WebException: Error writing headers ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a
  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.RemoteValidation (Mono.Security.Protocol.Tls.ClientContext context, AlertDescription description) [0x00000] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.validateCertificates (Mono.Security.X509.X509CertificateCollection certificates) [0x00000] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.ProcessAsTls1 () [0x00000] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.Handshake.HandshakeMessage.Process () [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) Mono.Security.Protocol.Tls.Handshake.HandshakeMessage:Process ()
  at Mono.Security.Protocol.Tls.ClientRecordProtocol.ProcessHandshakeMessage (Mono.Security.Protocol.Tls.TlsStream handMsg) [0x00000] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.RecordProtocol.InternalReceiveRecordCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.Security.Protocol.Tls.SslClientStream.EndNegotiateHandshake (IAsyncResult result) [0x00000] in <filename unknown>:0 
  at Mono.Security.Protocol.Tls.SslStreamBase.AsyncHandshakeCallback (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.TaskFactory`1[System.Net.WebResponse].InnerInvoke (System.Threading.Tasks.TaskCompletionSource`1 tcs, System.Func`2 endMethod, IAsyncResult l) [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Net.WebResponse].GetResult () [0x00000] in <filename unknown>:0 
  at System.Net.Http.HttpClientHandler+<SendAsync>c__async0.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Net.Http.HttpResponseMessage].GetResult () [0x00000] in <filename unknown>:0 
  at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.Restore.NuGet.HttpSource+<GetAsync>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.Restore.NuGet.HttpSourceResult].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.Restore.NuGet.PackageFeed+<FindPackagesByIdAsyncCore>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Collections.Generic.IEnumerable`1[Microsoft.Framework.PackageManager.PackageInfo]].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RemoteWalkProvider+<FindLibraryBySnapshot>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.WalkProviderMatch].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RemoteWalkProvider+<FindLibraryByVersion>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.WalkProviderMatch[]].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<FindLibraryByVersion>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.WalkProviderMatch].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<FindLibraryMatch>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.WalkProviderMatch].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<FindLibraryEntry>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<CreateGraphNode>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<CreateGraphNode>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Collections.Generic.IEnumerable`1[Microsoft.Framework.PackageManager.PackageInfo]].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RemoteWalkProvider+<FindLibraryBySnapshot>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.WalkProviderMatch].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RemoteWalkProvider+<FindLibraryByVersion>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.WalkProviderMatch[]].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<FindLibraryByVersion>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.WalkProviderMatch].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<FindLibraryMatch>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.WalkProviderMatch].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<FindLibraryEntry>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.GraphItem].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<CreateGraphNode>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.GraphNode].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreOperations+<CreateGraphNode>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Microsoft.Framework.PackageManager.GraphNode[]].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<RestoreForProject>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Boolean].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<ExecuteCommand>d__1.MoveNext () [0x00000] in <filename unknown>:0 
----------
Restore failed
Error: SendFailure (Error writing headers)

I'm using Arch linux and mono -V says Mono JIT compiler version 3.10.0 and I've done a kvm upgrade and my kpm --version is 1.0.0-beta1-10662

Edit: This appears to be very simmilar to issue #89

@davidfowl
Copy link
Member

I believe you need to run this:

CERTMGR=/usr/local/bin/certmgr
sudo $CERTMGR -ssl -m https://go.microsoft.com
sudo $CERTMGR -ssl -m https://nugetgallery.blob.core.windows.net
sudo $CERTMGR -ssl -m https://nuget.org

mozroots --import --sync

I'll make sure we update or instructions to include this for *nix.

@dodyg
Copy link

dodyg commented Nov 17, 2014

Yup this works although in my installation (Ubuntu 14.04) certmgr is not located at /usr/local/bin/. A straight certmgr -ssl works fine.

@justgage
Copy link
Author

Looks that worked @davidfowl!

@dodyg
Copy link

dodyg commented Nov 18, 2014

Is there any timeline when kestrel issue will be solved? Right now executing k kestrel will blow up.

@davidfowl
Copy link
Member

This issue has nothing to do with kestrel. Not sure what you mean.

@punitganshani
Copy link

In some cases certmgr directly works and in other cases we have to follow what @davidfowl has recommended.

@Tragetaschen
Copy link
Contributor

This depends on

  • Where mono is installed in your distro
    • In /usr because it came from an official packet
    • In /usr/local because you built mono from source with the default --prefix=/usr/local
  • Whether your distro puts /usr/local/bin into PATH

Users with the prefix /usr/local and without PATH have to call certmgr through the full path.

@ghost
Copy link

ghost commented Dec 30, 2014

On my machine debian, i had to do mozroots --import --machine --sync

@djarvis
Copy link

djarvis commented Jan 14, 2015

When I try to do:

sudo $CERTMGR -ssl -m https://go.microsoft.com

I get:

Unhandled Exception:
System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in :0
at Mono.Tools.CertificateManager.GetCertificatesFromSslSession (System.String url) [0x00000] in :0

Is this a proxy issue (I am behind a proxy)? I do have my HTTP_PROXY and HTTPS_PROXY set in my system wide environment, though.

System is Ubuntu 14.04.1 LTS

Thanks.

@p10tyr
Copy link

p10tyr commented Feb 19, 2015

mozroots --import --machine --sync
Also worked on Raspberry Pi 2

ryanbrandenburg pushed a commit that referenced this issue Nov 20, 2018
ryanbrandenburg pushed a commit that referenced this issue Nov 26, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants