Skip to content

backup: read extended metadata from snapshot#5097

Merged
MichaelEischer merged 9 commits intorestic:masterfrom
MichaelEischer:fix-vss-metadata
Oct 22, 2024
Merged

backup: read extended metadata from snapshot#5097
MichaelEischer merged 9 commits intorestic:masterfrom
MichaelEischer:fix-vss-metadata

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

@MichaelEischer MichaelEischer commented Oct 18, 2024

What does this PR change? What problem does it solve?

When creating a backup using VSS, the extended file metadata was not read from the snapshot but instead from the original. This can cause errors if the original file has been removed in the meantime.

The LocalVss now correctly intercepts the path passed to NodeFromFileInfo. This change is complemented with a bunch of tests to ensure that all paths are correctly intercepted.

Was the change previously discussed in an issue or on the forum?

Fixes #5063

Checklist

  • I have read the contribution guidelines.
  • I have enabled maintainer edits.
  • I have added tests for all code changes.
  • [ ] I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I have run gofmt on the code in all commits.
  • All commit messages are formatted in the same style as the other commits in the repo.
  • I'm done! This pull request is ready for review.

Previously, NodeFromFileInfo used the original file path to create the
node, which also meant that extended metadata was read from there
instead of within the vss snapshot.
OpenFile, Stat and Lstat should reuse the underlying FS implementation
to avoid diverging behavior.
Copy link
Copy Markdown
Member Author

@MichaelEischer MichaelEischer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ilium007
Copy link
Copy Markdown

ilium007 commented Oct 29, 2024

Backups failing with 0.17.2

restic.exe : error: incomplete metadata for D:\: multiple errors occurred: [get named security info failed with: Access is denied.; get EA failed for path \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy165\, with: get file EA failed with: The parameter is incorrect.]
At C:\restic\backup_us.ps1:288 char:13
+             & $ResticExe backup $ResticBackupFlags $folder_list $vss_ ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (error: incomple... is incorrect.]:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Reverted to 0.17.1 and backups are working again.

@MichaelEischer
Copy link
Copy Markdown
Member Author

See #5107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with files that may be moved or removed during backups - Windows

2 participants