Page 1 of 1

Rule to run CLI script stopped working

PostPosted: Tue Jan 15, 2019 8:21 am
by mikejandreau
Or maybe it never worked, but I swear it did.

Here's my Rule: http://take.ms/dGTWS

Very simple: if the folder was created today, run a CLI script for Filebot ( filebot -script fn:artwork.tvdb $1)

The $1 should be the folder name.

Logs don't show any errors, just:
Code: Select all
2019-01-15 07:17:14.622 hazelworker[61169] Running worker (v4.3.3) for folder with identifier: 16777220-375689.
2019-01-15 07:17:41.369 hazelworker[61194] Running worker (v4.3.3) for folder with identifier: 16777220-375689.


I'd love to get this working again, so any new folder gets artwork for the show it contains.

Re: Rule to run CLI script stopped working

PostPosted: Tue Jan 15, 2019 3:03 pm
by Mr_Noodle
Go through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Make sure the files are actually matching your rule. Also, you may want to turn on debug mode as described here: https://www.noodlesoft.com/kb/hazel-debug-mode/

Re: Rule to run CLI script stopped working

PostPosted: Tue Jan 15, 2019 3:11 pm
by mikejandreau
Thanks for pointing me to Debug.

The Rule Preview works, as does the Eye icon.

The debug log shows me:

Code: Select all
2019-01-15 14:10:24.474 hazelworker[82719] DEBUG: == script output ==
java.nio.file.AccessDeniedException: /.filebot
java.nio.file.AccessDeniedException: /.filebot
   at net.filebot.ApplicationFolder.<init>(ApplicationFolder.java:34)
   at net.filebot.ApplicationFolder.<clinit>(ApplicationFolder.java:19)
   at net.filebot.Main.initializeSystemProperties(Main.java:388)
   at net.filebot.Main.main(Main.java:106)

java.nio.file.AccessDeniedException: /.filebot
java.nio.file.AccessDeniedException: /.filebot
   at net.filebot.ApplicationFolder.<init>(ApplicationFolder.java:34)
   at net.filebot.ApplicationFolder.<clinit>(ApplicationFolder.java:21)
   at net.filebot.Main.initializeSystemProperties(Main.java:388)
   at net.filebot.Main.main(Main.java:106)

java.nio.file.AccessDeniedException: /.filebot
java.nio.file.AccessDeniedException: /.filebot
   at net.filebot.ApplicationFolder.<init>(ApplicationFolder.java:34)
   at net.filebot.ApplicationFolder.<clinit>(ApplicationFolder.java:23)
   at net.filebot.Main.initializeSystemProperties(Main.java:388)
   at net.filebot.Main.main(Main.java:106)

Error during startup
java.lang.ExceptionInInitializerError
   at net.filebot.Main.main(Main.java:110)
Caused by: net.sf.ehcache.CacheException: java.nio.file.AccessDeniedException: /.filebot
   at net.filebot.CacheManager.<init>(CacheManager.java:36)
   at net.filebot.CacheManager.<clinit>(CacheManager.java:22)
   ... 1 more
Caused by: java.nio.file.AccessDeniedException: /.filebot
   at net.filebot.util.FileUtilities.createFolders(FileUtilities.java:184)
   at net.filebot.CacheManager.acquireDiskStore(CacheManager.java:73)
   at net.filebot.CacheManager.<init>(CacheManager.java:33)
   ... 2 more


Which looks like a permissions issue. However, the same script in the same directory works in Terminal, so I'm stuck on what the issue is. Any idea why Hazel wouldn't be able to run the script but I can in Terminal (without Sudo access)?

Re: Rule to run CLI script stopped working

PostPosted: Wed Jan 16, 2019 10:59 am
by Mr_Noodle
Not sure but keep in mind Hazel may not have all the environment variables set that you do in Terminal. Also, maybe there's some issue with the java sandbox?

Re: Rule to run CLI script stopped working

PostPosted: Wed Jan 16, 2019 11:01 am
by mikejandreau
I ended up giving up. The author of Filebot is notoriously condescending and unhelpful and didn't help here.

My workaround was to run that script as part of the initial process before Hazel gets involved and just modify Hazel to move all of the artwork files, rather than move the main video file and run the artwork fetch after.