OneDrive v2 upload failure due to "Unable to read data from the transport connection: The connection was closed."

Greetings. I’m currently having trouble uploading backups to OneDrive v2. It used to work on my host Windows 10, but I’ve switched to Linux and now Duplicati doesn’t work in Virtualbox Windows 10.

I’ve tried uploading my backup to mega.nz and it works.

Config:

Host:
OS: Manjaro Linux
Kernel: 5.15.16-1-MANJARO
Virtualbox: 6.1.32 r149290 (Qt5.6.1)
Windows guest:
Edition: Windows 10 Pro
Version: 21H2
Duplicati version: Duplicati - 2.0.6.100_canary_2021-08-11

Here’s the most relevant part of “Log data from the server”:

Feb 4, 2022 11:54 AM: Failed while executing "Backup" with id: 7 :

System.AggregateException: Unable to read data from the transport connection:
The connection was closed. ---> System.IO.IOException:
Unable to read data from the transport connection: The connection was closed.

I’ve looked for others with similar issues. But this Onedrive backup error solution is not relevant because I’m on Windows 10, not Windows 2008 nor Windows 2012.

Here’s the full log:

System.AggregateException: One or more errors occurred. ---> System.AggregateException: Unable to read data from the transport connection: The connection was closed. ---> System.IO.IOException: Unable to read data from the transport connection: The connection was closed.

   at System.Net.ConnectStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.Http.StreamToStreamCopy.BufferWrittenCallback(IAsyncResult ar)

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<FlushBackend>d__19.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext()

   --- End of inner exception stack trace ---

   at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext()

   --- End of inner exception stack trace ---

   at CoCoL.ChannelExtensions.WaitForTaskOrThrow(Task task)

   at Duplicati.Library.Main.Controller.<>c__DisplayClass14_0.<Backup>b__0(BackupResults result)

   at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)

   at Duplicati.Library.Main.Controller.Backup(String[] inputsources, IFilter filter)

   at Duplicati.Server.Runner.Run(IRunnerData data, Boolean fromQueue)

---> (Inner Exception #0) System.AggregateException: Unable to read data from the transport connection: The connection was closed. ---> System.IO.IOException: Unable to read data from the transport connection: The connection was closed.

   at System.Net.ConnectStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.Http.StreamToStreamCopy.BufferWrittenCallback(IAsyncResult ar)

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<FlushBackend>d__19.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext()

   --- End of inner exception stack trace ---

   at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext()

---> (Inner Exception #0) System.IO.IOException: Unable to read data from the transport connection: The connection was closed.

   at System.Net.ConnectStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.Http.StreamToStreamCopy.BufferWrittenCallback(IAsyncResult ar)

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<FlushBackend>d__19.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext()<---



---> (Inner Exception #1) System.AggregateException: One or more errors occurred. ---> System.IO.IOException: Unable to read data from the transport connection: The connection was closed.

   at System.Net.ConnectStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.Http.StreamToStreamCopy.BufferWrittenCallback(IAsyncResult ar)

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<FlushBackend>d__19.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext()

   --- End of inner exception stack trace ---

---> (Inner Exception #0) System.IO.IOException: Unable to read data from the transport connection: The connection was closed.

   at System.Net.ConnectStream.EndWrite(IAsyncResult asyncResult)

   at System.Net.Http.StreamToStreamCopy.BufferWrittenCallback(IAsyncResult ar)

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at Duplicati.Library.Main.Operation.Backup.BackendUploader.<<Run>b__13_0>d.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at CoCoL.AutomationExtensions.<RunTask>d__10`1.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<FlushBackend>d__19.MoveNext()

--- End of stack trace from previous location where exception was thrown ---

   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

   at Duplicati.Library.Main.Operation.BackupHandler.<RunAsync>d__20.MoveNext()<---

<---

<---

Any help is much appreciated. Thank you!

After further digging into this issue, I’ve found a solution:

“Unable to read data from the transport connection: The connection was closed.

You can use `--retry-delay=5s` and `--number-of-retries=100`

works for me.

I believe it’s the issue with OneDrive v2, not with Duplicati.

Thank you and hopefully this helps others with the same issue.

1 Like