[Solved] Script is doing nothing on Transmission complete

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Sodden
Posts: 4
Joined: 02 May 2014, 18:14

[Solved] Script is doing nothing on Transmission complete

Post by Sodden »

Hi,

I struggling really hard to get my filebot script to work with transmission, but it's just not working.

Here is my script.

Code: Select all

#!/bin/sh
/usr/share/filebot/bin/filebot.sh -script fn:amc --output "/media/afa5342b-7ff6-41a3-aef2-3c7f6af3e34a/Videos" --log-file amc.log --action copy --conflict override -non-strict --def artwork=y --def "animeFormat=Anime/{primaryTitle}/{primaryTitle} - {e} - {t} [{group}]({crc32})" "seriesFormat=Serien/{n}/Season {s}/{n} - {s00e00} - {t}" "ut_dir=$TR_TORRENT_DIR/$TR_TORRENT_NAME" "ut_kind=multi" "ut_title=$TR_TORRENT_NAME" 2> /var/log/filebot-error.log 1> /var/log/filebot.log
Permissions on the script look like this.

Code: Select all

-rwxrwxr-x+ 1 Sodden users 668 May  2 19:52 /media/e00265a2-efd6-4bd2-84ef-d60a6ea09f5d///Sodden/scripts/filebot.sh
Permissions on filebot look like this.

Code: Select all

-rwxr-xr-x 1 Sodden root 557 Jan 29 02:21 /usr/share/filebot/bin/filebot.sh
Transmission says.

Code: Select all

[20:22:09.857] [HorribleSubs] Inugami-san to Nekoyama-san - 04 [480p].mkv Calling script "/media/e00265a2-efd6-4bd2-84ef-d60a6ea09f5d/Sodden/scripts/filebot.sh" (torrent.c:2016)
But it does nothing, no output at all in any log. So I tried running the script manually.

Calling the script with manual variables.

Code: Select all

/usr/share/filebot/bin/filebot.sh -script fn:amc --output "/media/afa5342b-7ff6-41a3-aef2-3c7f6af3e34a/Videos" --log-file amc.log --action test --conflict override -non-strict --def artwork=y --def "animeFormat=Anime/{primaryTitle}/{primaryTitle} - {e} - {t} [{group}]({crc32})" "seriesFormat=Serien/{n}/Season {s}/{n} - {s00e00} - {t}" "ut_dir=/media/afa5342b-7ff6-41a3-aef2-3c7f6af3e34a/Downloads/[HorribleSubs]\ Inugami-san\ to\ Nekoyama-san\ -\ 04\ [480p]" "ut_kind=multi" "ut_title=[HorribleSubs]\ Inugami-san\ to\ Nekoyama-san\ -\ 04\ [480p]" 2> /var/log/filebot-error.log 1> /var/log/filebot.log
amc.log

Code: Select all

Parameter: artwork = y
Parameter: animeFormat = Anime/{primaryTitle}/{primaryTitle} - {e} - {t} [{group}]({crc32})
Parameter: seriesFormat = Serien/{n}/Season {s}/{n} - {s00e00} - {t}
Parameter: ut_dir = /media/afa5342b-7ff6-41a3-aef2-3c7f6af3e34a/Downloads/[HorribleSubs]\ Inugami-san\ to\ Nekoyama-san\ -\ 04\ [480p]
Parameter: ut_kind = multi
Parameter: ut_title = [HorribleSubs]\ Inugami-san\ to\ Nekoyama-san\ -\ 04\ [480p]
Done ヾ(@⌒ー⌒@)ノ
filebot.log

Code: Select all

