New error with CLI fetch artwork (Series)

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
nartana
Posts: 35
Joined: 02 May 2019, 22:28

New error with CLI fetch artwork (Series)

Post by nartana »

I've looked for a similar issue on the forums (maybe I missed it.)

For years, I've fetched artwork successfully using the following CLI:

Code: Select all

filebot -script fn:artwork.tvdb /Volumes/Media/Series/ -non-strict --def maxAgeDays=30
I use Terminal (OSX) to perform CLI operations with Filebot. My media lives on a Synology DS920+ and the "fetch artwork" commands always have worked.

Today, the CLI (above) began to work, but then it produced the following error:

Code: Select all

Undefined Variable: java.lang.NullPointerException: Cannot invoke "Object.toString()" because "<parameter2>" is null at net.filebot.cli.ScriptShellMethods::sortBySimilarity in __script_c6d61446bf265425d8536d81edac79ff_60e$_run_closure1::doCall in net.filebot.cli.ScriptShellMethods::eachMediaFolder
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "<parameter2>" is null
	at net.filebot.cli.ScriptShellMethods.sortBySimilarity(Unknown Source)
	at __script_c6d61446bf265425d8536d81edac79ff_60e$_run_closure1.doCall(__script_c6d61446bf265425d8536d81edac79ff_60e:61)
	at net.filebot.cli.ScriptShellMethods.eachMediaFolder(Unknown Source)
	at __script_c6d61446bf265425d8536d81edac79ff_60e.run(__script_c6d61446bf265425d8536d81edac79ff_60e:13)
	at net.filebot.GroovyEngine.eval(Unknown Source)
	at net.filebot.cli.ScriptShell.evaluate(Unknown Source)
	at net.filebot.cli.ScriptShell.runScript(Unknown Source)
	at net.filebot.cli.ArgumentProcessor.runScript(Unknown Source)
	at net.filebot.cli.ArgumentProcessor.run(Unknown Source)
	at net.filebot.Main.main(Unknown Source)
In an effort to resolve this, I used CLI to successfully clear Filbebot's cache and prefs. Then, I tried to fetch artwork for Movies, and that worked perfectly as always.

I've restarted both NAS devices and my laptop. I retried the fetch-artwork CLI for Series but this produced the same "begins to work, then errors out" message.

Please advise. Thank you.
nartana
Posts: 35
Joined: 02 May 2019, 22:28

Re: New error with CLI fetch artwork (Series)

Post by nartana »

I tried the same process using a different machine with Windows PowerShell, and the results were identical. The command initially begins to lookup Series entries, generating a few NFOs, and then it produces the same "Undefined variable" error as above. FWIW.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: New error with CLI fetch artwork (Series)

Post by rednoah »

Sounds like you have already narrowed down the issue to a specific file path? Can you share that file path? If we can reproduce the issue on our end, then that will allows us to fix the issue quickly.
:idea: Please read the FAQ and How to Request Help.
nartana
Posts: 35
Joined: 02 May 2019, 22:28

Re: New error with CLI fetch artwork (Series)

Post by nartana »

Thank you. I'll paste examples of the file paths I use in Terminal:

Command to fetch Series artwork (below) used to work, now it doesn't:

Code: Select all

filebot -script fn:artwork.tvdb /Volumes/Media/Series/ -non-strict --def maxAgeDays=30
Very similar format for fetching Movies artwork (below) works just fine:

Code: Select all

filebot -script fn:artwork.tmdb /Volumes/Media/Movies/ -non-strict --def maxAgeDays=30
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: New error with CLI fetch artwork (Series)

Post by rednoah »

I mean there's likely a specific file or folder inside your "/Volumes/Media/Series/" input folder on which the script crashes for some reason. If we knew what that file / folder / series name / nfo file / etc is, i.e. the culprit, then we could reproduce the issue and quickly find the root cause.
:idea: Please read the FAQ and How to Request Help.
nartana
Posts: 35
Joined: 02 May 2019, 22:28

Re: New error with CLI fetch artwork (Series)

Post by nartana »

Heard.

I used the FileBot "clean" script and then renamed 1TB of shows into a new directory.

The new Shows directories have no NFO files or images. I run Fetch Artwork CLI. This produces the same error.

