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

What the heck is going on here? This is running on Windows Server 2012 R2. It seems to relate to transport security. However I have this exact same S3 setup working on tons of other Duplicati set ups. I double and triple checked the policy on Wasabi. The only differing thing here is Windows Server 2012 R2. I’ve tried FireFox, Edge, and Chrome. None of my other Wasabi S3 backups on other machines are failing like this one.

Can someone confirm this OS and Duplicati 2.0.6.3 work together?

After a backup fails, if I go back in and look at the source folder it has an exclamation mark on it whereas before when I initially set up the backup it didn’t. It’s not a special folder of any kind and the permissions have not changed from defaults. I could create a new folder anywhere on the C:\ or D:\ drive and get the same error.

Duplicati is running as a service and I have moved the data folder like I always do to C:\ProgramData\Duplicati\Data.

Failed: One or more errors occurred.
Details: 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 CoCoL.AutomationExtensions.d__101.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, Action1 method)
—> (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 CoCoL.AutomationExtensions.d__101.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 CoCoL.AutomationExtensions.<RunTask>d__101.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.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.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 CoCoL.AutomationExtensions.d__101.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 CoCoL.AutomationExtensions.<RunTask>d__101.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.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.d__20.MoveNext()<—
<—
<—

Log data:
2023-02-24 06:06:43 -05 - [Error-Duplicati.Library.Main.Operation.BackupHandler-FatalError]: Fatal error
System.IO.IOException: Unable to read data from the transport connection: The connection was closed.
at CoCoL.AutomationExtensions.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.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.d__20.MoveNext()

A search of the forums says this is a previously reported issue either related to TLS 1.2 settings, .NET mismatches or the use of self-signed certs, I searched for “Windows 2012” and then at those mentioning TLS or similar errors. Not sure if there is a thread with a working fix but there are threads on the subject.

May also be worth searching for “Windows 8” as both OSes use the same code base and almost always have the same issues. I don’t have access to either Win8 or Server 2012R2 at the moment or I’d test it out.

A quick search on the net for the error gave me this blog post and while the blog post itself may not contain the solution (maybe it does…), the comments to it seem to provide a few good options that are probably worth verifying. FYI: Duplicati is based on .NET 4.5

Also, keep in mind that Microsoft has put Server 2012 R2 to EOL in October of this year. If that’s going to be a support issue for that server, it may be better to address that first.

Usually the question is whether the OS has a new enough .NET Framework for Duplicati to use.
.NET Framework 4.8 looks like Microsoft’s latest and greatest, and you can have it, but do you?

Duplicati on Windows Server 2016 .NET framework Error is how to tell (they don’t make it easy).

Your stack trace seems unique (at least Google can’t find one like it), so this may take hunting…

I suppose you could also give some better logs, e.g. About → Show live → Information or set up
log-file=<path> log-file-log-level=information (and might go higher later) to gather context for this.

Not sure about that.

I was going off the docs here but I’m guessing it’s dated info from what you’re showing.

https://github.com/duplicati/duplicati.github.io/blob/master/index.md is probably the page in question
and it’s said that since at least 2016 when the version was probably correct. Another PR opportunity.
I notice that there are some Issues, and a PR from @gpatel-fr already to take hubiC off of that page.

I’m glad that we’re finding these things, although getting them released is subject to usual shortages.

I double checked, .NET v4.8.03761 is def installed.

Hello

Your problem is strange, the lock appearing on a directory seems at odd with the error message that make more think to network problems. Maybe a bug is compounding a weird configuration problem. Do restarting Duplicati make disappear the lock on the directory ?
About the network configuration, who can know interactions between an elderly OS and library (.NET) installed ? IIRC by default TLS 1.2 is not enabled on Windows 2012 R2, and possibly (very possibly) .NET is using the underlying operating system layer for TLS.
I don’t seem to have anything about that in my notes (must have been traumatic at the time), but if memory serves me, enabling it for Http connections is not difficult or risky, that’s a simple registry change and maybe a reboot - assuming that the right service packs have been installed of course. Sorry to not be more specific, but Windows server 2012 is not really a pressing concern for me.
Ah, and don’t reply that you use TLS 1.2 on a browser started on the server. Browsers are not using .Net and hence are not likely to use the OS layer for TLS.

Transport Layer Security (TLS) best practices with the .NET Framework suggests it’s Schannel a.k.a.
Secure Channel, which Internet Explorer also uses. If you still have IE, it can be a good TLS test tool.

It varies. If I got this right, .NET Framework and Internet Explorer go to OS. Most new browsers don’t.
Firefox uses Network Security Services (NSS), and Chromium derivatives commonly use BoringSSL.

Protocols in TLS/SSL (Schannel SSP) reminds me of the TLS 1.2 challenge working with Windows 7, however link claims 2012 has it by default. Are your other working systems newer or older Windows?

If Microsoft has not removed your Internet Explorer yet, I suppose you could test browsing to Wasabi.

allowed-ssl-versions set Tls12 on Options screen 5 would be another test, and there are further tests.

Agree. Even though I’m following up on the TLS theory, the source behavior is also strange, especially

I suppose a tiny test backup that fails to Wasabi could have destination changed, to see what happens.
I already suggested better logs, but we don’t have them yet.

Getting back to connection and destination testing, easy test is the Test connection button.
That’s typically a list. For more test, Export As Command-line, edit URL to empty folder, run
Duplicati.CommandLine.BackendTester.exe. If it works, then destination side appears to work.

Yes you are correct 2012 R2 has it by default (not 2012 pre-R2)

OP could use Wireshark to check TLS connection.

“Windows 8/Windows Server 2012” and “Windows 8.1/Windows Server 2012 R2” rows look identical, however it doesn’t matter, as this system is R2. We weren’t told yet what the working systems are on. Also, things that are on by default can probably be turned off, so best plan is to test the current setup.

That’s the ultimate tool, and there are Internet resources such as The Illustrated TLS 1.2 Connection.

I’m trying to go through easier ways, but if OP likes, we can try going directly to a more definitive one.

Relevant one would use Windows for its TLS. Something PowerShell would probably do that, maybe:

Invoke-WebRequest -Uri https://s3.wasabisys.com

Although I don’t do PowerShell much, this might be the equivalent of an easy test mono recommends.

Further testing on this server indicates this only occurs on folders that contain Cobian backed up data. I can successfully backup other folders in Duplicati without issue.

However I’ve spun up a VM and recreated the environment and I cannot replicate this issue.

I’ve uninstalled and unregistered Duplicati, rebooted, reinstalled. No change.

Update:

There must be some issue with the data being backed up that Cobian has created. Weird thing is, I recreated the backups with Cobian and now Duplicati doesn’t bitch. Weird.

I’m trying to figure out what’s different about the backups with Cobian which Duplicati is failing on.

*Also FWIW .NET 4.7.1 must be installed prior to Duplicati being installed or else the installer will fail. You will not see the error using the msiexec /Q flag.