fow5040 / Flow.Launcher.Plugin.SpotifyPremium

Spotify Premium plug-in for Flow Launcher
MIT License
31 stars 2 forks source link

System.Net.Http.HttpRequestException: Received an invalid status line: 'SSH-2.0-OpenSSH_8.9p1 Ubuntu-3'. #11

Closed taooceros closed 1 year ago

taooceros commented 2 years ago

Transferred from https://github.com/Flow-Launcher/Flow.Launcher/issues/1263

System.Net.Http.HttpRequestException: Received an invalid status line: 'SSH-2.0-OpenSSH_8.9p1 Ubuntu-3'.
   Source: System.Net.Http
   TargetAssembly: System.Net.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
   TargetModule: System.Net.Http.dll
   TargetSite: Void ParseStatusLine(System.Span`1[System.Byte], System.Net.Http.HttpResponseMessage)
   at System.Net.Http.HttpConnection.ParseStatusLine(Span`1 line, HttpResponseMessage response)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.EstablishProxyTunnel(Boolean async, HttpRequestHeaders headers, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken)
   at SpotifyAPI.Web.Http.NetHttpClient.DoRequest(IRequest request)
   at SpotifyAPI.Web.Http.APIConnector.DoRequest(IRequest request)
   at SpotifyAPI.Web.Http.APIConnector.DoSerializedRequest[T](IRequest request)
   at SpotifyAPI.Web.Http.APIConnector.SendAPIRequest[T](Uri uri, HttpMethod method, IDictionary`2 parameters, Object body, IDictionary`2 headers)
   at Flow.Launcher.Plugin.SpotifyPremium.SpotifyPluginClient.CheckTokenValidityAsync() in C:\Repos\Flow.Launcher.Plugin.SpotifyPremium\SpotifyPluginClient.cs:line 110
   at Flow.Launcher.Plugin.SpotifyPremium.SpotifyPlugin.QueryAsync(Query query, CancellationToken token) in C:\Repos\Flow.Launcher.Plugin.SpotifyPremium\SpotifyPlugin.cs:line 168
   at Flow.Launcher.Core.Plugin.PluginManager.<>c__DisplayClass22_0.<<QueryForPluginAsync>b__0>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 192
--- End of stack trace from previous location ---
   at Flow.Launcher.Infrastructure.Stopwatch.DebugAsync(String message, Func`1 action) in C:\projects\flow-launcher\Flow.Launcher.Infrastructure\Stopwatch.cs:line 40
   at Flow.Launcher.Core.Plugin.PluginManager.QueryForPluginAsync(PluginPair pair, Query query, CancellationToken token) in C:\projects\flow-launcher\Flow.Launcher.Core\Plugin\PluginManager.cs:line 211
   at Flow.Launcher.ViewModel.MainViewModel.<>c__DisplayClass137_0.<<QueryResults>g__QueryTask|2>d.MoveNext() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 623
--- End of stack trace from previous location ---
   at Flow.Launcher.ViewModel.MainViewModel.QueryResults() in C:\projects\flow-launcher\Flow.Launcher\ViewModel\MainViewModel.cs:line 624
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
fow5040 commented 2 years ago

This is wild, and looks like an issue with the Spotify API - no HTTP request to a REST api should return an odd status that looks like an SSH handshake. I don't think we can really reproduce this, but I'll leave it open for now.

fow5040 commented 1 year ago

Closing due to inactivity and lack of reproducability