Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows backup - error: invalid node type "" #4560

Closed
eliba opened this issue Nov 2, 2023 · 10 comments · Fixed by #4620
Closed

Windows backup - error: invalid node type "" #4560

eliba opened this issue Nov 2, 2023 · 10 comments · Fixed by #4620

Comments

@eliba
Copy link

eliba commented Nov 2, 2023

Output of restic version

PS C:\Windows\system32> .\restic_0.16.2_windows_amd64.exe version
restic 0.16.2 compiled with go1.21.3 on windows/amd64

What backend/service did you use to store the repository?

REST server: https://github.com/restic/rest-server

rest-server version rest-server 0.12.1 compiled with go1.20.5 on linux/amd64

Problem description / Steps to reproduce

As described in the Forum:

When running a backup on Windows 11 with:

PS C:\Windows\system32> restic_0.16.2_windows_amd64.exe --repo rest:https://username:password@backup_server.example.tld:3000/username backup --use-fs-snapshot --json C:\Users\MyUser

I get the following output (truncated a bit):

PS C:\Windows\system32> restic_0.16.2_windows_amd64.exe --repo rest:https://username:password@backup_server.example.tld:3000/username backup --use-fs-snapshot --json C:\Users\MyUser
enter password for repository:
{"message_type":"status","seconds_elapsed":6,"percent_done":1,"total_files":9,"files_done":9,"total_bytes":18571268,"bytes_done":18571268}
{"message_type":"status","seconds_elapsed":6,"percent_done":1,"total_files":19,"files_done":19,"total_bytes":20036713,"bytes_done":20036713}
[...]
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Clipchamp.Clipchamp_yxz26nhyzhsrt\\clipchamp.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\GameBarElevatedFT_Alias.exe"}
{"message_type":"status","seconds_elapsed":9,"percent_done":1,"total_files":1909,"files_done":1909,"total_bytes":473892841,"bytes_done":473892841,"error_count":2}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\MediaPlayer.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\WindowsPackageManagerServer.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\python.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\python3.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\\winget.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.GamingApp_8wekyb3d8bbwe\\XboxPcApp.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.Paint_8wekyb3d8bbwe\\mspaint.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.Paint_8wekyb3d8bbwe\\pbrush.exe"}
{"message_type":"status","seconds_elapsed":9,"percent_done":1,"total_files":1909,"files_done":1909,"total_bytes":473892841,"bytes_done":473892841,"error_count":10}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.ScreenSketch_8wekyb3d8bbwe\\SnippingTool.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.WindowsNotepad_8wekyb3d8bbwe\\notepad.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\wt.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.XboxGamingOverlay_8wekyb3d8bbwe\\GameBarElevatedFT_Alias.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\Microsoft.ZuneMusic_8wekyb3d8bbwe\\MediaPlayer.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\MicrosoftTeams_8wekyb3d8bbwe\\msteams.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\MicrosoftTeams_8wekyb3d8bbwe\\msteamsupdate.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\MicrosoftWindows.Client.CBS_cw5n1h2txyewy\\MicrosoftWindows.DesktopStickerEditorCentennial.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\MicrosoftWindows.DesktopStickerEditorCentennial.exe"}
{"message_type":"status","seconds_elapsed":9,"percent_done":1,"total_files":1909,"files_done":1909,"total_bytes":473892841,"bytes_done":473892841,"error_count":19}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\SnippingTool.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\WindowsPackageManagerServer.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\XboxPcApp.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\clipchamp.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\mspaint.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\msteams.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\msteamsupdate.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\notepad.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\pbrush.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\python.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\python3.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\winget.exe"}
{"message_type":"error","error":{},"during":"archival","item":"C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe"}
{"message_type":"status","seconds_elapsed":9,"percent_done":1,"total_files":1910,"files_done":1910,"total_bytes":473893492,"bytes_done":473893492,"error_count":32}
{"message_type":"status","seconds_elapsed":9,"percent_done":1,"total_files":1910,"files_done":1910,"total_bytes":473893492,"bytes_done":473893492,"error_count":32}
[...]
{"message_type":"status","seconds_elapsed":15,"percent_done":1,"total_files":6228,"files_done":6228,"total_bytes":884372112,"bytes_done":884372112,"error_count":32}
{"message_type":"status","seconds_elapsed":15,"percent_done":1,"total_files":6228,"files_done":6228,"total_bytes":884372112,"bytes_done":884372112,"error_count":32}
{"message_type":"summary","files_new":1,"files_changed":1,"files_unmodified":6226,"dirs_new":0,"dirs_changed":12,"dirs_unmodified":2438,"data_blobs":2,"tree_blobs":12,"data_added":49484,"total_files_processed":6228,"total_bytes_processed":884372112,"total_duration":15.3607794,"snapshot_id":"7e9cb55e5d28a81b230093a1ecc08f6237ab4470fb30e62fe048c4b1671639ac"}
Warning: at least one source file could not be read
PS C:\Windows\system32>

