AMC failing, but only sometimes

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
mikejandreau
Posts: 42
Joined: 07 Jun 2017, 16:50

AMC failing, but only sometimes

Post by mikejandreau »

I've been (happily) running the AMC post-processing script for years.

However, lately, some files are failing to rename and I can't figure out why.

Here's my script (I believe this is copied straight from the docs):

Code: Select all

#!/bin/sh -xu

# Input Parameters
ARG_PATH="$TR_TORRENT_DIR/$TR_TORRENT_NAME"
ARG_NAME="$TR_TORRENT_NAME"
ARG_LABEL="N/A"

# Configuration
CONFIG_OUTPUT="/Volumes/Super Storage/Video/To Be Processed"

/usr/local/bin/filebot -script fn:amc --output "$CONFIG_OUTPUT" --action move --conflict skip -non-strict --log-file ~/Desktop/amc.log --def clean=y unsorted=y music=y artwork=y excludeList=".excludes" ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL"
And here's an output from my log file that fails:

Code: Select all

Parameter: ut_dir = /Volumes/Super Storage/Video/To Be Processed/TV Shows/a.million.little.things.s03e01.720p.hdtv.x264-syncopy[eztv.re].mkv
Parameter: ut_title = a.million.little.things.s03e01.720p.hdtv.x264-syncopy[eztv.re].mkv
Input: /Volumes/Super Storage/Video/To Be Processed/TV Shows/a.million.little.things.s03e01.720p.hdtv.x264-syncopy[eztv.re].mkv
Group: {Series=a million little things} => [a.million.little.things.s03e01.720p.hdtv.x264-syncopy[eztv.re].mkv]
Auto-detected query: [A Million Little Things]
Fetching episode data for [A Million Little Things]
[MOVE] from [/Volumes/Super Storage/Video/To Be Processed/TV Shows/a.million.little.things.s03e01.720p.hdtv.x264-syncopy[eztv.re].mkv] to [/Volumes/Super Storage/Video/To Be Processed/TV Shows/A Million Little Things/Season 03/A Million Little Things - S03E01 - hit & run.mkv]
[MOVE] Failure: java.nio.file.NoSuchFileException: /Volumes/Super Storage/Video/To Be Processed/TV Shows/a.million.little.things.s03e01.720p.hdtv.x264-syncopy[eztv.re].mkv
NoSuchFileException: /Volumes/Super Storage/Video/To Be Processed/TV Shows/a.million.little.things.s03e01.720p.hdtv.x264-syncopy[eztv.re].mkv
I'll note that I have a script running in Hazel to run Handbrake on .mkv files to change their container to .mp4. However, that script won't run on any file last modified within a minute. Which seems to generally be more than enough for Filebot to have run on the file.

I'm also confused because Filebot is the one moving the file from where it was downloaded to where Hazel is processing it. So, in theory, Hazel shouldn't even see the file until Filebot's run on it.

Any thoughts on what I'm missing?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: AMC failing, but only sometimes

Post by rednoah »

According to the log, the source file didn't exist anymore by the time filebot came around to process the file:

Code: Select all

[MOVE] from [A.mkv] to [B.mkv]
[MOVE] Failure: java.nio.file.NoSuchFileException: A.mkv

:idea: If A.mkv is gone, then it must have gone somewhere. B.mkv doesn't exist either because we couldn't move A.mkv in the first place, so there must be a C.mkv lying around somewhere. If you can find where A.mkv went, then you might find the tool that's stealing files away from under us.


:idea: If B.mkv exists somehow, then it wasn't filebot doing the moving, at the very least not the particular filebot instance that reported not being able to move the file.


:idea: You likely have a race condition where multiple tools process the same file at the same time, giving different results depending on the timing of things.



EDIT:

:!: You're using /Volumes/Super Storage/Video/To Be Processed/TV Shows as both input and output folder, which is generally a bad idea. The amc script actively tries to detect that case (which isn't always possible) and abort. Your $TR_TORRENT_DIR input folder should NOT be the same as your filebot --output folder.
:idea: Please read the FAQ and How to Request Help.
Post Reply