Evernight / lazy-beancount

Beancount accounting system packaged in a Docker image together with a few libraries and some additional UIs.
https://lazy-beancount.xyz/
GNU General Public License v2.0
17 stars 4 forks source link

Permission Error when building docker container #2

Open Thine-Sho opened 3 months ago

Thine-Sho commented 3 months ago

Experiencing a permission error for one of the bean files when trying to build docker container.

fava-lazybean-1.html.pdf

Thine-Sho commented 3 months ago

To fix this issue, you need to chmod 666 or 777 the /beancount_import_output directory

Evernight commented 3 months ago

Hi, thanks for reporting! I cannot reproduce but maybe there are some differences in the environment/setup. Did you mean you get the error when running the Docker container (as opposed to building it)? And particularly when you add the file to import or even when you just start it fresh from the repository? Do you run docker as different user that checked out the repository? Do you have to?

Does adding -u `id -u` to the docker run make it work correctly (without changing file permissions)? As in

docker run -it \
    -v $PWD/$1:/workspace \
    -u `id -u` \
    -p ${FAVA_PORT}:5000 \
    -p ${BEANCOUNT_IMPORT_PORT}:8101 \
    -p ${LAZY_BEANCOUNT_PORT}:8501 \
    -e LAZY_BEANCOUNT_PORT=$LAZY_BEANCOUNT_PORT \
    -e FAVA_PORT=$FAVA_PORT \
    -e BEANCOUNT_IMPORT_PORT=$BEANCOUNT_IMPORT_PORT \
    --name lazybean \
    lazy-beancount

Trying to figure out what exactly causes it because the other writable files in the repo have the same permissions. And I think the better way to fix would be to make sure files have the correct ownership and everything is running under correct user.