# Improve result reporting

**URL:** <https://forum.duplicati.com/t/improve-result-reporting/16407>\
**Category:** Developer\
**Created:** [June 21, 2023, 12:12pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407 "2023-06-21T12:12:05Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 21, 2023, 12:12pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/1 "2023-06-21T12:12:05Z")

</div>

There are a few issues with the current result reporting:

### Empty metadata

If the backup is aborted before metadata is collected (e.g. by run-script-before), empty metadata is saved and shown on the backup overview. This looks like the entire backup was deleted, even though the versions are still there when running restore.

> <https://github.com/duplicati/duplicati/issues/4344>
>
> \- \[x\] I have searched open and closed issues for duplicates.
> 
> \----------------…------------------------
> 
> \## Environment info
> 
> 
> \- \*\*Duplicati version\*\*: 2.0.5.1\_beta\_2020-01-18
> \- \*\*Operating system\*\*: Windows 10
> \- \*\*Backend\*\*: Local SATA Harddrive, USB Harddrive, USB Stick
> 
> \## Description
> 
> I set up a \`--run-script-before\` batch script to return \`exit 1\` when my drive is not attached so that I will not get warnings. The backup information in the home tab of the web server does however change to a 'zero state' after silently aborting the backup due to exit 1 code.
> 
> On the forum I made a thread where the problem is discussed: \[https://forum.duplicati.com/t/warning-folder-x-does-not-exist/10894/2\](https://forum.duplicati.com/t/warning-folder-x-does-not-exist/10894/2) .
> 
> Another issue on Github is: \[https://github.com/duplicati/duplicati/issues/4222\](https://github.com/duplicati/duplicati/issues/4222) which is about a fatal error, also the \`--run-script-after\` command is also invoked. My issue is about the zero job statistics. When solving one might want to tackle both issues at the same time since there is a good chance the same parts of the code are involved. 
> 
> \## Steps to reproduce
> 
> 1. Create new backup, as basic as possible
> 2. Run the new backup in order to fill the current backup state information
> 2. Add run-script-before as advanced step, point it to \`C:\\Duplicati\\check\_if\_X\_exists.bat\`: 
> \`\`\`
> exit 1
> \`\`\`
> 3. Run backup again.
> 
> 
> 
> \- \*\*Actual result\*\*:
> The backup information which contained the size, date of last backup and versions changes to all zeros:
> \`\`\`
> Last successful backup:
> Today at 12:45 PM (took 00:00:00)
> Run now 
> Next scheduled run:
> Tomorrow at 12:45 PM
> Source:
> 0 bytes
> Backup:
> 0 bytes / 0 Versions
> \`\`\`
> \- \*\*Expected result\*\*:
> I expect that the information of the last 'successful' / 'not aborted' backup will be displayed.
> 
> \## Screenshots
> 
> 
> A screenshot of an empty backup state 'Backup\_Noord' and a backup with information 'Test\_backup'
> !\[image\](https://user-images.githubusercontent.com/62965899/96013867-089df000-0e46-11eb-9c98-e5121ab981b6.png)
> 
> \## Debug log
> 
> 
> This is the log from About -\> Show log -\> Live. I think my log looks normal.
> \`\`\`
> Oct 14, 2020 5:55 PM: Aborting operation by request, requested result: Normal
> Oct 14, 2020 5:54 PM: Cannot open WMI provider \\\\localhost\\root\\virtualization\\v2. Hyper-V is probably not installed.
> Oct 14, 2020 5:54 PM: Cannot find any MS SQL Server instance. MS SQL Server is probably not installed.
> Oct 14, 2020 5:54 PM: Using WMI provider \\\\localhost\\root\\virtualization\\v2 
> \`\`\`
> 
> Many thanks for reading this issue. I am happy to assist in any way.

Forum post: [Duplicati shows 0 bytes 0 versions despite successful backup and restore](https://forum.duplicati.com/t/duplicati-shows-0-bytes-0-versions-despite-successful-backup-and-restore/13254)

### Exceptions in server log

Another problem is that some exceptions that occur during a run are not recorded in the database log of the backup, but rather in the server log. This causes the operation to essentially disappear from the protocol, even though it should show an error run: ["errors occurred" but none in log](https://forum.duplicati.com/t/errors-occurred-but-none-in-log/7134)  
Some exceptions seem to be handled within the backup operation and those are recorded in the database, but others are handled by the server and are reported in the server log. I think all exceptions during the backup operation should also be reported for that backup.

### Possible solution

I find it difficult to change the result type in a way that would allow checking if the metadata is correct, because it is updated at many different places and often only partially. So even if some metadata is correct (e.g. source data size), some might be wrong (e.g. versions).  
My idea is to add new result codes (in addition to success, warning, error) for abort success, abort warning and abort error to `ParsedResultType`. These would be set if the script calls for an abort and then the metadata could be ignored.

> <https://github.com/duplicati/duplicati/blob/d0f1498bd41b151d8512fd2acb57739f6a05587f/Duplicati/Library/Interface/ResultInterfaces.cs#L23-L30>

If exceptions thrown during an operation are also supposed to be integrated in the result, like I would prefer, they might also be able to use these aborted result codes (probably aborted error, as the operation did not finish). However, it could be the case that the exception occurs after some work is already done, so I am not sure if that could be a problem (I think it should cause a rollback normally). Also I would need to think about the interaction with partial backups.

What is your opinion on this? It feels right to use the result type for this, but I am a bit hesitant to add new result codes, because it might break stuff in the UI or in other scripts (maybe it should, because those results need to be treated differently). Otherwise it could be enough to simply add a bool flag to indicate whether the operation completed or not.

---

<div class="post-metadata">

**Author:** ![gpatel-fr](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/g/7993a0/32.png) [@gpatel-fr](https://forum.duplicati.com/u/gpatel-fr)\
**Post date:** [June 21, 2023, 1:36pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/2 "2023-06-21T13:36:12Z")

</div>

Hello

I am up to my neck in backend(s) code at the moment, so not much time has been given to thinking about your post.

- re: run-script-before: from the doc, this should NOT abort the job. --run-script-before-required should be the command used to abort a job. I did not try to repro with script-before-required.

- re: log into job vs server. This is a pretty fearsome enterprise as you said yourself. An important point in my opinion is that Duplicati will have to evolve to adapt to new times (driver updates). However this is pretty risky. A mitigation is to consider the database structure as frozen. This way if users have trouble with an update they can re-install the old version without hassle. This seems to me the only way to make faster updates and reliability expected from a backup software at least tolerable. So I am -1000 on any database structure change.

---

<div class="post-metadata">

**Author:** ![drwtsn32](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drwtsn32/32/2591_2.png) [@drwtsn32](https://forum.duplicati.com/u/drwtsn32)\
**Post date:** [June 21, 2023, 2:20pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/3 "2023-06-21T14:20:51Z")

</div>

> [@gpatel-fr](#):
>
> re: run-script-before: from the doc, this should NOT abort the job. --run-script-before-required should be the command used to abort a job. I did not try to repro with script-before-required.

I believe you are looking at old documentation. Some number of years ago, --run-script-before was enhanced to handle various errorlevel values so you can choose to continue the backup or cancel it, and you could select the job result: success, warning, error.

I think it was mentioned that --run-script-before-required wasn’t really needed any more after that enhancement.

Here is the thread where this enhancement was discussed: [Improvements for --run-script-before/after options](https://forum.duplicati.com/t/improvements-for-run-script-before-after-options/519/1)

---

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 21, 2023, 2:47pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/4 "2023-06-21T14:47:03Z")

</div>

> [@gpatel-fr](#):
>
> re: run-script-before: from the doc, this should NOT abort the job. --run-script-before-required should be the command used to abort a job. I did not try to repro with script-before-required.

There are different exit codes 0-5 which cause different behavior (not documented in the manual, but in the example scripts), to display error or warning messages and also abort:

> [@Duplicati shows 0 bytes, 0 versions despite successful backup and restore](https://forum.duplicati.com/t/duplicati-shows-0-bytes-0-versions-despite-successful-backup-and-restore/13254/9):
>
> Look in your Duplicati install folder, e.g. `/usr/lib/duplicati/run-script-example.sh` or online copy  
> [https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.sh](https://github.com/duplicati/duplicati/blob/master/Duplicati/Library/Modules/Builtin/run-script-example.sh)
> 
> [duplicati/Duplicati/Library/Modules/Builtin/run-script-example.sh at 0a1b32e1887c98c6034c9fafdfddcb8f8f31e207 · duplicati/duplicati · GitHub](https://github.com/duplicati/duplicati/blob/0a1b32e1887c98c6034c9fafdfddcb8f8f31e207/Duplicati/Library/Modules/Builtin/run-script-example.sh#L15-L27) [duplicati/Duplicati/Library/Modules/Builtin/run-script-example.sh at 0a1b32e1887c98c6034c9fafdfddcb8f8f31e207 · duplicati/duplicati · GitHub](https://github.com/duplicati/duplicati/blob/0a1b32e1887c98c6034c9fafdfddcb8f8f31e207/Duplicati/Library/Modules/Builtin/run-script-example.sh#L40-L46)

  

> [@gpatel-fr](#):
>
> A mitigation is to consider the database structure as frozen. This way if users have trouble with an update they can re-install the old version without hassle. This seems to me the only way to make faster updates and reliability expected from a backup software at least tolerable. So I am -1000 on any database structure change.

There is no need to change the database, it already contains the result logs (what you see when you go to show log on the backup). It would only also have entries when the job failed due to exceptions, which is more intuitive in my opinion.

I also looked in the code and results are only ever written to the database log, never parsed. This means we can add any fields or enum values we like and backwards compatibility is unaffected.

> [@drwtsn32](#):
>
> I think it was mentioned that --run-script-before-required wasn’t really needed any more after that enhancement.

It could still be used if you have an existing script that returns a different code, e.g. exit 1 to fail which is quite common.

---

<div class="post-metadata">

**Author:** ![gpatel-fr](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/g/7993a0/32.png) [@gpatel-fr](https://forum.duplicati.com/u/gpatel-fr)\
**Post date:** [June 21, 2023, 4:38pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/5 "2023-06-21T16:38:09Z")

</div>

> [@drwtsn32](#):
>
> I believe you are looking at old documentation.

Well, I’m sure I am looking at the current documentation at [Advanced Options - Duplicati 2 User's Manual](https://duplicati.readthedocs.io/en/latest/06-advanced-options/#run-script-before)

Funnily enough, the person maintaining the documentation is the one who asked for this change.

---

<div class="post-metadata">

**Author:** ![gpatel-fr](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/g/7993a0/32.png) [@gpatel-fr](https://forum.duplicati.com/u/gpatel-fr)\
**Post date:** [June 21, 2023, 4:41pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/6 "2023-06-21T16:41:39Z")

</div>

> [@Jojo-1000](#):
>
> I also looked in the code and results are only ever written to the database log, never parsed.

By third party tools, possibly.

---

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 21, 2023, 4:46pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/7 "2023-06-21T16:46:44Z")

</div>

> [@gpatel-fr](#):
>
> By third party tools, possibly.

I would hope that third party tools can handle changes in a JSON string (the UI also uses the result, but an unknown ParsedResult would just display a question mark).

---

<div class="post-metadata">

**Author:** ![drwtsn32](https://forum.duplicati.com/user_avatar/forum.duplicati.com/drwtsn32/32/2591_2.png) [@drwtsn32](https://forum.duplicati.com/u/drwtsn32)\
**Post date:** [June 21, 2023, 8:52pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/8 "2023-06-21T20:52:24Z")

</div>

> [@gpatel-fr](#):
>
> Well, I’m sure I am looking at the current documentation …

Then I guess the “current” docs are out of date

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [June 21, 2023, 10:04pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/9 "2023-06-21T22:04:17Z")

</div>

> [@Jojo-1000](#):
>
> Another problem is that some exceptions that occur during a run are not recorded in the database log of the backup, but rather in the server log.

In [Combine logs in GUI #1152](https://github.com/duplicati/duplicati/issues/1152) kenkendk commented on this, but didn’t detail “technical reasons” causes.  
It’s definitely not user friendly, especially since the GUI offers a button to show logs, but gives wrong one.

> [@Jojo-1000](#):
>
> Otherwise it could be enough to simply add a bool flag to indicate whether the operation completed or not.

I don’t know the code well, but I think the JSON reportings that Duplicati can do is just a variables dump, however I don’t think there’s a formal format definition, so hopefully the consumers will ignore extra stuff.

> [@Jojo-1000](#):
>
> I also looked in the code and results are only ever written to the database log, never parsed.

I don’t know the code well, but the database log would seem to be only data source for GUI’s log display.

[https://github.com/duplicati/duplicati/blob/master/Duplicati/Server/webroot/ngax/templates/backup-result/top-right-box.html](https://github.com/duplicati/duplicati/blob/master/Duplicati/Server/webroot/ngax/templates/backup-result/top-right-box.html)

although as said above, JavaScript code might well put up with extra stuff. I just question “never parsed”.

> [@gpatel-fr](#):
>
> I’m sure I am looking at the current documentation

A link from there would be nice. Lots of the options descriptions don’t go past quoting the code help text.  
[Example Scripts](https://duplicati.readthedocs.io/en/latest/appendix-g-example-scripts/) which is linked in navigation Articles section is where the example scripts are available.

---

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 21, 2023, 10:09pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/10 "2023-06-21T22:09:40Z")

</div>

> [@ts678](#):
>
> I just question “never parsed”.

By that I meant parsed by a C# JSON Serializer that requires the fields to be consistent with class properties. JS will just accept anything.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [June 21, 2023, 10:30pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/11 "2023-06-21T22:30:30Z")

</div>

Thanks for clarifying. I don’t do much C# or JS beyond trying to follow or debug things occasionally.

> [@Jojo-1000](#):
>
> JS will just accept anything.

[Backup not saved if only metadata has changed #4312](https://github.com/duplicati/duplicati/issues/4312) was one case where I think @drwtsn32 had challenges with the demands of parsing JSON in C#. Not sure if you have any idea on a way around.

> [@gpatel-fr](#):
>
> I am up to my neck in backend(s) code at the moment, so not much time has been given to thinking about your post.

You’re doing a lot. Is there anything that anyone else can help with so, e.g., you can get in a few PRs?  
@Jojo-1000 and I have been looking one over that’s been lingering, trying to do some test and review.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [June 22, 2023, 2:29pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/12 "2023-06-22T14:29:59Z")

</div>

> [@Jojo-1000](#):
>
> My idea is to add new result codes (in addition to success, warning, error) for abort success, abort warning and abort error to `ParsedResultType`. These would be set if the script calls for an abort and then the metadata could be ignored.

which of those currently set metadata? I’d think `Success` would be the clear favorite on having values.  
`Warning` might be second choice. My impression is `Error` and `Fatal` have bailed out before finishing.

I was about to mention [JsonIgnoreAttribute](https://www.newtonsoft.com/json/help/html/PropertyJsonIgnore.htm) to keep things out of JSON, but proposal is tweak to enum whose value creation I’m not clear on, but I think I’ve heard that it’s complex, maybe hinted by `Parsed`.

Regardless, I think preventing any wipe-out of home page values would be a nice improvement to add, although if these were equally difficult (they’re likely not), I’d propose de-confusing the two logs instead because bad logs (and this is not the only case) just make difficult support handling even more difficult.

In addition to reliability, I think Duplicati needs to be more supportable before its user base gets too big.

---

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 22, 2023, 3:10pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/13 "2023-06-22T15:10:15Z")

</div>

> [@ts678](#):
>
> which of those currently set metadata? I’d think `Success` would be the clear favorite on having values.  
> `Warning` might be second choice. My impression is `Error` and `Fatal` have bailed out before finishing.

As long as a result is returned from the operation, the metadata is set in the server database.  
Any operation that “bails” (throws an exception) does not return a result and is logged in the server log instead (this is the second part I want to change).  
If there is an exception that is caught, for example while processing a specific file, that is written to the error log in the result. When the operation completes normally, the `ParsedResultType` is simply determined by the logs:

> <https://github.com/duplicati/duplicati/blob/d0f1498bd41b151d8512fd2acb57739f6a05587f/Duplicati/Library/Main/ResultClasses.cs#L189-L200>

An alternative to an enum code could be to use the `Type` column in the database (which is only used with `"Result"` as far as I can tell), maybe use `"InterruptedResult"` combined with a hidden property. But I still think we should use result codes for this because this is what they are made for.

> [@ts678](#):
>
> although if these were equally difficult (they’re likely not), I’d propose de-confusing the two logs instead

Probably it is easier to fix the log messages than the metadata deletion. However, I am not sure what even belongs in the server log and what does not (looking at mine I see mostly connection errors to clients and updater errors that belong there).  
Maybe another parameter of `UserInformationException` could be used to forward an error to the server if it is not specific to a backup, but I think that is probably not needed and only leads to more edge cases (operation not showing in log, clicking on message leads to wrong page, etc.).

The reason why I am proposing this together is because I think backups interrupted by unexpected exceptions should also have a different result code than backups which failed to upload a file. Maybe that is not necessary.

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [June 22, 2023, 3:30pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/14 "2023-06-22T15:30:49Z")

</div>

> [@Jojo-1000](#):
>
> However, I am not sure what even belongs in the server log and what does not (looking at mine I see mostly connection errors to clients and updater errors that belong there).

I was sort of speculating that as the original author wrote the command line before the GUI (and both still exist), that might explain some of what we find now. There have been other evolutions over time though.

---

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 22, 2023, 3:32pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/15 "2023-06-22T15:32:50Z")

</div>

There is definitely also room for improvement with the command line (for example I don’t think log files work, at least I don’t see any code that checks the flag).

---

<div class="post-metadata">

**Author:** ![ts678](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@ts678](https://forum.duplicati.com/u/ts678)\
**Post date:** [June 22, 2023, 4:05pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/16 "2023-06-22T16:05:00Z")

</div>

> [@Jojo-1000](#):
>
> I don’t think log files work, at least I don’t see any code that checks the flag).

What flag are you talking about. I’d be very surprised if command line lacks the [log-file](https://duplicati.readthedocs.io/en/latest/06-advanced-options/#log-file) option.

My concern in this area is that I think the `LogData` table gets log, but how to see it using CLI?  
Lots of my CLI work is by [Export As Command-line](https://duplicati.readthedocs.io/en/latest/03-using-the-graphical-user-interface/#exporting-a-backup-job-configuration), so I just use the GUI to read the job logs.

What doesn’t happen is home page statistics updates, as those go into the server’s database,  
however here the server’s only clue that a true CLI ran a job is that the job database changed.  
An interesting test would be to see if [GUI Commandline](https://duplicati.readthedocs.io/en/latest/03-using-the-graphical-user-interface/#using-the-command-line-tools-from-within-the-graphical-user-interface) is better about reporting job results…

---

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 23, 2023, 2:04pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/17 "2023-06-23T14:04:27Z")

</div>

Another relevant issue:

> <https://github.com/duplicati/duplicati/issues/4829>
>
> \- \[x\] I have searched open and closed issues for duplicates.
> \- \[x\] I have searc…hed the \[forum\](https://forum.duplicati.com) for related topics.
> 
> \----------------------------------------
> 
> \## Environment info
> 
> 
> \- \*\*Duplicati version\*\*: 2.0.6.3\_beta\_2021-06-17
> \- \*\*Operating system\*\*: Win 11 Pro, 22H2
> \- \*\*Backend\*\*: FTP
> 
> \## Description
> 
> When a backup job fails, the failures only appear on the general server page (the one for all backups), and not on the log page of the individual backup job that failed. As an example, I have this job running daily. It failed consecutively on Oct 1, 2, 3, etc, but these failures don't show up (is it only for me? is this the intended behavior for some reason?)
> 
> \## Steps to reproduce
> This happens with every backup failure, so in order to reproduce, just cause a backup to fail (e.g. wrong user/pass for FTP; or any other way).
> 
> 
> 
> \- \*\*Actual result\*\*:
> !\[image\](https://user-images.githubusercontent.com/77799839/196005616-4ea8a06a-f3c6-4b72-8e63-6056fab15d94.png)
> \- \*\*Expected result\*\*:
> !\[image\](https://user-images.githubusercontent.com/77799839/196005716-e7fb13e6-7753-4957-91d7-60e222426fe6.png)
> 
> Expected: all backup attempts show up in the log (not only the successful ones), with a minimum of "Backup failed" title, ideally with some short description of the error (e.g. "host unreachable"), but this latter part is of course lower prio.

---

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 23, 2023, 4:41pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/18 "2023-06-23T16:41:43Z")

</div>

After trying some changes for a bit, I came to the conclusion that it would be difficult to add more `ParsedResultTypes`. They all need to be forwarded from child results, so I think a flag for interrupted jobs would be easier and also break less externally.

The `Fatal` result is supposed to be used for operations that throw exceptions, so this can just be used as is.

---

<div class="post-metadata">

**Author:** ![Jojo-1000](https://forum.duplicati.com/user_avatar/forum.duplicati.com/jojo-1000/32/8262_2.png) [@Jojo-1000](https://forum.duplicati.com/u/Jojo-1000)\
**Post date:** [June 23, 2023, 7:50pm UTC](https://forum.duplicati.com/t/improve-result-reporting/16407/19 "2023-06-23T19:50:19Z")

</div>

I made a draft PR with my changes, it would be nice to get some feedback.  
There are [installers](https://github.com/Jojo-1000/duplicati/actions/runs/5359284846) if you can’t build from source. It worked with a file permission error and different script return codes, but I didn’t do a lot of testing yet.

> <https://github.com/duplicati/duplicati/pull/4978>
>
> Closes #4829, closes #4344
> 
> Add a new 'Interrupted' field to \`IBasicResult\`. T…his is set to true if the operation was interrupted (e.g. by \`run-script-before\`).
> Interrupted and failed backups are recorded in the job log (#4829).
> When the backup is interrupted or fails (\`Interrupted==true\` or \`ParsedResult=Fatal\`), metadata for the server database is not updated (#4344).
> 
> If exceptions are caught from an operation this previously resulted in an error message in the server log. Now the error message is also recorded in the job log. This has to create a new Operation in the database for now, so the logs are not linked to the performed changes in the database yet.
> 
> There are two new translation needed (to display "Fatal error" or "Interrupted" in the job log). I put these messages above the time, please suggest other options:
> !\[screenshot of log entry with fatal error\](https://github.com/duplicati/duplicati/assets/33495614/f3f141df-5aec-475d-9e3b-0cb1912b8e67)
> 
> Also, maybe a darker shade of red and a different icon could be used for the icons of fatal errors, so they can be spotted easier. I don't have the tools installed to change the stylesheet.
