Page 1 of 1

java.nio.file.AccessDeniedException: /root/.filebot/cache

Posted: 28 Jul 2018, 10:36
by schluss
Hello y'all, Linux noob here. Thanks to the developer for the app. I am running Filebot on a NAS inside a Docker container along with Deluge (dockerfile below, it's based on linuxserver image). Here's what I get by clicking "dry run" in a Deluge plugin:

Code: Select all

FilebotRuntimeError error on torrent f07e0b0584745b7bcb35e98097488d34e68623d0:
    FILEBOT OUTPUT DUMP:
    
    stderr:
    Error during startup: java.nio.file.AccessDeniedException: /root/.filebot/cache
    java.lang.ExceptionInInitializerError
    	at net.filebot.Main.main(Main.java:107)
    Caused by: net.sf.ehcache.CacheException: java.nio.file.AccessDeniedException: /root/.filebot/cache
    	at net.filebot.CacheManager.<init>(CacheManager.java:36)
    	at net.filebot.CacheManager.<clinit>(CacheManager.java:22)
    	... 1 more
    Caused by: java.nio.file.AccessDeniedException: /root/.filebot/cache
    	at net.filebot.util.FileUtilities.createFolders(FileUtilities.java:183)
    	at net.filebot.CacheManager.acquireDiskStore(CacheManager.java:73)
    	at net.filebot.CacheManager.<init>(CacheManager.java:33)
    	... 2 more
I see the problem has to do with the fact that Deluge and Filebot are being run by user "abc" (running top in console reveals that), yet Filebot tries to put some cache into /root. I have no idea how to fix it, searched the forum but didn't understand much, would appreciate any help. Maybe the install should be done differently? Dockerfile taken from here and changed a bit (took sources from here) to run on armhf.

Code: Select all

FROM lsiobase/xenial.armhf

MAINTAINER edifus <[email protected]>

# environment variables
ENV \
 HOME="/config" \
 JAVA_HOME="/usr/lib/jvm/java-8-oracle" \
 PYTHON_EGG_CACHE="/config/plugins/.python-eggs"

ARG JAVA_VERSION="8"
ARG FILEBOT_VERSION="4.7.9"
ARG FILEBOT_SHA256="d7aa3f8d9af9a784853cd935e9a0770d743156991c1d9538b3b5f25b2a20b11d"
ARG FILEBOT_PACKAGE="filebot_${FILEBOT_VERSION}_armhf.deb"

# copy sources
COPY sources.list /etc/apt/

RUN \
 echo "**** configure apt repos ****" && \
 echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main' >> /etc/apt/sources.list && \
 echo 'deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main' >> /etc/apt/sources.list && \
 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886 && \
 apt-get update && \
 apt-get -y install --no-install-recommends software-properties-common && \
 add-apt-repository ppa:deluge-team/ppa && \
 apt-get update && \

# install deluge
 echo "**** install deluge ****" && \
 apt-get -y install --no-install-recommends deluged deluge-web deluge-console mediainfo libchromaprint-tools inotify-tools && \

# install filebot
 echo "**** install filebot ****" && \
 curl -L -O https://downloads.sourceforge.net/project/filebot/filebot/FileBot_${FILEBOT_VERSION}/${FILEBOT_PACKAGE} && \
 echo "${FILEBOT_SHA256} *${FILEBOT_PACKAGE}" | sha256sum --check --strict && \
 dpkg -i ${FILEBOT_PACKAGE} && \
 rm ${FILEBOT_PACKAGE} && \

# install java
 echo "**** install java8 ****" && \
 echo oracle-java${JAVA_VERSION}-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
 apt-get install -y --no-install-recommends oracle-java${JAVA_VERSION}-installer oracle-java${JAVA_VERSION}-set-default && \
 update-java-alternatives -s java-8-oracle && \
 echo "export JAVA_HOME=/usr/lib/jvm/java-8-oracle" >> /etc/bash.bashrc && \

# cleanup
 echo "**** cleanup ****" && \
 apt-get clean && \
 rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /var/cache/oracle-jdk${JAVA_VERSION}-installer

# add linuxserver.io files
COPY root/ /

# ports and volumes
EXPOSE 8112 58846 58946 58946/udp
VOLUME /config

# init
ENTRYPOINT ["/init"]

Re: java.nio.file.AccessDeniedException: /root/.filebot/cache

Posted: 28 Jul 2018, 10:44
by rednoah
My official docker image does work out-of-the-box:
https://hub.docker.com/r/rednoah/filebot/

e.g.

Code: Select all

docker run -it -v $PWD:/volume1 -v data:/data rednoah/filebot -script fn:sysinfo

:arrow: You could compare what I'm doing there to what you're doing here, and figure out what's difference that breaks things on your end.

:idea: By default, FileBot will store it's application data in $HOME/.filebot, so make sure that $HOME is valid and belongs to the user that is running filebot.

Re: java.nio.file.AccessDeniedException: /root/.filebot/cache

Posted: 28 Jul 2018, 13:29
by schluss
It doesn't work out of the box if you want to use it with Laharah's plugin for Deluge.

Re: java.nio.file.AccessDeniedException: /root/.filebot/cache

Posted: 28 Jul 2018, 14:10
by rednoah
Well, my container works. How to merge docker containers, or how to call one docker in another, is beyond my expertise though.

My docker is x64 arch though, so I see why you can't just use it on an armhf machine.

Re: java.nio.file.AccessDeniedException: /root/.filebot/cache