Locking /media/e00265a2-efd6-4bd2-84ef-d60a6ea09f5d/Sodden/.filebot/logs/amc.log
Parameter: artwork = y
Parameter: animeFormat = Anime/{primaryTitle}/{primaryTitle} - {e} - {t} [{group}]({crc32})
Parameter: seriesFormat = Serien/{n}/Season {s}/{n} - {s00e00} - {t}
Parameter: ut_dir = /media/afa5342b-7ff6-41a3-aef2-3c7f6af3e34a/Downloads/[HorribleSubs]\ Inugami-san\ to\ Nekoyama-san\ -\ 04\ [480p]
Parameter: ut_kind = multi
Parameter: ut_title = [HorribleSubs]\ Inugami-san\ to\ Nekoyama-san\ -\ 04\ [480p]
Done ヾ(@⌒ー⌒@)ノ
I've been working on this for 5 hours now and haven't got the slights clue where it hangs, I've quadruple check EVERYTHING. Maybe it's just some stupid typo but I'm not seeing it or I'm just doing it completely wrong. I hope you guys can help cause I'm starting to freak the F out.
Last edited by Sodden on 06 May 2014, 17:56, edited 1 time in total.
User avatar
rednoah
The Source
Posts: 23006
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot script is doing nothing on Transmission complete

Post by rednoah »

Have you made absolutely sure that you're script is called by transmission? Like dumping the variables and see?

Your call can't work because you pass an illegal path. Which of course results in empty input. You can't do. "..." Literal and then escape blanks. You're just passing in the \ literally in your call.
:idea: Please read the FAQ and How to Request Help.
Sodden
Posts: 4
Joined: 02 May 2014, 18:14

Re: Filebot script is doing nothing on Transmission complete

Post by Sodden »

You're right. Transmission may be saying it's calling the script but it isn't. I tried a basic script with an

Code: Select all

 echo "You shall not pass!" > /tmp/test.txt
and it did nothing, no file under /tmp. Permissions are 777 so it sould work, it is working from terminal thats for sure. Maybe my transmission install went bonkers an some update or something, I'll ask some people who are running the same software as I to try it out.
Sodden
Posts: 4
Joined: 02 May 2014, 18:14

Re: Filebot script is doing nothing on Transmission complete

Post by Sodden »

Okay I've got transmission to the execute the script. Now I'm getting this output

Code: Select all

May 04, 2014 9:11:48 PM net.sourceforge.filebot.Main initializeCache
WARNING: java.io.IOException: Failed to create cache dir: /.filebot/cache/0
java.io.IOException: Failed to create cache dir: /.filebot/cache/0
        at net.sourceforge.filebot.Main.initializeCache(Main.java:438)
        at net.sourceforge.filebot.Main.main(Main.java:142)

May 04, 2014 9:11:48 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: Couldn't create user preferences directory. User preferences are unusable.
May 04, 2014 9:11:48 PM java.util.prefs.FileSystemPreferences$1 run
WARNING: java.io.IOException: No such file or directory
Parameter: artwork = y
Parameter: animeFormat = Anime/{primaryTitle}/{primaryTitle} - {e} - {t} [{group}]({crc32})
Parameter: seriesFormat = Serien/{n}/Season {s}/{n} - {s00e00} - {t}
Parameter: ut_dir = /media/afa5342b-7ff6-41a3-aef2-3c7f6af3e34a/Downloads////[HorribleSubs] Inugami-san to Nekoyama-san - 04 [480p].mkv
Parameter: ut_kind = multi
Parameter: ut_title = [HorribleSubs] Inugami-san to Nekoyama-san - 04 [480p].mkv
Exclude: /media/afa5342b-7ff6-41a3-aef2-3c7f6af3e34a/Downloads/[HorribleSubs] Inugami-san to Nekoyama-san - 04 [480p].mkv
Done ヾ(@⌒ー⌒@)ノ
Why is there an exclude at the end ? I've not defined any filters.

edit: Do I have to use an absolute path for animeFormat/seriesFormat ?
User avatar
rednoah
The Source
Posts: 23006
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Filebot script is doing nothing on Transmission complete

Post by rednoah »

I'd be more worried about filebot not being allowed access to it's own home folder... which is very bad.

