filebot -script fn:history no longer working --SOLVED

All your suggestions, requests and ideas for future development
Post Reply
jprokos
Posts: 155
Joined: 09 Oct 2016, 02:01

filebot -script fn:history no longer working --SOLVED

Post by jprokos »

Code: Select all

10/17/21_13:24:52 /Users/john
$ filebot -script fn:history
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class net.filebot.Logging
	at net.filebot.Main.main(Unknown Source)

10/17/21_13:26:08 /Users/john
$ filebot -script fn:history /Users/john/.filebot/history.xml
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class net.filebot.Logging
	at net.filebot.Main.main(Unknown Source)

10/17/21_13:29:07 /Users/john
$ filebot -script fn:history "/Users/john/.filebot/history.xml"
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class net.filebot.Logging
	at net.filebot.Main.main(Unknown Source)
Not sure what changed.

Just tried to clone github repo and run:

Code: Select all

10/17/21_13:44:35 /Users/john/.filebot/FileBotScriptRepo
$ filebot -script /Users/john/.filebot/FileBotScriptRepo/scripts/history.groovy | grep -v "\.srt\|\.idx\|\.sub" |  tr '\t\n' '\0' |  xargs -0 -n100000 basename -a | gsed '0~2 s/$/\n---/g'
Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class net.filebot.Logging
	at net.filebot.Main.main(Unknown Source)
EDIT... Actually just realized that i can't even open FileBot.app. So looks like a java issue, but I thought Java was self contained within the FileBot.app these days.

Looks like there is a regression at Homebrew. If a user has openjdk installed and is running an intel processor openjdk.rb install script is installing openjdk17 for arm processors.

EDIT... Nope not a homebrew issue. It's because I used lowercase letters in my system.properties file when I changed from info to warning logging level. :roll:
Amazing that something as simple as that can prevent filebot from starting up.
User avatar
rednoah
The Source
Posts: 20328
Joined: 16 Nov 2011, 08:59

Re: filebot -script fn:history no longer working --SOLVED

Post by rednoah »

The error messages above indicate that something strange is going on, as if FileBot can't access its own application data files for some reason. If it randomly starts and stops working, then there's probably some macOS strangeness to blame. The *.app bundle itself is self-contained and doesn't use (and shouldn't even know about) whatever OpenJDK you may or may not have installed on your system.


:idea: --log is case-insensitive so all of this will work:

Code: Select all

filebot -script fn:history --log warning

Code: Select all

filebot -script fn:history --log WARNING

Code: Select all

filebot -script fn:history --log WaRnInG

:idea: --log will give you a human-readable error message if you pass in an invalid value:

Code: Select all

filebot -script fn:history --log XYZ
An unexpected error occurred during startup: Invalid --log level: 'XYZ': Bad level "XYZ"
:idea: Please read the FAQ and How to Request Help.
jprokos
Posts: 155
Joined: 09 Oct 2016, 02:01

Re: filebot -script fn:history no longer working --SOLVED

Post by jprokos »

Apparently filebot's "system.properties" is sensitive to case.

Code: Select all

/Users/user/.filebot/system.properties
this works:

Code: Select all

net.filebot.logging.debug=WARNING
this caused filebot to not startup:

Code: Select all

net.filebot.logging.debug=warning
User avatar
rednoah
The Source
Posts: 20328
Joined: 16 Nov 2011, 08:59

Re: filebot -script fn:history no longer working --SOLVED

Post by rednoah »

Ah, yes! That explains things! If you set system properties directly, then that will bypass all the sanity checks of the command-line parser and then the error message above make sense!


EDIT:

FileBot r8885 will now gracefully catch errors that occur during logging initialization.
:idea: Please read the FAQ and How to Request Help.
Post Reply