Page 1 of 1

AMC Script Suddenly Not Working

Posted: 13 Aug 2020, 17:37
by ih7
Hi.

I am using Raspbian, Transmission, and Plex - and the standard AMC script had been working perfectly until recently. I have checked /etc/transmission-daemon/settings.json and everything is how it should be. Nothing has changed here, or in transmission-postprocess.sh. I recently ran sudo apt-get update and upgrade, so maybe that's the cause.

I have read the instructions regarding debugging/logging, but Linux is fairly new to me and I'm not sure how to enable this for Transmission.

I can run the command manually in test mode, and it works just fine:
https://snipboard.io/NZwJhQ.jpg

Here are the results of filebot -script fn:info:
https://snipboard.io/2npDUq.jpg

EDIT: Have added printenv > /mnt/Seagate2/printenv.txt to the .sh script to see if it's being called. And this file gets created when the torrent finishes downloading. But amc.log isn't updated, and the file isn't changed/moved.

amc.log extract here, showing the last successful runs on 25 July, and the results of today's tests:
https://pastebin.com/LwG027wP

Any help would be appreciated.

Thanks a lot.

Re: AMC Script Suddenly Not Working

Posted: 14 Aug 2020, 01:33
by rednoah
Please read Shell Script Debugging for Beginners again if you haven't already:
viewtopic.php?t=3067

If your printenv is executed as per (1) then on to (2) to find out why the filebot call isn't executed:
rednoah wrote: 09 Oct 2015, 16:48 2.
Then we add IO redirection to the call that doesn't work:

Code: Select all

filebot -script fn:sysenv > "/path/to/log.txt" 2>&1
At this point we know it's called, so it must error out for some reason. Make sure to collect BOTH standard output and standard error output.


3.
Look at the example debug script:
https://github.com/filebot/plugins/blob/master/bash/debug.sh




The logs look good to me on first glance? Can you point to a specific line number where things go awry?

Code: Select all

Run script [fn:amc] at [Thu Aug 13 18:00:11 BST 2020]
...
[DUPLICATE] from [/mnt/Seagate2/torrent-complete/Condor - 1x07 - Within a Dark Wood.mkv] to [/mnt/Seagate2/NAS_Video/TV Shows/Condor/Season 01/Condor - S01E07 - Within a Dark Wood.mkv]
...
[DUPLICATE] from [/mnt/Seagate2/torrent-complete/The.Bachelor.AU.S08E01.HDTV.x264-CCT[rarbg]/The.Bachelor.AU.S08E01.HDTV.x264-CCT.mkv] to [/mnt/Seagate2/NAS_Video/TV Shows/The Bachelor (DE)/Season 08/The Bachelor (DE) - S08E01 - Folge 1.mkv]
...

Re: AMC Script Suddenly Not Working

Posted: 14 Aug 2020, 06:22
by ih7
Hi.

Thanks for the quick reply.

Adding the lines you suggested to transmission-postprocess.sh reveals the following, in the generated filebot-sysinfo.txt file (via filebot -script fn:sysinfo > /mnt/Seagate2/NAS_Video/filebot-sysinfo.txt 2>&1):

Code: Select all

Error during startup: AccessDeniedException: /var/lib/transmission-daemon/.filebot
java.lang.IllegalStateException: TemporaryFiles folder [/var/lib/transmission-daemon/.filebot/tmp] does not exist and could not be created
	at net.filebot.ApplicationFolder.mkdirs(Unknown Source)
	at net.filebot.Main.main(Unknown Source)
Caused by: java.nio.file.AccessDeniedException: /var/lib/transmission-daemon/.filebot
	at net.filebot.ApplicationFolder.mkdir(Unknown Source)
	... 2 more
But there is no .filebot folder in /var/lib/transimission-daemon/
https://snipboard.io/E8mjF4.jpg

Running the same command manually results in:

Code: Select all

# Environment Variables #
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
XAUTHORITY: /home/pi/.Xauthority
_LXSESSION_PID: 698
XDG_DATA_DIRS: /usr/share/fkms:/usr/local/share:/usr/share/raspi-ui-overrides:/usr/share:/usr/share/gdm:/var/lib/menu-xdg
GDMSESSION: lightdm-xsession
TERM: xterm-256color
XDG_CONFIG_DIRS: /etc/xdg
LANG: en_US.UTF-8
DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1000/bus
XDG_SEAT_PATH: /org/freedesktop/DisplayManager/Seat0
XDG_SESSION_ID: c1
XDG_SESSION_TYPE: x11
XDG_CURRENT_DESKTOP: LXDE
DISPLAY: :0.0
SSH_AGENT_PID: 769
COLORTERM: truecolor
LOGNAME: pi
PWD: /var/lib/transmission-daemon
XDG_SESSION_CLASS: user
_: /usr/bin/filebot
LANGUAGE: en_US.UTF-8
SHELL: /bin/bash
XDG_GREETER_DATA_DIR: /var/lib/lightdm/data/pi
GPG_AGENT_INFO: /run/user/1000/gnupg/S.gpg-agent:0:1
DESKTOP_SESSION: LXDE-pi
OLDPWD: /
USER: pi
XDG_CONFIG_HOME: /home/pi/.config
XDG_MENU_PREFIX: lxde-pi-
VTE_VERSION: 5402
SSH_AUTH_SOCK: /tmp/ssh-QGV6X3oxSjSB/agent.698
XDG_SEAT: seat0
LC_ALL: en_US.UTF-8
XDG_SESSION_PATH: /org/freedesktop/DisplayManager/Session0
SAL_USE_VCLPLUGIN: gtk3
TEXTDOMAIN: Linux-PAM
QT_QPA_PLATFORMTHEME: qt5ct
NO_AT_BRIDGE: 1
XDG_VTNR: 7
LS_COLORS: rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_SESSION_DESKTOP: lightdm-xsession
XDG_RUNTIME_DIR: /run/user/1000
HOME: /home/pi
SHLVL: 1


