SongKong Jaikoz

SongKong and Jaikoz Music Tagger Community Forum

Cannot invoke "java.nio.file.Path.toString()"

Hi,

I’m encountering an issue when running a script in SongKong. The error message states:

Cannot invoke "java.nio.file.Path.toString()" because the return value of "java.nio.file.Path.getParent()" is null.

This happens even with a simple script that only assigns a value to a metadata field.

Could you provide guidance on what might be causing this error and how to resolve it?

Could you post the script please or even better run Create Support Files

Thanks, the issue is not actually the script itself, problem is when we try to create filepath vars for the song the base folder seems to be set to a root folder and the code cannot keep with this, I wil have to issue a fix - https://jthink.atlassian.net/browse/SONGKONG-2721

Although not entirely sure why you are encountering this issue and I am not.

25/02/2025 18.18.01:CET:Errors:addError:SEVERE: Adding Error:Scripter Error 1, /Volumes/MP3-A/NR_004 flac/01 - No. 21 Und die Kriegsknechte flochten (Evangelista, Chorus, Pilatus, Jesus) - Flac.flac, Cannot invoke "java.nio.file.Path.toString()" because the return value of "java.nio.file.Path.getParent()" is null
java.lang.NullPointerException: Cannot invoke "java.nio.file.Path.toString()" because the return value of "java.nio.file.Path.getParent()" is null
	at com.jthink.songkong.analyse.scripter.MetadataScriptFields.addFields(MetadataScriptFields.java:38)
	at com.jthink.songkong.analyse.scripter.ScriptProcessor.evaluateScript(ScriptProcessor.java:64)
	at com.jthink.songkong.analyse.analyser.task.songsaver.ScripterSongSaver.processSong(ScripterSongSaver.java:51)
	at com.jthink.songkong.analyse.analyser.task.songsaver.SongSaver.processSongs(SongSaver.java:805)
	at com.jthink.songkong.analyse.analyser.task.songsaver.SongSaver.saveSongsToFile(SongSaver.java:1552)
	at com.jthink.songkong.analyse.analyser.task.songsaver.SongSaver.saveChanges(SongSaver.java:270)
	at com.jthink.songkong.analyse.analyser.task.songsaver.SongSaver.call(SongSaver.java:239)
	at com.jthink.songkong.analyse.analyser.task.songsaver.SongSaver.call(SongSaver.java:93)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

I tested multiple scenarios:

  1. Moved files to different folders, including short and simple paths.
  2. Tested on an external and a local disk.
  3. Ran “Rename Files” successfully, but Scripter still fails.

Could there be limitations on metadata field sizes (e.g., string length in fields like “TITLE”) that might cause this?

No, its to do with the path as shown in the stack trace, maybe the errors only occurs on unix based machines (Mac/Linux/Docker) - the bulk of my testing is done on a Windows as this is my dev machine so maybe why I havent encoutered it.

Does this mean that Rename Files and Scripter are two independent programs within SongKong that do not share the same code? If they handle file paths differently, it could explain why one works while the other doesn’t.

Yes, sort of because in Rename Files you can choose the base folder subfolder split in Scripter you cannot. Anyway I think I have fixed it please just wait for the release.

Thanks for the update! Where and how can I download the fixed release once it’s available?

You are in luck, I have just updated the binaries if you download from Downloads page you will get the new SongKong 11.4 version but I havent updated the webpages yet so it still says SongKong 11.3.

It would be great if you could try it out and check it works before I fully announce the new release.

Good evening,

I have now tested multiple scenarios and have not been able to reproduce the error again. It seems that the update has resolved the issue. Thank you for the quick fix!