sandreas / m4b-tool

m4b-tool is a command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b
MIT License
1.18k stars 76 forks source link

podman permission denied error. suggested alias for running m4b-tool with podman #253

Open jasonblewis opened 8 months ago

jasonblewis commented 8 months ago

I'm putting this here in case it helps anyone.

I had a lot of issues getting m4b-tool to be able to write the generated m4b back to the host system under podman.

It turns out you need --userns=keep-id option when running the container. Suggest this alias

alias m4b-tool='podman run -it --rm --userns=keep-id -v "$(pwd)":/mnt sandreas/m4b-tool:latest'

Without this I was always getting the following permission denied error:

PHP Warning:  rename(fragments.m4b): Failed to open stream: Permission denied in phar:///usr/local/bin/m4b-tool-pre/src/library/Command/MergeCommand.php on line 967
PHP Warning:  rename(/tmp/m4b-tool/tmp_fragments.m4b,fragments.m4b): Permission denied in phar:///usr/local/bin/m4b-tool-pre/src/library/Command/MergeCommand.php on line 967
Could not rename output file from /tmp/m4b-tool/tmp_fragments.m4b to fragments.m4b
an error occured, that has not been caught:
Array
(
    [type] => 2
    [message] => rename(/tmp/m4b-tool/tmp_fragments.m4b,fragments.m4b): Permission denied
    [file] => phar:///usr/local/bin/m4b-tool-pre/src/library/Command/MergeCommand.php
    [line] => 967
)
sandreas commented 8 months ago

Thanks, I'm going to transfer this in the official docs.