tryvium-travels/memongo

afero.Rename errors when copying mongod binary from /tmp mounted on different filesystem

Closed this issue · 4 comments

My system has /tmp mounted on a different filesystem, so when afs.Rename is called to copy the mongod binary from /tmp to the cache, I get the following error:

panic: error writing mongod binary from /tmp/192458888 to /home/devin/.cache/memongo/mongodb-linux-x86_64-debian10-4_2_16_tgz_ffac481192/mongod: rename /tmp/192458888 /home/devin/.cache/memongo/mongodb-linux-x86_64-debian10-4_2_16_tgz_ffac481192/mongod: invalid cross-device link

This is because it is likely calling os.Rename, which cannot move files across filesystems. This can be worked around by copying the file and then deleting the original if the copy was successful.

thanks for the tip, can you make a PR to fix that?

Sure!

awesome. Also contact me on telegram CENSORED I have something to say to you <3

I don't use Telegram, unfortunately.

drop an email to a.sanino@tryvium.io then :)