Same result as unprivileged user without --use-fs-snapshot option. Machine is a Windows 11 virtual machine.

Expected behavior

Return without error

Actual behavior

Without --json, the error messages (one per unreadable file) is

error: invalid node type ""

which is not helpful for identifying what's wrong. The backup succeeds nontheless, which is good!

Do you have any idea what may have caused this?

nope :/

Did restic help you today? Did it make you happy in any way?

Oh dear, it helps almost every day!

  • Accidentially deleted a file? restic!
  • Edited a file and forgot to copy the original file before? restic!
  • Compare what happened between 14 days ago and today? restic!
  • Want to restore a whole machine? restic!
    It's just being way less nervous about day-to-day sysadmin stuff, because there's always a restic backup there, just in case.
@g33kphr33k
Copy link

Seeing this as well and just came into report.

Rolling back and the error goes away.

Windows Server 2012R2 (don't ask).

@jarmo
Copy link

jarmo commented Nov 5, 2023

Same here - problem appeared when upgraded restic from 0.15.2 to 0.16.1.

@lucatrv
Copy link

lucatrv commented Nov 5, 2023

Same for me, I'm using Restic 0.16.2.

@ramrodpaz
Copy link

Same here, problem appeared after upgrading from 0.15.2 to 0.16.2

@1MoreRaiday
Copy link

Same
Windows 11
restic 16.2/386

@MichaelEischer
Copy link
Member

The error seems to be caused by files that are reported as ModeIrregular (see https://pkg.go.dev/io/fs#FileMode) by Go. While testing with some problematic files, the difference between Go 1.20 and 1.21, seems to be that the older version completely fails to open the file (resulting in a much more useful error message) and the newer version manages to open the file, but then runs into the filetype issue.

Trying to access these files (via WSL, Explorer and notepad++) results in errors, self contradicting results. However, its apparently possible to execute those files. I don't know enough about Windows to say whether its possible in some way to backup those files and what magic would be necessary to attempt restoring those files.

From what I can tell so far, it likely won't be possible to back up these files (Didn't work either in previous restic versions). But at least we can fix the error message to be more useful.

Te proper solution, however, is likely to just exclude the C:\\Users\\MyUser\\AppData\\Local\\Microsoft\\WindowsApps directory from the backup.

@jarmo
Copy link

jarmo commented Nov 22, 2023

I saw warnings about files with absolute paths in the log being unable to backup under WSL being symlinks when using version <=0.15.2 of restic. I suspect that in 0.16.2 they are the same type of files (symlinks under WSL), but are just reported with an empty string instead of an absolute path like before.

@ar1a
Copy link

ar1a commented Dec 5, 2023

Same here on 0.16.2

@stardude900
Copy link

Same here, also on 0.16.2 but on Fedora 39

@MichaelEischer
Copy link
Member

MichaelEischer commented Jan 6, 2024

#4620 will fix the error message to include the filepath, but besides that there's probably not much we can do here.

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 a pull request may close this issue.

9 participants