Library Node Editor Permission Error

Trying to set up a new rule for my music library on a Vero 4K+ running latest Feb update.

Open Library Node Editor and under “Artists” open “Add Rule”, none of the menu options will change from the current when selected, eg. selecting Artist and then attempting a change to Genre, will not be possible, highlighted field remains as “Artist”

Selecting “Browse for value” will result in an error being thrown. See below for log.

Have uninstalled, rebooted and reinstalled addon with no change. Tried exactly same thing on my regular Kodi PC install with no issues.

Any ideas please?

024-03-10 11:47:31.231 T:3012    error <general>: 
2024-03-10 11:47:31.231 T:3012    error <general>: PermissionError: [Errno 13] Permission denied: '/home/osmc/.kodi/userdata/library/music/artists.xml'
                                                   
2024-03-10 11:47:31.231 T:3012    error <general>: 
2024-03-10 11:47:41.833 T:3014    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'PermissionError'>
                                                   Error Contents: [Errno 13] Permission denied: '/home/osmc/.kodi/userdata/library/music/plugin.library.node.editor/temp.xml'
                                                   Traceback (most recent call last):
                                                     File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 762, in _get_writer
                                                       write = file_or_filename.write
                                                   AttributeError: 'str' object has no attribute 'write'
                                                   
                                                   During handling of the above exception, another exception occurred:
                                                   
                                                   Traceback (most recent call last):
                                                     File "/home/osmc/.kodi/addons/plugin.library.node.editor/plugin.py", line 6, in <module>
                                                       addon.run(sys.argv)
                                                     File "/home/osmc/.kodi/addons/plugin.library.node.editor/resources/lib/addon.py", line 834, in run
                                                       Main(params, ltype, RULE, ATTRIB, PATHRULE, ORDERBY)
                                                     File "/home/osmc/.kodi/addons/plugin.library.node.editor/resources/lib/addon.py", line 226, in __init__
                                                       self.RULE.browse( self.PARAMS[ "actionPath" ], self.PARAMS[ "rule" ], self.PARAMS[ "match" ], self.PARAMS[ "content" ] )
                                                     File "/home/osmc/.kodi/addons/plugin.library.node.editor/resources/lib/rules.py", line 934, in browse
                                                       self.createBrowseNode( content, "artists" )
                                                     File "/home/osmc/.kodi/addons/plugin.library.node.editor/resources/lib/rules.py", line 996, in createBrowseNode
                                                       tree.write( os.path.join( targetDir, "temp.xml" ), encoding="UTF-8" )
                                                     File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 732, in write
                                                       with _get_writer(file_or_filename, enc_lower) as write:
                                                     File "/usr/lib/python3.9/contextlib.py", line 117, in __enter__
                                                       return next(self.gen)
                                                     File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 768, in _get_writer
                                                       file = open(file_or_filename, "w", encoding=encoding,
                                                   PermissionError: [Errno 13] Permission denied: '/home/osmc/.kodi/userdata/library/music/plugin.library.node.editor/temp.xml'
                                                   -->End of Python script error report<--
                                                   

Looks like a bug. I can see the addon hasn’t been updated in a while…

Have you tried contacting the developer of the add-on?

Is it running the same version of Kodi?

I genuinely thought I was on same version across all installs, but PC Kodi is 20.4 while all OSMC devices are 20.3.

Forgive my ignorance but never contacted an addon dev before, looks like Unfledged / Team-Kodi. Just post on addons section of regular Kodi forum?

Reverted back to 20.3 Kodi on PC and issue does not exist.

I don’t see anything in the Kodi 20.4 release notes which looks remotely related to this. Odd.

Jeff

The error occurs because the file either doesn’t exist or there is a permissions problem. Try this as SSH as a non-privileged user:

mkdir -p /home/osmc/.kodi/userdata/library/music/plugin.library.node.editor/
touch /home/osmc/.kodi/userdata/library/music/plugin.library.node.editor/temp.xml'

Failed due to permissions as you suggested. Here’s the output…


osmc@OSMC-Client-2:~$ touch /home/osmc/.kodi/userdata/library/music/plugin.libra                                  ry.node.editor/temp.xml
touch: cannot touch '/home/osmc/.kodi/userdata/library/music/plugin.library.node                                  .editor/temp.xml': Permission denied

Did the mkdir command succeed?

No, failed when tried as non-privileged user. OK when using sudo. The dir did already exist however.

osmc@OSMC-Client-2:~$ mkdir -p /home/osmc/.kodi/userdata/library/music/plugin.library.node.editor/
mkdir: cannot create directory '/home/osmc/.kodi/userdata/library/music/plugin.library.node.editor/': Permission denied

All my node .xml is in “/home/osmc/.kodi/userdata/library/music” which I guess is expected.

systemctl stop mediacenter
sudo chown -R /home/osmc/.kodi/
systemctl start mediacenter

Try this – should fix any permissions

Getting the following after entering sudo chown, etc

chown: missing operand after ‘/home/osmc/.kodi/’

Sorry I’m not more Linux literate to be able to think my way out of it.

Figured it.

sudo chown -R osmc /home/osmc/.kodi/

LNE now working as expected. Thanks guys.