Archive remote fails with images created by squashfs-tools-ng on Windows

What is the problem you are having with rclone?

I am trying to use archive remote with Squashfs images created by squashfs-tools-ng on Windows. Those can be as simple as a single empty directory:

mkdir 1
gensquashfs -D 1 1.sqfs

I can successfully mount them on Linux (Squashfstools 4.6.1). rclone, however, fails to list their contents.

I used squashfs-tools-ng 1.3.2.

Run the command 'rclone version' and share the full output of the command.

rclone v1.72.0

  • os/version: Microsoft Windows 10 Pro 22H2 22H2 (64 bit)
  • os/kernel: 10.0.19045.6456 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.25.4
  • go/linking: static
  • go/tags: cmount

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone --config=NUL ls :archive:1.sqfs

The rclone config contents with secrets removed.

Not using any config

A log from the command with the -vv flag

2025/11/24 01:49:18 DEBUG : rclone: Version "v1.72.0" starting with parameters ["C:\\Program Files\\WinGet\\Links\\rclone.exe" "ls" "-vv" "--config=NUL" ":archive:D:\\1.sqfs"]
2025/11/24 01:49:18 DEBUG : Creating backend with remote ":archive:D:\\1.sqfs"
2025/11/24 01:49:18 DEBUG : Using config file from ""
2025/11/24 01:49:18 DEBUG : Found archiver for ".sqfs" remote "D:/1.sqfs"
2025/11/24 01:49:18 DEBUG : Creating backend with remote "D:/1.sqfs"
2025/11/24 01:49:18 DEBUG : fs cache: renaming child cache item "D:/1.sqfs" to be canonical for parent "//?/D:/"
2025/11/24 01:49:18 DEBUG : archive root 'D:/1.sqfs': Root is an archive
2025/11/24 01:49:18 DEBUG : Squashfs: New: remote="1.sqfs", prefix="", root=""
2025/11/24 01:49:18 INFO  : Local file system at //?/D:/: poll-interval is not supported by this remote
2025/11/24 01:49:18 DEBUG : 1.sqfs: Open: flags=O_RDONLY
2025/11/24 01:49:18 DEBUG : 1.sqfs: >Open: fd=1.sqfs (r), err=<nil>
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.openRange at 0 length 134217728
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.Read at 0 length 96 chunkOffset 0 chunkSize 134217728
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1 (fs.RangeSeeker)
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from 96 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read fs.RangeSeeker failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 1/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 2/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 3/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 4/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 5/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 6/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 7/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 8/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 9/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: low level retry 10/10: invalid seek position
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.seek from 96 to -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek close old failed: file already closed
2025/11/24 01:49:18 DEBUG : 1.sqfs: ChunkedReader.RangeSeek from -1 to -1 length -1
2025/11/24 01:49:18 DEBUG : 1.sqfs: ReadFileHandle.Read seek failed: invalid seek position
2025/11/24 01:49:18 ERROR : 1.sqfs: ReadFileHandle.Read error: invalid seek position
2025/11/24 01:49:18 CRITICAL: Failed to create file system for ":archive:D:\\1.sqfs": failed to create archive "1.sqfs": failed to read squashfs: error reading fragments: error reading fragment table index: invalid seek position

Archives with some real content might even crash go-diskfs:

