11 de Jul de 2018 às 16:12: The operation Backup has failed with error: A task was canceled.
{"ClassName":"System.Threading.Tasks.TaskCanceledException",
"Message":"A task was canceled.",
"Data":null,
"InnerException":null,
"HelpURL":null,
"StackTraceString":" at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
at CoCoL.ChannelExtensions.WaitForTaskOrThrow (System.Threading.Tasks.Task task) [0x00050] in <6973ce2780de4b28aaa2c5ffc59993b1>:0
at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, Duplicati.Library.Utility.IFilter filter) [0x00008] in <0ce58d578b8642d49036dc15fbad38f1>:0
at Duplicati.Library.Main.Controller+<>c__DisplayClass13_0.<Backup>b__0 (Duplicati.Library.Main.BackupResults result) [0x00035] in <0ce58d578b8642d49036dc15fbad38f1>:0
at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x0011d] in <0ce58d578b8642d49036dc15fbad38f1>:0 ","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-21
That message implies the job was manually cancelled, do you recall trying to abort a running backup?
It looks to me like the “canceled” message you showed is from 2018-07-11 @ 16:12 but the job details seem to be for a Repair that ended at 16:00:27 so the two may not be related…
(By the way, I edited your post by adding “```json” before and after the messages to make them easier to read.)
12 de Jul de 2018 às 10:09: The operation Backup has failed with error: A task was canceled.
{"ClassName":"System.Threading.Tasks.TaskCanceledException",
"Message":"A task was canceled.",
"Data":null,
"InnerException":null,
"HelpURL":null,
"StackTraceString":" at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <8f2c484307284b51944a1a13a14c0266>:0
at CoCoL.ChannelExtensions.WaitForTaskOrThrow (System.Threading.Tasks.Task task) [0x00050] in <6973ce2780de4b28aaa2c5ffc59993b1>:0
at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, Duplicati.Library.Utility.IFilter filter) [0x00008] in <0ce58d578b8642d49036dc15fbad38f1>:0
at Duplicati.Library.Main.Controller+<>c__DisplayClass13_0.<Backup>b__0 (Duplicati.Library.Main.BackupResults result) [0x00035] in <0ce58d578b8642d49036dc15fbad38f1>:0
at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x0011d] in <0ce58d578b8642d49036dc15fbad38f1>:0 ",
"RemoteStackTraceString":null,
"RemoteStackIndex":0,
"ExceptionMethod":null,
"HResult":-2
I did not cancel manually, this error happens after a Backup that I do, the second never works, it cancels, I gave permission in the directory and it still gives the error. And I do not cancel the operation.
Before, I was not having problems, after I upgraded to 2.0.3.9, I can only do the first backup, then start presenting the error that I reported, my backup is done by linux, I have already given permission on the folders and continues the same thing.
The operation Backup has failed with error: A task was canceled.
I suspect “That message implies the job was manually cancelled” is true but accidental, and above shows the Message from the low-level .NET System.Threading.Tasks.TaskCanceledException seen in the post. There’s maybe a very indirect mapping of low-level .NET Tasks to high-level Duplicati operations.
I’ve gotten a few “A task was canceled” in my 4 months of server logs. The first one was:
2018-07-19 14:39:59 -04 - [Error-Duplicati.Library.Main.Controller-FailedOperation]: The operation Backup has failed with error: A task was canceled.
System.Threading.Tasks.TaskCanceledException: A task was canceled.
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at CoCoL.ChannelExtensions.WaitForTaskOrThrow(Task task)
at Duplicati.Library.Main.Controller.<>c__DisplayClass13_0.<Backup>b__0(BackupResults result)
at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)
and that followed a flood of per-file CoCoL exceptions like:
2018-07-19 14:39:52 -04 - [Warning-Duplicati.Library.Main.Operation.Backup.MetadataPreProcess.FileEntry-ProcessingMetadataFailed]: Failed to process entry, path: C:\Users\Ted\Documents\size test\short.txt
CoCoL.RetiredException: The channel is retired
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at CoCoL.Channel`1.<WriteAsync>d__30.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.Backup.MetadataPreProcess.<>c__DisplayClass2_0.<<Run>b__0>d.MoveNext()
It’s not clear exactly what these are telling me, but Duplicati emailed me the fatal error. I too wasn’t doing any manual cancellations, but this began when I was investigating to help look into Skip-files-larger-than ignored.
So it looks like some underlying .NET/mono (or CoCoL) call is the task that was canceled, NOT the Duplicati backup task - that makes sense!
So for both your and @Elton_pereira_leite’s example errors it was whatever CoCoL called with the WaitForTaskOrThrow method reporting the issue. I’m GUESSING the call included some sort of a “try to do this but if not done within X seconds, abort and throw an error” parameter.
When the “within X seconds” limit is reached, the task is “cancelled” causing the error we’re seeing.
In your case specifically, it appears it was a “MetadataPreProcess” related call that timed out (or itself crashed so never returned a result thus appearing to time out).
Of course I’m not really sure how to go about resolving this, but I’m guessing it’s related to the multi-threading processes added in 2.0.3.6 so I’d suggest rolling back to 2.0.3.5 to see if that stops the error from appearing.