# Java System Properties #
awt.toolkit: sun.awt.X11.XToolkit
java.specification.version: 11
sun.cpu.isalist: 
sun.jnu.encoding: UTF-8
java.class.path: /usr/share/filebot/jar/filebot.jar
java.vm.vendor: Raspbian
grape.root: /home/pi/.filebot/grape
useExtendedFileAttributes: true
sun.arch.data.model: 32
jna.library.path: /usr/lib/arm-linux-gnueabihf/jni
net.filebot.archive.extractor: ShellExecutables
java.vendor.url: Unknown
user.timezone: Europe/London
jna.nounpack: true
os.name: Linux
java.vm.specification.version: 11
sun.net.client.defaultReadTimeout: 60000
jna.boot.library.path: /usr/lib/arm-linux-gnueabihf/jni
sun.java.launcher: SUN_STANDARD
user.country: US
sun.boot.library.path: /usr/lib/jvm/java-11-openjdk-armhf/lib
sun.java.command: /usr/share/filebot/jar/filebot.jar -script fn:sysenv
jdk.debug: release
useGVFS: true
sun.cpu.endian: little
user.home: /home/pi
user.language: en
java.specification.vendor: Oracle Corporation
jdk.module.path: /usr/share/openjfx/lib
java.version.date: 2020-07-14
java.home: /usr/lib/jvm/java-11-openjdk-armhf
file.separator: /
line.separator: 

unixfs: false
useCreationDate: false
prism.order: sw
java.specification.name: Java Platform API Specification
java.vm.specification.vendor: Oracle Corporation
jna.boot.library.name: jnidispatch.system
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
application.cache: /home/pi/.filebot/cache
net.filebot.UserFiles.fileChooser: JavaFX
http.agent: FileBot/4.9.1
net.filebot.theme: Darcula
sun.management.compiler: HotSpot Tiered Compilers
java.runtime.version: 11.0.8+10-post-Raspbian-1deb10u1
user.name: pi
sun.net.client.defaultConnectTimeout: 10000
path.separator: :
java.net.useSystemProxies: true
os.version: 5.4.51-v7l+
jna.nosys: false
java.runtime.name: OpenJDK Runtime Environment
file.encoding: UTF-8
java.vm.name: OpenJDK Server VM
java.vendor.url.bug: Unknown
java.io.tmpdir: /home/pi/.filebot/tmp
swing.crossplatformlaf: javax.swing.plaf.nimbus.NimbusLookAndFeel
java.version: 11.0.8
user.dir: /var/lib/transmission-daemon
os.arch: arm
java.vm.specification.name: Java Virtual Machine Specification
net.filebot.gio.GVFS: /run/user/1000/gvfs
java.awt.printerjob: sun.print.PSPrinterJob
sun.os.patch.level: unknown
application.deployment: deb
java.library.path: /usr/lib/arm-linux-gnueabihf/jni
java.vm.info: mixed mode
java.vendor: Raspbian
java.vm.version: 11.0.8+10-post-Raspbian-1deb10u1
sun.arch.abi: 
application.dir: /home/pi/.filebot
sun.io.unicode.encoding: UnicodeLittle
org.apache.commons.logging.Log: org.apache.commons.logging.impl.NoOpLog
java.class.version: 55.0


# Arguments #
args[0] = -script
args[1] = fn:sysenv


Done ヾ(@⌒ー⌒@)ノ
Both the other lines - generating filebot-version.txt and filebot-sysenv.txt work as expected.

Re: the sample from amc.log, the last line where it was running automatically is 102, from there on (13 Aug) the processing was either manual via the CLI, or run in test mode.

Thanks again.

Re: AMC Script Suddenly Not Working

Posted: 14 Aug 2020, 06:39
by rednoah
$HOME is different depending on which user is running filebot. Same applies to $TMPDIR and other environment variables.


You need to either run FileBot as your normal user, or make sure that the transmission user is correctly configured with an accessible $HOME folder.


:arrow: You'll want to run all your debug calls such as filebot -script fn:sysenv within the transmission context. Running as normal user just tells you that it fundamentally works, but only running as transmission user can tell you what's different and why it doesn't work.

Re: AMC Script Suddenly Not Working

Posted: 14 Aug 2020, 11:56
by ih7
Thanks for the updates. I'm looking into this from the Transmission user perspective now.

I'll let you know how I get on.

EDIT: I have tried various things e.g. reinstalling Transmission and following the steps here https://pimylifeup.com/raspberry-pi-transmission/ (which I used in the initial install) to ensure Transmission runs using my user, inserting commands into the postprocess script to try and force it to run using my user, but nothing has worked. I'm going away for a few days but think I will start from scratch and do a fresh install of everything including the OS when I get back. Cheers.

Re: AMC Script Suddenly Not Working

Posted: 24 Aug 2020, 12:55
by ih7
Hi.

After the rebuild everything works as before. I suspect as you suggested the issue was to do with permissions (I didn't realise that ExFAT doesn't support standard Linux user permissions), but anyway.

Thanks for your help.