Posted: 28 Jul 2018, 14:19
by schluss
rednoah wrote: 28 Jul 2018, 14:10 My docker is limited to to x64 at arch though, so I see why you can't just use it on an armhf machine.
Well, one can ditch openjdk 10 in favor of 8, which has a port to arm32v7. I tried that and Filebot worked on it, but I couldn't install latest Deluge on top of that image, and even the Deluge that I did manage to install refuses all connections even locally. Yes, I am really bad at devops. So I returned back to linuxserver images and continue to f* around with them.

Re: java.nio.file.AccessDeniedException: /root/.filebot/cache

Posted: 28 Jul 2018, 14:20
by rednoah
Making your own docker with FileBot and Deluge for armhf seems to be the best solution here.

You can still copy a lot of idea from my docker file. It'll show you how to configure FileBot to put application data onto a persistent mount point.

You'll also need to use the TAR package, since that'll work on armhf. The DEB package is x64 only.

Presumably, deluge also isn't well supported in armhf.

Re: java.nio.file.AccessDeniedException: /root/.filebot/cache

Posted: 28 Jul 2018, 14:32
by schluss
rednoah wrote: 28 Jul 2018, 14:20You'll also need to use the TAR package, since that'll work on armhf. The DEB package is x64 only.
4.7.9 has an armhf port apparently, cause I just changed the architecture extention in the Dockerfile I found online and it works.
rednoah wrote: 28 Jul 2018, 14:20Presumably, deluge also isn't well supported in armhf.
I have no problem with Deluge when using the pre-made image by LinuxServer built specifically for armhf. Been using it since January. Now I decided to give Filebot a try — but the Deluge image is on Apline, and I have no idea how to install Filebot and Java there (again, yeah I suck), so instead I found online some Dockerfile with Deluge + Filebot together made for Ubuntu (x64), switched the base image to armhf-Ubuntu, and everything works except filebot thinks it must store cache in /root/.filebot

I tried to replace part of my Dockerfile with what you have in yours and the result is still the same. Probably because as a Windows person I have no idea, where everything goes in Linux, how it understands where to put an installed application, why the hell it is in /root...

Code: Select all

FROM lsiobase/xenial.armhf

ENV \
 HOME="/config" \
 JAVA_HOME="/usr/lib/jvm/java-8-oracle" \
 PYTHON_EGG_CACHE="/config/plugins/.python-eggs"

ARG JAVA_VERSION="8"
ARG FILEBOT_VERSION="4.7.9"
ARG FILEBOT_SHA256="d7aa3f8d9af9a784853cd935e9a0770d743156991c1d9538b3b5f25b2a20b11d"
ARG FILEBOT_PACKAGE="filebot_${FILEBOT_VERSION}_armhf.deb"

COPY sources.list /etc/apt/

RUN \
 echo "**** configure apt repos ****" && \
 echo 'deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main' >> /etc/apt/sources.list && \
 echo 'deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main' >> /etc/apt/sources.list && \
 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C2518248EEA14886

RUN apt-get update && \
 apt-get -y install --no-install-recommends software-properties-common && \
 add-apt-repository ppa:deluge-team/ppa

RUN apt-get update && \
 apt-get -y install --no-install-recommends deluged deluge-web deluge-console mediainfo libchromaprint-tools inotify-tools

RUN echo oracle-java${JAVA_VERSION}-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
 apt-get install -y --no-install-recommends oracle-java${JAVA_VERSION}-installer oracle-java${JAVA_VERSION}-set-default && \
 update-java-alternatives -s java-8-oracle && \
 echo "export JAVA_HOME=/usr/lib/jvm/java-8-oracle" >> /etc/bash.bashrc && \
 apt-get clean && \
 rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /var/cache/oracle-jdk${JAVA_VERSION}-installer

# install filebot

ENV FILEBOT_VERSION 4.7.9

WORKDIR /usr/share/filebot

RUN apt-get update \
    && apt-get install -y mediainfo libchromaprint-tools curl file inotify-tools \
    && rm -rvf /var/lib/apt/lists/*

COPY filebot_4.7.9_armhf.deb filebot_4.7.9_armhf.deb
RUN dpkg -i filebot_4.7.9_armhf.deb \
    && rm filebot_4.7.9_armhf.deb

ENV DOCKER_DATA /data
ENV DOCKER_VOLUME /volume1

ENV HOME $DOCKER_DATA
ENV FILEBOT_OPTS "-Dapplication.deployment=docker -Duser.home=$HOME"

WORKDIR $DOCKER_DATA

VOLUME ["$DOCKER_DATA", "$DOCKER_VOLUME"]

# add linuxserver.io files
COPY root/ /

# ports and volumes
EXPOSE 8112 58846 58946 58946/udp
VOLUME /config /downloads

# init
ENTRYPOINT ["/init"]
When I run $HOME from shell is returns /root,
Though I can't check that for the user that really runs Filebot, because that user is nologin

I'll keep trying to monkey with it, thanks anyway.

Re: java.nio.file.AccessDeniedException: /root/.filebot/cache

Posted: 28 Jul 2018, 18:34
by rednoah
Well, if $HOME being /root is a problem, then I'd change it.

Here's what my docker container does:

Code: Select all

ENV DOCKER_DATA /data
ENV HOME $DOCKER_DATA
The code above assumes that you'll attach persistent docker volume to /data when launching the container:

Code: Select all

-v data:/data