Then, I copied the new directory with the newly-renamed shows to a local drive. I run the Fetch Artwork CLI, same error.

Finally, I sequentially deleted Show folders in order, and re-attempted the Fetch Artwork script each time. Error persists.

Meanwhile, the Fetch Artwork CLI works A+ (as always) on the Movies folder.

Let me know if there are any logs or screenshots I could provide. Otherwise I'll keep troubleshooting, and thanks for trying.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: New error with CLI fetch artwork (Series)

Post by rednoah »

nartana wrote: 26 Apr 2023, 17:15 Finally, I sequentially deleted Show folders in order, and re-attempted the Fetch Artwork script each time. Error persists.
So you're saying the error persists on an empty input folder? Or just random sampling? I would use "divide and conquer" to try and find the specific culprit for your specific set of files. Try the first half, if the problem persists try on half of that, repeat until you've narrowed it down to a specific series. Please post the file paths so we can recreate the files and run tests and reproduce the issue.


Test Case 1:

Code: Select all

$ filebot -find -d .
No Media/TV Shows

Code: Select all

$ filebot -script fn:artwork.tvdb "No Media"
Done ヾ(@⌒ー⌒@)ノ
:arrow: Works for empty folders.


Test Case 2:

Code: Select all

$ filebot -find .
Media/TV Shows/Alias {tmdb-2046}/Season 01/Alias - S01E01 - Truth Be Told.mp4

Code: Select all

