akrabu
1
I have a fairly small snapshot that for some reason won’t dump to a tarball. I get
Fatal: cannot dump file: TarHeader: archive/tar: header field too long
The stats are:
Stats in restore-size mode:
Snapshots processed: 1
Total File Count: 112021
Total Size: 10.156 GiB
Stats in raw-data mode:
Snapshots processed: 1
Total Blob Count: 81043
Total Uncompressed Size: 9.322 GiB
Total Size: 5.273 GiB
Compression Progress: 100.00%
Compression Ratio: 1.77x
Compression Space Saving: 43.43%
Version: restic 0.15.1 compiled with go1.19.5 on darwin/amd64
Command: restic dump <snapshot-ID> / > tarball.tar
Any way to get it to dump properly other than dumping subfolders individually?
EDIT: Since it’s a smaller snapshot, it mounted just fine and I was able to tarball/xz it up. Still wondering why dump didn’t work though.
Is there maybe a file with long file name or a large extended attribute? Could you try to narrow it down which file is causing the problem?
akrabu
3
Hmm is there a verbosity level / debug mode that would print out the file names as it’s dumping the tarball??
Unfortunately no. But the following patch should be sufficient to log the paths in the DEBUG_LOG
for restic 0.15.1:
diff --git a/internal/dump/tar.go b/internal/dump/tar.go
index 6e87aabe5..5c68ccbe6 100644
--- a/internal/dump/tar.go
+++ b/internal/dump/tar.go
@@ -7,6 +7,7 @@ import (
"path/filepath"
"strings"
+ "github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/restic"
)
@@ -48,6 +49,7 @@ func tarIdentifier(id uint32) int {
}
func (d *Dumper) dumpNodeTar(ctx context.Context, node *restic.Node, w *tar.Writer) error {
+ debug.Log("dumping %v", node.Path)
relPath, err := filepath.Rel("/", node.Path)
if err != nil {
return err
1 Like