ratarmount icon indicating copy to clipboard operation
ratarmount copied to clipboard

--recursion-depth and --write-overlay together fail with IndexError

Open SimonHeimberg opened this issue 1 year ago • 4 comments

ratarmount -f --write-overlay ~/tmp-s/m-ovl/ ~/tmp-s/m-src2/ ~/tmp-s/mnt/ fails with

Uncaught exception from FUSE operation getattr, returning errno.EINVAL.
Traceback (most recent call last):
...
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/ratarmountcore/UnionMountSource.py", line 206, in getMountSource
    mountSource = sourceFileInfo.userdata.pop()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: pop from empty list

Version: ratarmount 0.15.1

(more detailed information in the next comments)

SimonHeimberg avatar Jul 22 '24 21:07 SimonHeimberg

Version:

$ ratarmount --version
ratarmount 0.15.1
ratarmountcore 0.7.1

System Software:

Python 3.11.2
FUSE 3.14.0
libsqlite3 3.40.1

Compression Backends:

indexed_gzip 1.8.7
indexed_zstd 1.1.3
libarchive 5.1
rapidgzip 0.14.2
rarfile 4.2
xz 0.4.0

Versioned Loaded Shared Libraries:

libzstd-8d126cbb.so.1.5.5
ld-linux-x86-64.so.2
libacl.so.1.1.2301
libarchive.so.13.6.2
libbz2.so.1.0.4
libc.so.6
libcrypto.so.3
libexpat.so.1.8.10
libffi.so.8.1.2
libfuse.so.2.9.9
libgcc_s.so.1
libicudata.so.72.1
libicuuc.so.72.1
liblz4.so.1.9.4
liblzma.so.5.4.1
libm.so.6
libnettle.so.8.6
libpthread.so.0
libsqlite3.so.0.8.6
libssl.so.3
libstdc++.so.6.0.30
libxml2.so.2.9.14
libz.so.1.2.13
libzstd.so.1.5.4

installed today with pipx install ratarmount

SimonHeimberg avatar Jul 22 '24 21:07 SimonHeimberg

long traceback

Uncaught exception from FUSE operation getattr, returning errno.EINVAL.
Traceback (most recent call last):
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/fuse.py", line 734, in _wrapper
    return func(*args, **kwargs) or 0
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/fuse.py", line 774, in getattr
    return self.fgetattr(path, buf, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/fuse.py", line 1027, in fgetattr
    attrs = self.operations('getattr', self._decode_optional_path(path), fh)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/fuse.py", line 1076, in __call__
    return getattr(self, op)(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/ratarmount.py", line 736, in getattr
    return self._fileInfoToDict(self._getFileInfo(path))
                                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/ratarmount.py", line 705, in _getFileInfo
    result = self.mountSource.getMountSource(fileInfo)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/ratarmountcore/FileVersionLayer.py", line 227, in getMountSource
    return self.mountSource.getMountSource(fileInfo)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/ratarmountcore/AutoMountLayer.py", line 309, in getMountSource
    deeperMountPoint, deeperMountSource, deeperFileInfo = mountSource.getMountSource(sourceFileInfo)
                                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/myuser/.local/pipx/venvs/ratarmount/lib/python3.11/site-packages/ratarmountcore/UnionMountSource.py", line 206, in getMountSource
    mountSource = sourceFileInfo.userdata.pop()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
IndexError: pop from empty list

this traceback is repeated about 18 times.

SimonHeimberg avatar Jul 22 '24 21:07 SimonHeimberg

more details

There are several archives directly in the directory ~/tmp-s/m-src2/ . But mounting an empty directory instead of the one containing the archives failed the same way. Without -f, the traceback is not visible. Every access to the mountpoint fails. Deleting the .index.sqlite files did not help. Neigher deleting additionally .overlay.sqlite file.

SimonHeimberg avatar Jul 22 '24 22:07 SimonHeimberg

I have fixed this in c840d0e53cd44f9a2efb5a5e44e42e7494c8fb0b. You can test it with:

python3 -m pip install --user --force-reinstall \
    'git+https://github.com/mxmlnkn/ratarmount.git@develop#egginfo=ratarmountcore&subdirectory=core' \
    'git+https://github.com/mxmlnkn/ratarmount.git@develop#egginfo=ratarmount'

mxmlnkn avatar Aug 23 '24 12:08 mxmlnkn