2025/11/24 02:07:45 DEBUG : rclone: Version "v1.72.0" starting with parameters ["C:\\Program Files\\WinGet\\Links\\rclone.exe" "ls" "-vv" "--config=NUL" ":archive:sq1.sqfs"]
2025/11/24 02:07:46 DEBUG : Creating backend with remote ":archive:sq1.sqfs"
2025/11/24 02:07:46 DEBUG : Using config file from ""
2025/11/24 02:07:46 DEBUG : Found archiver for ".sqfs" remote "sq1.sqfs"
2025/11/24 02:07:46 DEBUG : Creating backend with remote "sq1.sqfs"
2025/11/24 02:07:46 DEBUG : fs cache: renaming child cache item "sq1.sqfs" to be canonical for parent "//?/d:/"
2025/11/24 02:07:46 DEBUG : archive root 'sq1.sqfs': Root is an archive
2025/11/24 02:07:46 DEBUG : Squashfs: New: remote="sq1.sqfs", prefix="", root=""
2025/11/24 02:07:46 INFO  : Local file system at //?/d:/: poll-interval is not supported by this remote
2025/11/24 02:07:46 DEBUG : sq1.sqfs: Open: flags=O_RDONLY
2025/11/24 02:07:46 DEBUG : sq1.sqfs: >Open: fd=sq1.sqfs (r), err=<nil>
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.openRange at 0 length 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at 0 length 96 chunkOffset 0 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ReadFileHandle.seek from 96 to 680838 (fs.RangeSeeker)
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.RangeSeek from 96 to 680838 length -1
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at -1 length 8 chunkOffset 680838 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.openRange at 680838 length 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ReadFileHandle.seek from 680846 to 680724 (fs.RangeSeeker)
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.RangeSeek from 680846 to 680724 length -1
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at -1 length 2 chunkOffset 680724 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.openRange at 680724 length 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at 680726 length 112 chunkOffset 680724 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: waiting for in-sequence read to 680852 for 0s
2025/11/24 02:07:46 DEBUG : sq1.sqfs: aborting in-sequence read wait, off=680852
2025/11/24 02:07:46 DEBUG : sq1.sqfs: failed to wait for in-sequence read to 680852
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ReadFileHandle.seek from 680838 to 680852 (fs.RangeSeeker)
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.RangeSeek from 680838 to 680852 length -1
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at -1 length 8 chunkOffset 680852 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.openRange at 680852 length 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ReadFileHandle.seek from 680860 to 680846 (fs.RangeSeeker)
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.RangeSeek from 680860 to 680846 length -1
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at -1 length 2 chunkOffset 680846 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.openRange at 680846 length 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at 680848 length 4 chunkOffset 680846 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ReadFileHandle.seek from 680852 to 680220 (fs.RangeSeeker)
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.RangeSeek from 680852 to 680220 length -1
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at -1 length 2 chunkOffset 680220 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.openRange at 680220 length 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at 680222 length 252 chunkOffset 680220 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : fs cache: renaming cache item ":archive:sq1.sqfs" to be canonical "/?/d:/sq1.sqfs:"
2025/11/24 02:07:46 DEBUG : Squashfs "/?/d:/sq1.sqfs": List: dir=""
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at 680474 length 2 chunkOffset 680220 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at 680476 length 248 chunkOffset 680220 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at 680724 length 2 chunkOffset 680220 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : sq1.sqfs: ChunkedReader.Read at 680726 length 112 chunkOffset 680220 chunkSize 134217728
2025/11/24 02:07:46 DEBUG : Squashfs "/?/d:/sq1.sqfs": >List: entries=[], err=<nil>
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x8 pc=0x14077339a]

goroutine 16 [running]:
github.com/diskfs/go-diskfs/filesystem/squashfs.(*xAttrTable).find(0xc0007a8be0?, 0x2000000000000?)
        github.com/diskfs/go-diskfs@v1.7.0/filesystem/squashfs/xattr.go:46 +0x1a
github.com/diskfs/go-diskfs/filesystem/squashfs.(*FileSystem).hydrateDirectoryEntries(0xc0007a8be0, {0xc00038ac80, 0xb, 0xc0003d6490?})
        github.com/diskfs/go-diskfs@v1.7.0/filesystem/squashfs/squashfs.go:544 +0x133
github.com/diskfs/go-diskfs/filesystem/squashfs.(*FileSystem).getDirectoryEntries(0xc0007a8be0, {0x142d446e8, 0x1}, {0x142d964b0, 0xc00040aa50})
        github.com/diskfs/go-diskfs@v1.7.0/filesystem/squashfs/squashfs.go:498 +0x130
github.com/diskfs/go-diskfs/filesystem/squashfs.(*FileSystem).readDirectory(0x0?, {0x142d446e8, 0x1})
        github.com/diskfs/go-diskfs@v1.7.0/filesystem/squashfs/squashfs.go:455 +0x2f
github.com/diskfs/go-diskfs/filesystem/squashfs.(*FileSystem).ReadDir(0xc00046f0e0?, {0x142d446e8, 0x1})
        github.com/diskfs/go-diskfs@v1.7.0/filesystem/squashfs/squashfs.go:359 +0x14c
github.com/rclone/rclone/backend/archive/squashfs.(*Fs).List(0xc00046f0e0, {0x0?, 0x1?}, {0x0, 0x0})
        github.com/rclone/rclone/backend/archive/squashfs/squashfs.go:199 +0x1b1
github.com/rclone/rclone/fs/list.DirSorted({0x142d86e00, 0x144559c20}, {0x142da42d0, 0xc00046f0e0}, 0x0, {0x0, 0x0})
        github.com/rclone/rclone/fs/list/list.go:26 +0x67
github.com/rclone/rclone/fs/walk.walk.func2()
        github.com/rclone/rclone/fs/walk/walk.go:403 +0x1e9
created by github.com/rclone/rclone/fs/walk.walk in goroutine 1
        github.com/rclone/rclone/fs/walk/walk.go:395 +0x1df

This probably needs to be reported upstream to the go diskfs project. However can you make an rclone issue about this first (please attach the problematic squashfs files) and I'll check to make sure it isn't something rclone is doing first.

Thank you!

1 Like