lavinir / hassio-onedrive-backup

MIT License
263 stars 11 forks source link

The SSL connection could not be established #169

Closed JabbaFire closed 7 months ago

JabbaFire commented 9 months ago

Hey, I installed the add-on using the instructions. After sign in by the microsoft device login I´m getting an Error:

`01/31/2024 15:39:19 [18] Error: Error getting free space: Status Code: 0
Microsoft.Graph.ServiceException: Code: generalException
Message: An error occurred sending the request.

 ---> System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
 ---> System.Security.Authentication.AuthenticationException: Cannot determine the frame size or a corrupted frame was received.
   at System.Net.Security.SslStream.EnsureFullTlsFrameAsync[TIOAdapter](CancellationToken cancellationToken)
   at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
   at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](CancellationToken cancellationToken)
   at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken)
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.ConnectHelper.EstablishSslConnectionAsync(SslClientAuthenticationOptions sslOptions, HttpRequestMessage request, Boolean async, Stream stream, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean async, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.AddHttp2ConnectionAsync(QueueItem queueItem)
   at System.Threading.Tasks.TaskCompletionSourceWithCancellation`1.WaitWithCancellationAsync(CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionAsync(Boolean async, CancellationToken requestCancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, Boolean async, Boolean doRequestAuth, CancellationToken cancellationToken)
   at Microsoft.Graph.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at Microsoft.Graph.RetryHandler.SendAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken)
   at Microsoft.Graph.CompressionHandler.SendAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken)
   at Microsoft.Graph.AuthenticationHandler.SendAsync(HttpRequestMessage httpRequestMessage, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationTokenSource cts, Boolean disposeCts, CancellationTokenSource pendingRequestsCts, CancellationToken originalCancellationToken)
   at Microsoft.Graph.HttpProvider.SendRequestAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.Graph.HttpProvider.SendRequestAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at Microsoft.Graph.HttpProvider.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
   at Microsoft.Graph.BaseRequest.SendRequestAsync(Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption)
   at Microsoft.Graph.BaseRequest.SendAsync[T](Object serializableObject, CancellationToken cancellationToken, HttpCompletionOption completionOption)
   at Microsoft.Graph.DriveRequest.GetAsync(CancellationToken cancellationToken)
   at hassio_onedrive_backup.Graph.GraphHelper.GetFreeSpaceInGB() in /src/Graph/GraphHelper.cs:line 232`

Has anyone an idea? Thanks for Help.

lavinir commented 9 months ago

Seems like either something transient or a networking issue. Do you have any proxies / firewalls outbound ? Do all connections fail? In the logs, getting the online backups, uploading etc?

JabbaFire commented 9 months ago

No, there ist no proxy and no Firewall. If I try to upload a backup, I get on the WebUI: An error has occurred. This application may no longer respond until reloaded

In the log I see always the same error.

lavinir commented 9 months ago

Something on the network is interfering with the connection. Quick search showed a couple of people experiencing this error (not with this addon but again this is something general). See here : https://github.com/Jackett/Jackett/issues/11963 Perhaps something in the router configuration.

JabbaFire commented 9 months ago

In my Setup HomeAssistant is running as a VM (HaOS) with Proxmox. When I run your Software in VS the Connection to OneDive is sucessful and there is not SSL-Error. The Freespace is showing and I can Upload Backups.

I tried to Add the Microsoft Graph Certificate to Homeassistant, but that doesn´t fix the Error.

My Router is a Fritzbox and there are no setting, which would prevent that. I have no idea.

lavinir commented 9 months ago

How is the VM connected to the main network ? Is there another virtual switch / firewall settings in Proxmox?

JabbaFire commented 9 months ago

I think it's easier if I include pictures than describe everything.

I have also already set the firewall's LOGs to debug. Unfortunately without seeing anything in the LOG

Firewall Host: Firewall_Host

Firewall Options Host: Firewall_Options_Host

Firewall Options VM: Firewall_Options_VM

Firewall VM: Firewall_VM

Netzwerk VM: Network_Device_VM

Netzwerk Host: Network_Host

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 30 days with no activity.

JabbaFire commented 7 months ago

I could solve the Issue by myself. The installation of Proxmox seams to be faulty. After reinstallation everything works fine.