No idea why a file would be excluded. Maybe too small? Maybe too short? See manual for default minimum settings.
:idea: Please read the FAQ and How to Request Help.
Sodden
Posts: 4
Joined: 02 May 2014, 18:14

Re: Filebot script is doing nothing on Transmission complete

Post by Sodden »

rednoah wrote:I'd be more worried about filebot not being allowed access to it's own home folder... which is very bad.

No idea why a file would be excluded. Maybe too small? Maybe too short? See manual for default minimum settings.

Okay it's working now. Thanks for the tips.
Turns out shares on my system are automatically mounted "noexec", which explains why no script worked at first. Moving them to the system root solved that.
Next thing was that the script was first created with notepad++ on a windows machine and it somehow screwed the file up so it couldn't be executed. Fixed by using nano on the server for script creation.
Last thing was the user calling the script is the one running the transmission daemon, debian-transmission in this case. Said user had no /home folder. And since filebot is only creating $HOME/.filebot/* so the call resulted in an error like above.
liabilityman
Posts: 4
Joined: 11 May 2014, 17:58

Re: Filebot script is doing nothing on Transmission complete

Post by liabilityman »

Sodden wrote:Last thing was the user calling the script is the one running the transmission daemon, debian-transmission in this case. Said user had no /home folder. And since filebot is only creating $HOME/.filebot/* so the call resulted in an error like above.
I seem to be having the exact same issue, a filebot script called by transmission-deamon fails to create cache files. How did you resolve the issue?

My error:

Code: Select all

May 11, 2014 10:27:58 AM net.sourceforge.filebot.Main initializeCache
WARNING: java.io.IOException: Failed to create cache dir: /.filebot/cache/0
java.io.IOException: Failed to create cache dir: /.filebot/cache/0
	at net.sourceforge.filebot.Main.initializeCache(Main.java:438)
	at net.sourceforge.filebot.Main.main(Main.java:142)

May 11, 2014 10:27:58 AM java.util.prefs.FileSystemPreferences$1 run
WARNING: Couldn't create user preferences directory. User preferences are unusable.
May 11, 2014 10:27:58 AM java.util.prefs.FileSystemPreferences$1 run
WARNING: java.io.IOException: No such file or directory
Parameter: artwork = n
Parameter: ut_dir = /media/data/torrents/complete/****.mp4
Parameter: ut_kind = multi
Parameter: ut_title = ****.mp4
JNA Warning: IOException removing temporary files: JNA temporary directory '/.filebot/temp' does not exist
May 11, 2014 10:28:06 AM net.sourceforge.filebot.mediainfo.MediaInfo <clinit>
WARNING: Failed to preload libzen
Input: /media/data/torrents/complete/****.mp4
Group: [tvs:****] => [****.mp4]
Rename episodes using [TheTVDB]
Auto-detected query: [****]
CacheException: Disk store path can't be created: /.filebot/cache/default
Done ヾ(@⌒ー⌒@)ノ
User avatar
rednoah
The Source
Posts: 23006
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Solved] Script is doing nothing on Transmission complet

Post by rednoah »

FYI your $HOME variable is empty!!! Of course FileBot isn't allowed to create a folder in in the filesystem root.

So fix $HOME and fix the permissions so the deluge-daemon user has full access to the .filebot folder.
:idea: Please read the FAQ and How to Request Help.
AubeRoseau
Posts: 1
Joined: 02 Dec 2014, 19:58

Re: [Solved] Script is doing nothing on Transmission complet

Post by AubeRoseau »

I have the same problem. How can I fix $HOME????
User avatar
rednoah
The Source
Posts: 23006
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [Solved] Script is doing nothing on Transmission complet

Post by rednoah »

That depends on why $HOME isn't set. That's definitely not normal. I'm sure Google will help for these kinds of generic Linux issues.
:idea: Please read the FAQ and How to Request Help.
Post Reply