[HELP] "Output folder must exist and must be a directory" Error

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
j66454
Posts: 7
Joined: 08 Jun 2019, 14:29

[HELP] "Output folder must exist and must be a directory" Error

Post by j66454 »

Hi,

So I'm getting this error for when filebot is processing my torrents. I've tried looking all around for help but I can't find anything that seems to of worked.

Log;

Code: Select all

Run script [fn:amc] at [Fri Jun 28 09:30:14 CEST 2019]
Parameter: ut_label = tv
Parameter: unsorted = y
Parameter: music = y
Parameter: artwork = y
Parameter: excludeList = /home/<username>/.excludes
Parameter: ut_dir = /home/<username>/torrents/rtorrent/Star.Trek.Voyager.S01E04.iNTERNAL.MULTi.1080p.WEB.x264-N3TFL1X
Parameter: ut_kind = multi
Parameter: ut_title = Star.Trek.Voyager.S01E04.iNTERNAL.MULTi.1080p.WEB.x264-N3TFL1X
Parameter: movieFormat = Movies/{n} [{y}]/{n} [{y}]
Parameter: seriesFormat = Shows/{plex.tail}
Parameter: animeFormat = Anime/{plex.tail}
Parameter: musicFormat = Music/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}
Illegal usage: output folder must exist and must be a directory: /home/<username>/Cloud
Abort (×_×)
rtorrent-postprocess.sh

Code: Select all

#!/bin/sh -xu

# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

# Configuration
CONFIG_OUTPUT="/home/<username>/Cloud"

filebot -script fn:amc --output "$CONFIG_OUTPUT" --action copy --conflict auto -non-strict --def "ut_label=music" --def "ut_label=tv" --def "ut_label=movie" -no-xattr --log-file amc.log --def unsorted=y music=y artwork=y excludeList="/home/<username>/.excludes" ut_dir="$ARG_PATH" ut_kind=multi ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def @/home/<username>/.filebot/formatting &


#filebot -script fn:amc --output "$CONFIG_OUTPUT" --action copy --conflict skip -non-strict -no-xattr --log-file amc.log --def unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" &

formatting file;

Code: Select all

movieFormat=Movies/{n} [{y}]/{n} [{y}]
seriesFormat=Shows/{plex.tail}
animeFormat=Anime/{plex.tail}
musicFormat=Music/{n}/{album+'/'}{pi.pad(2)+'. '}{artist} - {t}
rtorrent.rc file

Code: Select all

