I have this in my filters:
My backup runs every 3 hours, but about once every 24 hours, it throws this:
Is this a bug, or am I missing something?
ts678
September 5, 2024, 12:59am
2
Please look at that file in Explorer. Is its time constantly changing?
For an even better look, right-click → Properties → check Created.
Powerchute 3.0 and dataserv.exe (see “created and deleted” note)
Yes, it is changing all the time, but when I added it to the “Exclude File”, why does Duplicati still try to make a backup?
ts678
September 6, 2024, 6:40pm
4
This should be confirmed by a developer, but it appears Exclude is after tests expecting a file:
Library.Utility.Utility.EnumerationFilterDelegate attributeFilter = (root, path, attr) =>
AttributeFilter(path, attr, snapshot, sourcefilter, hardlinkPolicy, symlinkPolicy, hardlinkmap, fileAttributes, enumeratefilter, ignorenames, mixinqueue);
if (journalService != null)
{
// filter sources using USN journal, to obtain a sub-set of files / folders that may have been modified
sources = journalService.GetModifiedSources(attributeFilter);
}
worklist = snapshot.EnumerateFilesAndFolders(sources, attributeFilter, (rootpath, errorpath, ex) =>
{
Logging.Log.WriteWarningMessage(FILTER_LOGTAG, "FileAccessError", ex, "Error reported while accessing file: {0}", errorpath);
});
AttributeFilter
is sort of a misnomer, as it filters for many things. It does path exclude late:
/// <summary>
/// Plugin filter for enumerating a list of files.
/// </summary>
/// <returns>True if the path should be returned, false otherwise.</returns>
/// <param name="path">The current path.</param>
/// <param name="attributes">The file or folder attributes.</param>
private static bool AttributeFilter(string path, FileAttributes attributes, Snapshots.ISnapshotService snapshot, Library.Utility.IFilter sourcefilter, Options.HardlinkStrategy hardlinkPolicy, Options.SymlinkStrategy symlinkPolicy, Dictionary<string, string> hardlinkmap, FileAttributes fileAttributes, Duplicati.Library.Utility.IFilter enumeratefilter, string[] ignorenames, Queue<string> mixinqueue)
says it already has had to get attributes in advance of the filter. Path exclude is here, but late:
// Then check if the filename is not explicitly excluded by a filter
Library.Utility.IFilter match;
var filtermatch = false;
if (!Library.Utility.FilterExpression.Matches(enumeratefilter, path, out match))
{
Logging.Log.WriteVerboseMessage(FILTER_LOGTAG, "ExcludingPathFromFilter", "Excluding path due to filter: {0} => {1}", path, match == null ? "null" : match.ToString());
return false;
I’m not sure of exact code it runs from the file enumeration to the filter, but it’s probably below:
/// <summary>
/// Returns a list of all files found in the given folder.
/// The search is recursive.
/// </summary>
/// <param name="rootpath">The folder to look in</param>
/// <param name="callback">The function to call with the filenames</param>
/// <param name="folderList">A function to call that lists all folders in the supplied folder</param>
/// <param name="fileList">A function to call that lists all files in the supplied folder</param>
/// <param name="attributeReader">A function to call that obtains the attributes for an element, set to null to avoid reading attributes</param>
/// <param name="errorCallback">An optional function to call with error messages.</param>
/// <returns>A list of the full filenames</returns>
public static IEnumerable<string> EnumerateFileSystemEntries(string rootpath, EnumerationFilterDelegate callback, FileSystemInteraction folderList, FileSystemInteraction fileList, ExtractFileAttributes attributeReader, ReportAccessError errorCallback = null)
{
var lst = new Stack<string>();
if (IsFolder(rootpath, attributeReader))
{
rootpath = Util.AppendDirSeparator(rootpath);
try
{
This file has been truncated. show original
This is probably quite a timing-sensitive error, which you’re able to hit due to rapid file cycling.
Presumably the file showed up in a directory listing then it went away before attribute reading.
Maybe we will get a developer comment, but this probably deserves a new GitHub issue on it.
Wow, you lost me with all that code, but you are probably right
ts678
September 7, 2024, 7:20pm
6
The code was mainly to see if any developer has an opinion on the issue and a possible fix.
There might be a reason why the tests are ordered as they are – or maybe it’s just arbitrary.
For a workaround, you can use snapshot-policy to keep the view from changing underneath.
Possibly a simpler path is to exclude the PowerChute folder then include specific files inside.
You might need to look at file dates to guess what’s from the install, versus what’s your data.