{"record":{"id":"0f7a864a6dd49304","repo":"duplicati/duplicati","slug":"file-not-found-remotename","errorCode":null,"errorMessage":"File not found: {remotename}","messagePattern":"File not found: (.+?)","errorType":"exception","errorClass":"FileMissingException","httpStatus":null,"severity":"error","filePath":"Duplicati/Library/Backend/DrimeCloud/DrimeBackend.cs","lineNumber":401,"sourceCode":"        // Update cache\n        cache[result.FileEntry.Name] = new CachedFileEntry(result.FileEntry.Id, result.FileEntry.Hash, result.FileEntry.File_Size);\n    }\n\n    /// <inheritdoc/>\n    public async Task GetAsync(string remotename, string filename, CancellationToken cancelToken)\n    {\n        await using var fs = File.Create(filename);\n        await GetAsync(remotename, fs, cancelToken).ConfigureAwait(false);\n    }\n\n    /// <inheritdoc/>\n    public async Task GetAsync(string remotename, Stream stream, CancellationToken cancelToken)\n    {\n        var client = await GetClientAsync(cancelToken).ConfigureAwait(false);\n        var entry = await FindFileEntryAsync(remotename, cancelToken).ConfigureAwait(false);\n\n        if (entry == null)\n            throw new FileMissingException($\"File not found: {remotename}\");\n\n        // Download by hash\n        var url = $\"file-entries/download/{entry.Hash}\";\n\n        var response = await Utility.Utility.WithTimeout(_timeouts.ShortTimeout, cancelToken,\n            ct => client.SendAsync(new HttpRequestMessage(HttpMethod.Get, url),\n                HttpCompletionOption.ResponseHeadersRead, ct)).ConfigureAwait(false);\n\n        await EnsureSuccessStatusCodeAsync(response).ConfigureAwait(false);\n\n        await using var responseStream = await Utility.Utility.WithTimeout(_timeouts.ShortTimeout, cancelToken, ct =>\n            response.Content.ReadAsStreamAsync(ct)).ConfigureAwait(false);\n\n        using var timeoutStream = stream.ObserveWriteTimeout(_timeouts.ReadWriteTimeout);\n        await responseStream.CopyToAsync(timeoutStream, cancelToken).ConfigureAwait(false);\n    }\n\n    /// <inheritdoc/>","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/duplicati/duplicati/blob/3f348be3e33f5d72d414e3ad55839c2ba34dda67/Duplicati/Library/Backend/DrimeCloud/DrimeBackend.cs#L383-L419","documentation":"Thrown by DrimeBackend.GetAsync when FindFileEntryAsync returns null for the requested remotename. Duplicati looks up the file entry (by name, via the file cache populated by listing) before issuing a download-by-hash; if no entry matches, it raises FileMissingException. This is the standard 'file does not exist on the remote backend' signal that Duplicati's core treats as a recoverable/expected condition.","triggerScenarios":"Triggered when GetAsync is called for a remotename that has no matching entry in the Drime Cloud folder, i.e. FindFileEntryAsync(remotename) yields null. Common during restore of a file that was deleted, during prune operations on already-removed blocks, or when the local file cache is stale relative to the remote folder.","commonSituations":"Restoring or deleting a dblock/dlist block that another run already purged; concurrent Duplicati instances pruning the same destination; the file was removed via the Drime Cloud web UI; cache desync after a failed earlier run.","solutions":["If this occurs during a restore, run a backup or 'list' first so the file cache is refreshed and confirm the file is actually expected to exist.","If the file was legitimately deleted remotely, run Duplicati's repair/purge-broken-files to reconcile the local database with the backend.","Ensure only one Duplicati task targets this destination concurrently to avoid cross-deletion.","If the file should exist, verify the target folder path option is correct and the file sits under that path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Refresh the file cache, then check existence before GetAsync.\nvar cache = await backend.GetFileCacheAsync(cancelToken); // or list first\nif (!cache.ContainsKey(remotename))\n    return; // or skip / mark missing","typeGuard":"static bool FileExists(IReadOnlyDictionary<string, CachedFileEntry> cache, string remotename)\n    => cache.TryGetValue(remotename, out var entry) && entry.Id != 0;","tryCatchPattern":"try { await backend.GetAsync(remotename, filename, cancelToken); }\ncatch (FileMissingException) { /* expected: file already purged, reconcile db */ }","preventionTips":["Run a list/test before restore to refresh the cache.","Avoid concurrent Duplicati jobs on one destination.","Use Duplicati purge-broken-files after deletions to keep the db in sync."],"tags":["drimecloud","download","file-not-found","filemissingexception"],"backgroundTag":null,"analyzedSha":"3f348be3e33f5d72d414e3ad55839c2ba34dda67","analyzedAt":"2026-08-13T16:48:27.008Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}