JayXon / Leanify

lightweight lossless file minifier/optimizer
MIT License
831 stars 75 forks source link

`Map file error: No such device` using mergerFS #79

Closed Wdavery closed 2 years ago

Wdavery commented 2 years ago

My apologies in advance if this error is outside this project's scope, but I haven't been able to pin this down, or reproduce it outside of Leanify.
Erring on the side of user-error, I'm thinking this may be a configuration issue on the docker side, but all other tools work as expected–only Leanify fails to run as expected.

I am running Leanify within a docker container (Debian:stable-slim). This has been tested on the vanilla Debian image (only installing wget unzip make gcc g++ to grab and compile Leanify)

When processing a file on the container's native file system, Leanify runs normally:

Processing: /tmp/test.jpg
4.80 MB -> 4.74 MB      Leanified: 71.16 KB (1.45%)

When on a docker bind mount it produces an error:

Processing: /dockerbind/test.jpg
Map file error: No such device

On a docker volume, it works as expected:

Processing: /dockervolume/test.jpg
4.80 MB -> 4.74 MB      Leanified: 71.16 KB (1.45%)

Relevant section in Leanify code: https://github.com/JayXon/Leanify/blob/3e0d2d7f1e563066e6cf510f0b8908d8b0201399/fileio_linux.cpp#L48-L54

I haven't had any luck searching the web for this issue and I've hit the limit of my knowledge. Hoping someone familiar with MMAP can help here.

Wdavery commented 2 years ago

After further testing this appears to be related to MergerFS and may be a configuration issue there. Will close for now as I investigate further.

Wdavery commented 2 years ago

Yep, solved. Unrelated to Leanify.

mergerFS requires the option cache.files=partial to enable mmap support