Script error run from Hazel, but works from Terminal

Support for macOS users and the Mac App Store package
Post Reply
mikejandreau
Posts: 23
Joined: 07 Jun 2017, 16:50

Script error run from Hazel, but works from Terminal

Post by mikejandreau » 15 Jan 2019, 20:11

I've got most of my automation working perfectly, except one thing.

Once AMC does its thing, Hazel sees a new .mp4 in a directory and moves it to its final home, where Plex sees it.

Once there, Hazel should also see there's a new directory and run a simple bash script of

Code: Select all

filebot -script fn:artwork.tvdb FILENAME
When it runs, I get a bunch of permissions errors, ie;

Code: Select all

2019-01-15 15:07:15.597 hazelworker[85551] DEBUG: New rule signature. Executing actions.
Old signatures: (
    "{dateModified ==[cd] today}:{(shellscript:/bin/bash:68c81b5413852440b9a8da72e66a7dec,{\n})}"
)
New Signature:{dateModified ==[cd] today}:{(shellscript:/bin/bash:b529c86417ade1c4773924896f541d89,{
})}
2019-01-15 15:07:16.100 hazelworker[85551] 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


== End script output ==
I've tried:
  • Making the main directory writeable to "Everyone"
  • Running the script with /usr/local/bin/filebot in it
  • Making the the directory it's outputting to writeable to "Everyone"
  • Adding an Output destination to the command
  • Trying to output to my Desktop
I know it's a permissions issue, but I can't pinpoint what's needing more permission in order to fix it.

mikejandreau
Posts: 23
Joined: 07 Jun 2017, 16:50

Re: Script error run from Hazel, but works from Terminal

Post by mikejandreau » 15 Jan 2019, 20:57

Another post has this same error, and it's suggested that $HOME may be set wrong.

My $HOME path is set to

Code: Select all

/Users/Alfred
, which is my user profile and seems correct to me.

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

Re: Script error run from Hazel, but works from Terminal

Post by rednoah » 16 Jan 2019, 02:29

This same error?

Code: Select all

java.nio.file.AccessDeniedException: /.filebot
Because this particular error definitely means that $HOME is not set, at least in the environment that FileBot is called in.
:idea: Please read the FAQ and How to Request Help.

mikejandreau
Posts: 23
Joined: 07 Jun 2017, 16:50

Re: Script error run from Hazel, but works from Terminal

Post by mikejandreau » 16 Jan 2019, 11:31

Yeah, that’s the error.

I’ve tried everything I can think of and can’t fix it. My $HOME is set properly in my bash profile. Should it be set somewhere else, for Hazel to see it?

The only thing I didn’t try was changing /bin/bash in the Hazel script editor. I’ll try that when I get to my desk. Maybe it needs a fuller path there.

Post Reply