# -- START HERE --
directory.default.set = /home/<username>/torrents/rtorrent
encoding.add = UTF-8
encryption = allow_incoming,try_outgoing,enable_retry
execute.nothrow = chmod,777,/home/<username>/.config/rpc.socket
execute.nothrow = chmod,777,/home/<username>/.sessions
network.port_random.set = yes
network.port_range.set = 36530-38030
network.scgi.open_local = /var/run/<username>/.rtorrent.sock
schedule2 = chmod_scgi_socket, 0, 0, "execute2=chmod,\"g+w,o=\",/var/run/<username>/.rtorrent.sock"
network.tos.set = throughput
pieces.hash.on_completion.set = no
protocol.pex.set = no
method.set_key=event.download.finished,filebot,"execute={/home/<username>/.filebot/rtorrent-postprocess.sh,$d.base_path=,$d.name=,$d.custom1=}"
schedule = watch_directory,5,5,load.start=/home/<username>/rwatch/*.torrent
session.path.set = /home/<username>/.sessions/
throttle.global_down.max_rate.set = 0
throttle.global_up.max_rate.set = 0
throttle.max_peers.normal.set = 100
throttle.max_peers.seed.set = -1
throttle.max_uploads.global.set = 100
throttle.min_peers.normal.set = 1
throttle.min_peers.seed.set = -1
trackers.use_udp.set = yes

execute = {sh,-c,/usr/bin/php /srv/rutorrent/php/initplugins.php <username> &}

# -- END HERE --
Filebot sysinfo;

Code: Select all

FileBot 4.8.5 (r6224)
JNA Native: 5.2.2
MediaInfo: 18.12
7-Zip-JBinding: 9.20
Chromaprint: fpcalc version 1.2.0
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-05-15 (r565)
Groovy: 2.5.6
JRE: OpenJDK Runtime Environment 1.8.0_212
JVM: 64-bit OpenJDK 64-Bit Server VM
CPU/MEM: 12 Core / 13 GB Max Memory / 30 MB Used Memory
OS: Linux (amd64)
HW: Linux jayeesmediabox 4.15.0-52-generic #56~16.04.1-Ubuntu SMP Thu Jun 6 12:03:31 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
DATA: /home/<username>/.filebot/filebot-portable/data/<username>
Package: TAR
License: FileBot License P8219968 (Valid-Until: 2020-06-15)
Done ヾ(@⌒ー⌒@)ノ
The directory is owned by my user group 1000:1000 in which filebot is installed on and I can access the directory normally as well. I just can't work out what's going on.

Thanks
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [HELP] "Output folder must exist and must be a directory" Error

Post by rednoah »

What does this say?

Code: Select all

file /home/<username>/Cloud
Maybe this will do the trick:

Code: Select all

mkdir /home/<username>/Cloud

:idea: If it's working for you, but not for rtorrent, then it's likely because the user that rtorrent is running has, doesn't have permissions for your user home, which would be reasonable default permissions.
:idea: Please read the FAQ and How to Request Help.
j66454
Posts: 7
Joined: 08 Jun 2019, 14:29

Re: [HELP] "Output folder must exist and must be a directory" Error

Post by j66454 »

Hiya,

I did your command and I got the following;

Code: Select all

/home/<username>/Cloud: directory
I tried making the Directory and got this;

Code: Select all

mkdir: cannot create directory ‘/home/<username>/Cloud’: File exists
Running the script manually is fine and works like a treat. Anything I can look at for rutorrent permissions then?
j66454
Posts: 7
Joined: 08 Jun 2019, 14:29

Re: [HELP] "Output folder must exist and must be a directory" Error

Post by j66454 »

Just to add to this, when using the file manager in rutorrent I can see the directories etc. I also ensured that I did;

Code: Select all

sudo chown -R 1000:1000 /home/<username>/Cloud
to ensure that permissions etc are fine. Any other ideas?
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [HELP] "Output folder must exist and must be a directory" Error

Post by rednoah »

I'd add all these tests to your post-process script, because that's the perspective that matters, and then check what comes back:

Code: Select all

# Configuration
CONFIG_OUTPUT="/home/<username>/Cloud"

whoami > /tmp/whoami.txt 2>&1
printenv > /tmp/printenv.txt 2>&1
file "$CONFIG_OUTPUT" > /tmp/file.txt 2>&1
ls -l "$CONFIG_OUTPUT" > /tmp/ls.txt 2>&1
mkdir "$CONFIG_OUTPUT" > /tmp/mkdir.txt 2>&1

filebot -script fn:amc --output "$CONFIG_OUTPUT" ...
:arrow: viewtopic.php?t=3067
:idea: Please read the FAQ and How to Request Help.
j66454
Posts: 7
Joined: 08 Jun 2019, 14:29

Re: [HELP] "Output folder must exist and must be a directory" Error

Post by j66454 »

So I've added the suggested things into my post-processing script, but when torrents download, it now doesn't run and I don't get any new files or anything added into my log. Here is what it looks like;

Code: Select all

#!/bin/sh -xu

# Input Parameters
ARG_PATH="$1"
ARG_NAME="$2"
ARG_LABEL="$3"

# Configuration
CONFIG_OUTPUT="/home/<username>/Cloud/"

whoami > /tmp/whoami.txt 2>&1
printenv > /tmp/printenv.txt 2>&1
file "$CONFIG_OUTPUT" > /tmp/file.txt 2>&1
ls -l "$CONFIG_OUTPUT" > /tmp/ls.txt 2>&1
mkdir "$CONFIG_OUTPUT" > /tmp/mkdir.txt 2>&1

filebot -script fn:amc --output "$CONFIG_OUTPUT"...
User avatar
rednoah
The Source
Posts: 22975
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [HELP] "Output folder must exist and must be a directory" Error

Post by rednoah »

If the script isn't called, then filebot isn't called, so the first step is to go back to the beginning and get your torrent client to call your script, any script:
viewtopic.php?t=3067
:idea: Please read the FAQ and How to Request Help.
Post Reply