filebot -script fn:artwork.tvdb "Media"
Media/TV Shows/Alias {tmdb-2046}/Season 01 => Lookup by Alias
Auto-Select [Alias] from [...]
Media/TV Shows/Alias {tmdb-2046}/Season 01 => Alias
Generate Series NFO: Alias [TheTVDB::75930]
Fetching Media/TV Shows/Alias {tmdb-2046}/clearart.png => [hdclearart, en, 3.0, http://assets.fanart.tv/fanart/tv/75930/hdclearart/alias-51bcfd1b24e30.png]
Fetching Media/TV Shows/Alias {tmdb-2046}/logo.png => [hdtvlogo, en, 4.0, http://assets.fanart.tv/fanart/tv/75930/hdtvlogo/alias-503c0da536819.png]
Fetching Media/TV Shows/Alias {tmdb-2046}/landscape.jpg => [tvthumb, en, 2.0, http://assets.fanart.tv/fanart/tv/75930/tvthumb/alias-4ead42d3e7c64.jpg]
Fetching Media/TV Shows/Alias {tmdb-2046}/Season 01/landscape.jpg => [seasonthumb/1, en, 0.0, http://assets.fanart.tv/fanart/tv/75930/seasonthumb/Alias.jpg]
:arrow: Works for a series folders.


:arrow: Presumably, there's an issue that only occurs with one specific TV Series for some reason, but we cannot efficiently debug the issue until you help us find out the specific file paths / series that cause the issue. That's why we really really need file paths as shown in the example test case above.




EDIT:

:idea: Unrelated to the topic at hand, note that the --def maxAgeDays parameter is not used by the artwork.* scripts and thus has no effect.




EDIT 2:

The issue may be related to [TheTVDB] Undefined Variable: Cannot invoke "String.equals(Object)" because "<parameter2>" is null that was fixed with a recent release. Please provide filebot -script fn:sysinfo as well so that we can confirm that you are using the latest release.
:idea: Please read the FAQ and How to Request Help.
nartana
Posts: 35
Joined: 02 May 2019, 22:28

Re: New error with CLI fetch artwork (Series)

Post by nartana »

Re. the --def maxAgeDays parameter, thanks for explaining how it's not used by the artwork script.

sysinfo output:

Code: Select all

FileBot 5.0.2 (r9722)
JNA Native: 6.1.4
MediaInfo: 22.12
Tools: fpcalc/1.5.1 7zz/21.06
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2023-04-14 (r896)
Groovy: 4.0.11
JRE: OpenJDK Runtime Environment 17.0.6
JVM: OpenJDK 64-Bit Server VM
CPU/MEM: 8 Core / 4.3 GB Max Memory / 17 MB Used Memory
OS: Mac OS X (aarch64)
HW: Darwin Erins-MBP.attlocal.net 22.5.0 Darwin Kernel Version 22.5.0: Sun Apr  2 19:22:28 PDT 2023; root:xnu-8796.120.31~10/RELEASE_ARM64_T6000 arm64
STORAGE: apfs [/] @ 43 GB | smbfs [/Volumes/Media] @ 7 TB
DATA: /Users/erinwilson/.filebot
Package: APP
License: FileBot License P36771611 (Valid-Until: 2023-05-12)
Done ヾ(@⌒ー⌒@)ノ
filebot -find -d . (Series.test-folder) output:

Code: Select all

/Volumes/Media/Series.test-folder/1899/1899 (Season 1)
/Volumes/Media/Series.test-folder/1899
/Volumes/Media/Series.test-folder
filebot -find . (Series.test-folder) output:

Code: Select all

/Volumes/Media/Series.test-folder/1899/1899 (Season 1)/1899 (S01E01) The Ship [FHD 2.5 mbps] EAC3 Atmos 5.1 (60mins).mkv
/Volumes/Media/Series.test-folder/1899/1899 (Season 1)/1899 (S01E02) The Boy [FHD 2.5 mbps] EAC3 Atmos 5.1 (58mins).mkv
/Volumes/Media/Series.test-folder/1899/1899 (Season 1)/1899 (S01E03) The Fog [FHD 2.3 mbps] EAC3 Atmos 5.1 (62mins).mkv
/Volumes/Media/Series.test-folder/1899/1899 (Season 1)/1899 (S01E04) The Fight [FHD 2.9 mbps] EAC3 Atmos 5.1 (50mins).mkv
/Volumes/Media/Series.test-folder/1899/1899 (Season 1)/1899 (S01E05) The Calling [FHD 2.7 mbps] EAC3 Atmos 5.1 (50mins).mkv
/Volumes/Media/Series.test-folder/1899/1899 (Season 1)/1899 (S01E06) The Pyramid [FHD 2.9 mbps] EAC3 Atmos 5.1 (54mins).mkv
/Volumes/Media/Series.test-folder/1899/1899 (Season 1)/1899 (S01E07) The Storm [FHD 3.3 mbps] EAC3 Atmos 5.1 (53mins).mkv
/Volumes/Media/Series.test-folder/1899/1899 (Season 1)/1899 (S01E08) The Key [FHD 2.9 mbps] EAC3 Atmos 5.1 (50mins).mkv
filebot -script fn:artwork.tvdb "/Volumes/Media/Series.test-folder/" output:

Code: Select all

/Volumes/Media/Series.test-folder/1899/1899 (Season 1) => Lookup by 384429
Undefined Variable: java.lang.NullPointerException: Cannot invoke "Object.toString()" because "<parameter2>" is null at net.filebot.cli.ScriptShellMethods::sortBySimilarity in __script_c6d61446bf265425d8536d81edac79ff_60e$_run_closure1::doCall in net.filebot.cli.ScriptShellMethods::eachMediaFolder
java.lang.NullPointerException: Cannot invoke "Object.toString()" because "<parameter2>" is null
	at net.filebot.cli.ScriptShellMethods.sortBySimilarity(Unknown Source)
	at __script_c6d61446bf265425d8536d81edac79ff_60e$_run_closure1.doCall(__script_c6d61446bf265425d8536d81edac79ff_60e:61)
	at net.filebot.cli.ScriptShellMethods.eachMediaFolder(Unknown Source)
	at __script_c6d61446bf265425d8536d81edac79ff_60e.run(__script_c6d61446bf265425d8536d81edac79ff_60e:13)
	at net.filebot.GroovyEngine.eval(Unknown Source)
	at net.filebot.cli.ScriptShell.evaluate(Unknown Source)
	at net.filebot.cli.ScriptShell.runScript(Unknown Source)
	at net.filebot.cli.ArgumentProcessor.runScript(Unknown Source)
	at net.filebot.cli.ArgumentProcessor.run(Unknown Source)
	at net.filebot.Main.main(Unknown Source)

Error (o_O)
filebot -script fn:artwork.tvdb "/Volumes/Media/Series.empty-folder/" output:

Code: Select all

Done ヾ(@⌒ー⌒@)ノ
(No errors on empty folder.)

Hoping I got what you asked for, most of which I should've provided without being asked (sorry).

I'm assuming it's a PICNIC problem, so I'm happy to try anything else you suggest.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: New error with CLI fetch artwork (Series)

Post by rednoah »

Thanks for the file paths. 1899 is indeed an unusual series name.


EDIT:

FileBot r9736 should fix the issue. Please try the latest revision:
viewtopic.php?t=1609
:idea: Please read the FAQ and How to Request Help.
nartana
Posts: 35
Joined: 02 May 2019, 22:28

Re: New error with CLI fetch artwork (Series)

Post by nartana »

I successfully uninstalled FileBot using Brew, in preparation to install the latest BETA.

SYSINFO:

Code: Select all

zsh: command not found: filebot 

CLI Install-BETA Attempt 1:

Code: Select all

installer -pkg /Users/erinwilson/Downloads/FileBot_5.0.2_arm64.pkg -target ~
Output 1:

Code: Select all

installer: Package name is FileBot 5.0.2
installer: Upgrading at base path /
installer: The upgrade was successful.
CLI Install-BETA Attempt 2:

Code: Select all

brew install /Users/erinwilson/Downloads/FileBot_5.0.2_arm64.pkg --force --no-quarantine 
Output 2:

Code: Select all

==> Downloading https://formulae.brew.sh/api/formula.jws.json

Error: undefined method `name' for nil:NilClass
Please report this issue:
  https://docs.brew.sh/Troubleshooting
/opt/homebrew/Library/Homebrew/exceptions.rb:270:in `block in initialize'
/opt/homebrew/Library/Homebrew/exceptions.rb:269:in `map'
/opt/homebrew/Library/Homebrew/exceptions.rb:269:in `initialize'
/opt/homebrew/Library/Homebrew/formulary.rb:803:in `new'
/opt/homebrew/Library/Homebrew/formulary.rb:803:in `loader_for'
/opt/homebrew/Library/Homebrew/formulary.rb:671:in `factory'
/opt/homebrew/Library/Homebrew/cli/parser.rb:645:in `block in formulae'
/opt/homebrew/Library/Homebrew/cli/parser.rb:641:in `map'
/opt/homebrew/Library/Homebrew/cli/parser.rb:641:in `formulae'
/opt/homebrew/Library/Homebrew/cli/parser.rb:317:in `parse'
/opt/homebrew/Library/Homebrew/cmd/install.rb:169:in `install'
/opt/homebrew/Library/Homebrew/brew.rb:94:in `<main>'
CLI Install-BETA Attempt 3:

Code: Select all

brew install https://raw.githubusercontent.com/filebot/plugins/master/brew/filebot-beta.rb --no-quarantine
Output 3:

Code: Select all

Error: Non-checksummed download of filebot-beta formula file from an arbitrary URL is unsupported! `brew extract` or `brew create` and `brew tap-new` to create a formula file in a tap on GitHub instead.
SYSINFO:

Code: Select all

zsh: command not found: filebot
Obviously, I've been unable to install the latest BETA via Terminal.

Without a successful Terminal installation and activation of the FileBot BETA, I have failed to utilize the fixes it contains for the original issue (Null pointer with Fetch Artwork).

What else can I try to get a CLI install of the FileBot BETA? I usually have no problem with CLI installs for the "latest" version, but I can't figure out how to CLI install the BETA...
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: New error with CLI fetch artwork (Series)

Post by rednoah »

AFAIK, you can't use brew to install the latest revision. Why not just download the *.pkg installer and double-click on it? The installer will install to /Applications and create the /usr/local/bin symlink. Maybe make sure to do brew uninstall filebot --zap first because macOS can do wonky things when you have the same application installed multiple times.
:idea: Please read the FAQ and How to Request Help.
nartana
Posts: 35
Joined: 02 May 2019, 22:28

Re: New error with CLI fetch artwork (Series)

Post by nartana »

Thanks for confirming brew can't install the latest beta.

With this in mind, I followed your instructions and removed all traces of FileBot, and then I reinstalled the beta (.pkg) using the GUI installer.

SYSINFO (post uninstall/reinstall)

Code: Select all

Current application revision (r9736) does not match cache revision (r9722): reset cache
Initialize new disk cache: /Users/erinwilson/.filebot/cache/0
FileBot 5.0.2 (r9736)
JNA Native: 6.1.4
MediaInfo: 22.12
Tools: fpcalc/1.5.1 7zz/21.06
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2023-04-28 (r901)
Groovy: 4.0.11
JRE: OpenJDK Runtime Environment 17.0.6
JVM: OpenJDK 64-Bit Server VM
CPU/MEM: 8 Core / 4.3 GB Max Memory / 113 MB Used Memory
OS: Mac OS X (aarch64)
HW: Darwin Erins-MBP.attlocal.net 22.5.0 Darwin Kernel Version 22.5.0: Sun Apr  2 19:22:28 PDT 2023; root:xnu-8796.120.31~10/RELEASE_ARM64_T6000 arm64
STORAGE: apfs [/] @ 46 GB | smbfs [/Volumes/Media] @ 7 TB
DATA: /Users/erinwilson/.filebot
Package: PKG
Activate License [P36771611] on [Sat Apr 29 09:51:25 EDT 2023]
License: FileBot License P36771611 (Valid-Until: 2023-05-12)
Done ヾ(@⌒ー⌒@)ノ
After confirming the version of the newly installed FileBot beta, I repeated the Fetch Artwork command (which previously failed).

Code: Select all

filebot -script fn:artwork.tvdb "/Volumes/Media/Series.test-folder/"
Fetch Artwork OUTPUT

Code: Select all

/Volumes/Media/Series.test-folder/1899/1899 (Season 1) => Lookup by 384429
/Volumes/Media/Series.test-folder/1899/1899 (Season 1) => 1899 [TheTVDB::384429]
Generate Series NFO: 1899 [TheTVDB::384429]
Fetching /Volumes/Media/Series.test-folder/1899/poster.jpg => [series/posters/680x1000, 100002.0, https://artworks.thetvdb.com/banners/v4/series/384429/posters/6215101fad42d.jpg]
Fetching /Volumes/Media/Series.test-folder/1899/banner.jpg => [series/banners/758x140, eng, 100001.0, https://artworks.thetvdb.com/banners/v4/series/384429/banners/63532743700d3.jpg]
Fetching /Volumes/Media/Series.test-folder/1899/fanart.jpg => [series/backgrounds/1920x1080, 100003.0, https://artworks.thetvdb.com/banners/v4/series/384429/backgrounds/626eeacb13c3d.jpg]
Fetching /Volumes/Media/Series.test-folder/1899/1899 (Season 1)/poster.jpg => [season/1/posters/680x1000, eng, 100001.0, https://artworks.thetvdb.com/banners/v4/season/1924016/posters/63771f2c9f1ec.jpg]
Fetching /Volumes/Media/Series.test-folder/1899/1899 (Season 1)/banner.jpg => [season/1/banners/758x140, eng, 100000.0, https://artworks.thetvdb.com/banners/v4/season/1924016/banners/63816a372585c.jpg]
Fetching /Volumes/Media/Series.test-folder/1899/clearart.png => [hdclearart, en, 4.0, http://assets.fanart.tv/fanart/tv/384429/hdclearart/1899-638373032a26f.png]
Fetching /Volumes/Media/Series.test-folder/1899/logo.png => [hdtvlogo, en, 0.0, http://assets.fanart.tv/fanart/tv/384429/hdtvlogo/1899-634d6dc0c1847.png]
Fetching /Volumes/Media/Series.test-folder/1899/landscape.jpg => [tvthumb, en, 0.0, http://assets.fanart.tv/fanart/tv/384429/tvthumb/1899-63787998d7740.jpg]
Fetching /Volumes/Media/Series.test-folder/1899/1899 (Season 1)/landscape.jpg => [seasonthumb/1, en, 0.0, http://assets.fanart.tv/fanart/tv/384429/seasonthumb/1899-638169cb164f5.jpg]
Done ヾ(@⌒ー⌒@)ノ
Success.

You've guided me to a solution, yet again. Thank you.
Post Reply