Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect Kodi to Nextcloud #11

Closed
ppoetsma opened this issue Dec 27, 2019 · 25 comments
Closed

Cannot connect Kodi to Nextcloud #11

ppoetsma opened this issue Dec 27, 2019 · 25 comments

Comments

@ppoetsma
Copy link

ppoetsma commented Dec 27, 2019

Hi,

I am struggling with this for some hours, but giving up now. I have Kodi 18.5 Leia (on Linux) and your plugin version 0.9.0.0 and it has to connect to NextCloud Music app version. 0.11.1. From Android using a subsonic client it works fine so API key etc exist.

This piece of logging turns up on every error in Kodi. Server side I see the requests in the Apache access log with response code 200.

`2019-12-27 15:31:47.048 T:140086079362816 NOTICE: https:///nextcloud/index.php/apps/music/ampache/server/xml.server.php?action=handshake&auth=&version=350001

2019-12-27 15:31:50.723 T:140085274056448 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.ValueError'>
Error Contents: invalid literal for int() with base 10: ''
Traceback (most recent call last):
File "/home/htpc/.kodi/addons/plugin.audio.ampache/default.py", line 691, in
get_items("artists", limit=None, useCacheArt=False)
File "/home/htpc/.kodi/addons/plugin.audio.ampache/default.py", line 416, in get_items
limit = int(ampache.getSetting(object_type))
ValueError: invalid literal for int() with base 10: ''
-->End of Python script error report<--

2019-12-27 15:31:50.779 T:140086079362816 ERROR: GetDirectory - Error getting plugin://plugin.audio.ampache/?mode=1&name=Artists%20()&object_id=None

2019-12-27 15:31:50.795 T:140086970316992 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.ampache/?mode=1&name=Artists%20()&object_id=None) failed

2019-12-27 15:31:51.465 T:140085274056448 NOTICE: https:///nextcloud/index.php/apps/music/ampache/server/xml.server.php?action=handshake&auth=&version=350001
`

I have tried API version 350001 and 400001, also downgrading to the previous version of your plugin didn't fix it.

Do you have any hint?

Kind regards
Paul

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

It seems to connect, but it appears to not find any artists, with my nextcloud it works, i will do some tests and i will release a fix

@ppoetsma
Copy link
Author

If you need more details let me know. Btw it is Nextcloud 17.01. I will see if I can upgrade to 17.02 asap, maybe that helps?

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

I have your exact version of nextcloud and in my version it works.

I have reworked the error messages to better test the connection, can you please try the development version? You can download the plugin here: https://github.com/lusum/ampache-xbmc-plugin/archive/master.zip

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

Can you post the results of the development version?

@ppoetsma
Copy link
Author

Thanks, working on it.

@ppoetsma
Copy link
Author

ppoetsma commented Dec 28, 2019

It does not start at all, gives an error when I start it:

2019-12-28 11:00:02.922 T:139750905181952   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: cannot concatenate 'str' and 'NoneType' objects
                                            Traceback (most recent call last):
                                              File "/home/htpc/.kodi/addons/plugin.audio.ampache/default.py", line 561, in <module>
                                                addDir("Artists (" + tempData["artists"]+ ")",None,1,"DefaultFolder.png")
                                            TypeError: cannot concatenate 'str' and 'NoneType' objects
                                            -->End of Python script error report<--
2019-12-28 11:00:02.992 T:139750358898432   ERROR: GetDirectory - Error getting plugin://plugin.audio.ampache/
2019-12-28 11:00:02.999 T:139751621429440   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.ampache/) failed

@ppoetsma
Copy link
Author

This the debug log. I see that it picks Python 2.7, is that as expected?

2019-12-28 11:04:43.650 T:139751621429440   DEBUG: ------ Window Deinit (AddonBrowser.xml) ------
2019-12-28 11:04:43.651 T:139751621429440   DEBUG: FreeVisualisation() done
2019-12-28 11:04:43.651 T:139751621429440   DEBUG: ------ Window Deinit (DialogAddonInfo.xml) ------
2019-12-28 11:04:43.653 T:139751621429440   DEBUG: ------ Window Init (MyMusicNav.xml) ------
2019-12-28 11:04:43.654 T:139751621429440   DEBUG: CGUIMediaWindow::GetDirectory (addons://sources/audio)
2019-12-28 11:04:43.654 T:139751621429440   DEBUG:   ParentPath = [addons://sources/audio]
2019-12-28 11:04:43.672 T:139751621429440   DEBUG: RetrieveMusicInfo() took 0 msec
2019-12-28 11:04:43.679 T:139750375683840   DEBUG: Thread BackgroundLoader start, auto delete: false
2019-12-28 11:04:43.684 T:139750367291136   DEBUG: GetImageHash - unable to stat url /home/htpc/.kodi/addons/plugin.audio.ampache/fanart.jpg
2019-12-28 11:04:43.687 T:139750367291136   DEBUG: GetImageHash - unable to stat url /home/htpc/.kodi/addons/plugin.audio.ampache/icon.png
2019-12-28 11:04:43.690 T:139750375683840   DEBUG: Thread BackgroundLoader 139750375683840 terminating
2019-12-28 11:04:47.146 T:139751621429440   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0
2019-12-28 11:04:47.293 T:139751621429440   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x0000, modifier: 0x0
2019-12-28 11:04:47.293 T:139751621429440   DEBUG: HandleKey: return (0xf00d) pressed, action is Select
2019-12-28 11:04:47.294 T:139751621429440   DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.audio.ampache/)
2019-12-28 11:04:47.294 T:139751621429440   DEBUG:   ParentPath = [addons://sources/audio]
2019-12-28 11:04:47.295 T:139750864967424   DEBUG: Thread waiting start, auto delete: false
2019-12-28 11:04:47.299 T:139750881752832   DEBUG: CAddonDatabase::SetLastUsed[plugin.audio.ampache] took 6 ms
2019-12-28 11:04:47.300 T:139750864967424   DEBUG: StartScript - calling plugin Ampache('plugin://plugin.audio.ampache/','3','','resume:false')
2019-12-28 11:04:47.301 T:139750375683840   DEBUG: Thread LanguageInvoker start, auto delete: false
2019-12-28 11:04:47.301 T:139750375683840    INFO: initializing python engine.
2019-12-28 11:04:47.301 T:139750375683840   DEBUG: CPythonInvoker(7, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): start processing
2019-12-28 11:04:47.395 T:139751621429440   DEBUG: ------ Window Init (DialogBusy.xml) ------
2019-12-28 11:04:47.556 T:139750375683840   DEBUG: -->Python Interpreter Initialized<--
2019-12-28 11:04:47.556 T:139750375683840   DEBUG: CPythonInvoker(7, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): the source file to load is "/home/htpc/.kodi/addons/plugin.audio.ampache/default.py"
2019-12-28 11:04:47.556 T:139750375683840   DEBUG: CPythonInvoker(7, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): setting the Python path to /home/htpc/.kodi/addons/plugin.audio.ampache:/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0
2019-12-28 11:04:47.557 T:139750375683840   DEBUG: CPythonInvoker(7, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): entering source directory /home/htpc/.kodi/addons/plugin.audio.ampache
2019-12-28 11:04:47.557 T:139750375683840   DEBUG: CPythonInvoker(7, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): instantiating addon using automatically obtained id of "plugin.audio.ampache" dependent on version 0.0.0 of the xbmc.python api
2019-12-28 11:04:48.041 T:139750375683840   DEBUG: AmpachePlugin::get_params
2019-12-28 11:04:48.043 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: loading setting definitions
2019-12-28 11:04:48.043 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: trying to load setting definitions from old format...
2019-12-28 11:04:48.044 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: loading setting values
2019-12-28 11:04:48.045 T:139750375683840   DEBUG: CSettingsManager: requested setting (add) was not found.
2019-12-28 11:04:48.045 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting add. Creating a setting on-the-fly...
2019-12-28 11:04:48.045 T:139750375683840   DEBUG: CSettingsManager: requested setting (albums) was not found.
2019-12-28 11:04:48.045 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting albums. Creating a setting on-the-fly...
2019-12-28 11:04:48.045 T:139750375683840   DEBUG: CSettingsManager: requested setting (artists) was not found.
2019-12-28 11:04:48.045 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting artists. Creating a setting on-the-fly...
2019-12-28 11:04:48.046 T:139750375683840   DEBUG: CSettingsManager: requested setting (playlists) was not found.
2019-12-28 11:04:48.046 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting playlists. Creating a setting on-the-fly...
2019-12-28 11:04:48.046 T:139750375683840   DEBUG: CSettingsManager: requested setting (songs) was not found.
2019-12-28 11:04:48.046 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting songs. Creating a setting on-the-fly...
2019-12-28 11:04:48.046 T:139750375683840  NOTICE: https://.....nl/nextcloud/index.php/apps/music/ampache/server/xml.server.php?action=handshake&auth=...&version=350001
2019-12-28 11:04:48.178 T:139750375683840   DEBUG: AmpachePlugin::handle_request: ssl
2019-12-28 11:04:48.178 T:139750375683840   DEBUG: AmpachePlugin::AMPACHECONNECT ConnectionOk
2019-12-28 11:04:48.214 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: loading setting definitions
2019-12-28 11:04:48.214 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: trying to load setting definitions from old format...
2019-12-28 11:04:48.215 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: loading setting values
2019-12-28 11:04:48.215 T:139750375683840   DEBUG: CSettingsManager: requested setting (add) was not found.
2019-12-28 11:04:48.215 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting add. Creating a setting on-the-fly...
2019-12-28 11:04:48.215 T:139750375683840   DEBUG: CSettingsManager: requested setting (albums) was not found.
2019-12-28 11:04:48.215 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting albums. Creating a setting on-the-fly...
2019-12-28 11:04:48.216 T:139750375683840   DEBUG: CSettingsManager: requested setting (artists) was not found.
2019-12-28 11:04:48.216 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting artists. Creating a setting on-the-fly...
2019-12-28 11:04:48.216 T:139750375683840   DEBUG: CSettingsManager: requested setting (playlists) was not found.
2019-12-28 11:04:48.216 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting playlists. Creating a setting on-the-fly...
2019-12-28 11:04:48.216 T:139750375683840   DEBUG: CSettingsManager: requested setting (songs) was not found.
2019-12-28 11:04:48.216 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting songs. Creating a setting on-the-fly...
2019-12-28 11:04:48.218 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: loading setting definitions
2019-12-28 11:04:48.218 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: trying to load setting definitions from old format...
2019-12-28 11:04:48.219 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: loading setting values
2019-12-28 11:04:48.220 T:139750375683840   DEBUG: CSettingsManager: requested setting (add) was not found.
2019-12-28 11:04:48.220 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting add. Creating a setting on-the-fly...
2019-12-28 11:04:48.220 T:139750375683840   DEBUG: CSettingsManager: requested setting (albums) was not found.
2019-12-28 11:04:48.220 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting albums. Creating a setting on-the-fly...
2019-12-28 11:04:48.220 T:139750375683840   DEBUG: CSettingsManager: requested setting (artists) was not found.
2019-12-28 11:04:48.220 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting artists. Creating a setting on-the-fly...
2019-12-28 11:04:48.220 T:139750375683840   DEBUG: CSettingsManager: requested setting (playlists) was not found.
2019-12-28 11:04:48.220 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting playlists. Creating a setting on-the-fly...
2019-12-28 11:04:48.221 T:139750375683840   DEBUG: CSettingsManager: requested setting (songs) was not found.
2019-12-28 11:04:48.221 T:139750375683840   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting songs. Creating a setting on-the-fly...
2019-12-28 11:04:48.222 T:139750375683840   DEBUG: AmpachePlugin::addDir name Search...
2019-12-28 11:04:48.241 T:139750375683840   DEBUG: AmpachePlugin::addDir url plugin://plugin.audio.ampache/?object_id=None&mode=4&name=Search...
2019-12-28 11:04:48.241 T:139750375683840   DEBUG: AmpachePlugin::addDir name Recent...
2019-12-28 11:04:48.241 T:139750375683840   DEBUG: AmpachePlugin::addDir url plugin://plugin.audio.ampache/?object_id=None&mode=5&name=Recent...
2019-12-28 11:04:48.242 T:139750375683840   DEBUG: AmpachePlugin::addDir name Random...
2019-12-28 11:04:48.242 T:139750375683840   DEBUG: AmpachePlugin::addDir url plugin://plugin.audio.ampache/?object_id=None&mode=7&name=Random...
2019-12-28 11:04:48.242 T:139750375683840   DEBUG: AmpachePlugin::addDir name Various...
2019-12-28 11:04:48.243 T:139750375683840   DEBUG: AmpachePlugin::addDir url plugin://plugin.audio.ampache/?object_id=None&mode=23&name=Various...
2019-12-28 11:04:48.244 T:139750375683840   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: cannot concatenate 'str' and 'NoneType' objects
                                            Traceback (most recent call last):
                                              File "/home/htpc/.kodi/addons/plugin.audio.ampache/default.py", line 561, in <module>
                                                addDir("Artists (" + tempData["artists"]+ ")",None,1,"DefaultFolder.png")
                                            TypeError: cannot concatenate 'str' and 'NoneType' objects
                                            -->End of Python script error report<--
2019-12-28 11:04:48.245 T:139750375683840   DEBUG: onExecutionDone(7, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py)
2019-12-28 11:04:48.253 T:139751621429440   DEBUG: ------ Window Init (DialogNotification.xml) ------
2019-12-28 11:04:48.292 T:139750375683840    INFO: Python interpreter stopped
2019-12-28 11:04:48.293 T:139750375683840   DEBUG: Thread LanguageInvoker 139750375683840 terminating
2019-12-28 11:04:48.307 T:139750864967424   ERROR: GetDirectory - Error getting plugin://plugin.audio.ampache/
2019-12-28 11:04:48.307 T:139750864967424   DEBUG: Thread waiting 139750864967424 terminating
2019-12-28 11:04:48.319 T:139751621429440   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
2019-12-28 11:04:48.320 T:139751621429440   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.ampache/) failed
2019-12-28 11:04:48.320 T:139751621429440   DEBUG: CGUIMediaWindow::GetDirectory (addons://sources/audio)
2019-12-28 11:04:48.320 T:139751621429440   DEBUG:   ParentPath = []
2019-12-28 11:04:48.321 T:139750864967424   DEBUG: Thread waiting start, auto delete: false
2019-12-28 11:04:48.333 T:139750864967424   DEBUG: Thread waiting 139750864967424 terminating
2019-12-28 11:04:48.337 T:139751621429440   DEBUG: RetrieveMusicInfo() took 0 msec
2019-12-28 11:04:48.344 T:139750864967424   DEBUG: Thread BackgroundLoader start, auto delete: false
2019-12-28 11:04:48.349 T:139750864967424   DEBUG: Thread BackgroundLoader 139750864967424 terminating
2019-12-28 11:04:49.993 T:139751621429440   DEBUG: Keyboard: scancode: 0x09, sym: 0x001b, unicode: 0x001b, modifier: 0x0
2019-12-28 11:04:50.120 T:139751621429440   DEBUG: Keyboard: scancode: 0x09, sym: 0x001b, unicode: 0x0000, modifier: 0x0
2019-12-28 11:04:50.120 T:139751621429440   DEBUG: HandleKey: escape (0xf01b) pressed, action is PreviousMenu
2019-12-28 11:04:50.122 T:139751621429440   DEBUG: CGUIWindowManager::PreviousWindow: Deactivate
2019-12-28 11:04:50.434 T:139751621429440   DEBUG: ------ Window Deinit (MyMusicNav.xml) ------

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

I need the log before this point, like connection error or connection ok, from CPythonInvoker(55, .kodi/addons/plugin.audio.ampache/default.py): start processing

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

ok, python 2.7 is the default

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

The plugin connect, but the server don't seems to send anything.

DEBUG: AmpachePlugin::AMPACHECONNECT ConnectionOk

I have updated the master, adding a debug to show what the server send on connecting, can you update to the new master ( same address for the zip ) and post the log?

@ppoetsma
Copy link
Author

Yes, one moment

@ppoetsma
Copy link
Author

Interesting, http code 401

2019-12-28 11:27:20.813 T:139751621429440   DEBUG: CGUIMediaWindow::GetDirectory (plugin://plugin.audio.ampache/)
2019-12-28 11:27:20.813 T:139751621429440   DEBUG:   ParentPath = [addons://sources/audio]
2019-12-28 11:27:20.814 T:139749956241152   DEBUG: Thread waiting start, auto delete: false
2019-12-28 11:27:20.818 T:139750367291136   DEBUG: CAddonDatabase::SetLastUsed[plugin.audio.ampache] took 5 ms
2019-12-28 11:27:20.818 T:139749956241152   DEBUG: StartScript - calling plugin Ampache('plugin://plugin.audio.ampache/','4','','resume:false')
2019-12-28 11:27:20.819 T:139750358898432   DEBUG: Thread LanguageInvoker start, auto delete: false
2019-12-28 11:27:20.819 T:139750358898432    INFO: initializing python engine.
2019-12-28 11:27:20.819 T:139750358898432   DEBUG: CPythonInvoker(9, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): start processing
2019-12-28 11:27:20.914 T:139751621429440   DEBUG: ------ Window Init (DialogBusy.xml) ------
2019-12-28 11:27:21.088 T:139750358898432   DEBUG: -->Python Interpreter Initialized<--
2019-12-28 11:27:21.088 T:139750358898432   DEBUG: CPythonInvoker(9, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): the source file to load is "/home/htpc/.kodi/addons/plugin.audio.ampache/default.py"
2019-12-28 11:27:21.088 T:139750358898432   DEBUG: CPythonInvoker(9, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): setting the Python path to /home/htpc/.kodi/addons/plugin.audio.ampache:/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0
2019-12-28 11:27:21.089 T:139750358898432   DEBUG: CPythonInvoker(9, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): entering source directory /home/htpc/.kodi/addons/plugin.audio.ampache
2019-12-28 11:27:21.089 T:139750358898432   DEBUG: CPythonInvoker(9, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py): instantiating addon using automatically obtained id of "plugin.audio.ampache" dependent on version 0.0.0 of the xbmc.python api
2019-12-28 11:27:21.639 T:139750358898432   DEBUG: AmpachePlugin::get_params
2019-12-28 11:27:21.641 T:139750358898432   DEBUG: CAddonSettings[plugin.audio.ampache]: loading setting definitions
2019-12-28 11:27:21.641 T:139750358898432   DEBUG: CAddonSettings[plugin.audio.ampache]: trying to load setting definitions from old format...
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CAddonSettings[plugin.audio.ampache]: loading setting values
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CSettingsManager: requested setting (add) was not found.
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting add. Creating a setting on-the-fly...
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CSettingsManager: requested setting (albums) was not found.
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting albums. Creating a setting on-the-fly...
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CSettingsManager: requested setting (artists) was not found.
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting artists. Creating a setting on-the-fly...
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CSettingsManager: requested setting (playlists) was not found.
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting playlists. Creating a setting on-the-fly...
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CSettingsManager: requested setting (songs) was not found.
2019-12-28 11:27:21.642 T:139750358898432   DEBUG: CAddonSettings[plugin.audio.ampache]: failed to find definition for setting songs. Creating a setting on-the-fly...
2019-12-28 11:27:21.642 T:139750358898432  NOTICE: https://....nl/nextcloud/index.php/apps/music/ampache/server/xml.server.php?action=handshake&auth=....&version=350001
2019-12-28 11:27:21.801 T:139750358898432   DEBUG: AmpachePlugin::handle_request: ssl
2019-12-28 11:27:21.801 T:139750358898432   DEBUG: AmpachePlugin::AMPACHECONNECT: contents <?xml version="1.0" encoding="UTF-8" standalone="yes"?><root>
                                                <error code='401'>Invalid Login - cannot parse time</error>
                                            </root>
2019-12-28 11:27:21.801 T:139750358898432   DEBUG: AmpachePlugin::AMPACHECONNECT ConnectionOk
2019-12-28 11:27:21.830 T:139750358898432   DEBUG: AmpachePlugin::addDir name Search... url plugin://plugin.audio.ampache/?object_id=None&mode=4&name=Search...
2019-12-28 11:27:21.831 T:139750358898432   DEBUG: AmpachePlugin::addDir name Recent... url plugin://plugin.audio.ampache/?object_id=None&mode=5&name=Recent...
2019-12-28 11:27:21.831 T:139750358898432   DEBUG: AmpachePlugin::addDir name Random... url plugin://plugin.audio.ampache/?object_id=None&mode=7&name=Random...
2019-12-28 11:27:21.831 T:139750358898432   DEBUG: AmpachePlugin::addDir name Various... url plugin://plugin.audio.ampache/?object_id=None&mode=23&name=Various...
2019-12-28 11:27:21.833 T:139750358898432   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.KeyError'>
                                            Error Contents: 'artists'
                                            Traceback (most recent call last):
                                              File "/home/htpc/.kodi/addons/plugin.audio.ampache/default.py", line 560, in <module>
                                                addDir("Artists (" + tempData["artists"]+ ")",None,1,"DefaultFolder.png")
                                            KeyError: 'artists'
                                            -->End of Python script error report<--
2019-12-28 11:27:21.835 T:139750358898432   DEBUG: onExecutionDone(9, /home/htpc/.kodi/addons/plugin.audio.ampache/default.py)
2019-12-28 11:27:21.842 T:139751621429440   DEBUG: ------ Window Init (DialogNotification.xml) ------
2019-12-28 11:27:21.876 T:139750358898432    INFO: Python interpreter stopped
2019-12-28 11:27:21.876 T:139750358898432   DEBUG: Thread LanguageInvoker 139750358898432 terminating
2019-12-28 11:27:21.885 T:139749956241152   ERROR: GetDirectory - Error getting plugin://plugin.audio.ampache/
2019-12-28 11:27:21.885 T:139749956241152   DEBUG: Thread waiting 139749956241152 terminating
2019-12-28 11:27:21.894 T:139751621429440   DEBUG: ------ Window Deinit (DialogBusy.xml) ------
2019-12-28 11:27:21.895 T:139751621429440   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.audio.ampache/) failed
2019-12-28 11:27:21.895 T:139751621429440   DEBUG: CGUIMediaWindow::GetDirectory (addons://sources/audio)
2019-12-28 11:27:21.895 T:139751621429440   DEBUG:   ParentPath = [addons://sources/]
2019-12-28 11:27:21.895 T:139749956241152   DEBUG: Thread waiting start, auto delete: false
2019-12-28 11:27:21.908 T:139749956241152   DEBUG: Thread waiting 139749956241152 terminating
2019-12-28 11:27:21.913 T:139751621429440   DEBUG: RetrieveMusicInfo() took 0 msec
2019-12-28 11:27:21.920 T:139749956241152   DEBUG: Thread BackgroundLoader start, auto delete: false
2019-12-28 11:27:21.925 T:139749956241152   DEBUG: Thread BackgroundLoader 139749956241152 terminating
2019-12-28 11:27:27.597 T:139751621429440   DEBUG: ------ Window Deinit (DialogNotification.xml) ------

@ppoetsma
Copy link
Author

ppoetsma commented Dec 28, 2019

Ampache expects a timestamp in the handshake request? See Nextcloud "controller/ampachecontroller.php" line 156.

See also https://github.com/ampache/ampache/wiki/XML-API

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

Ampache require a timestamp, i have found a bug on owncloud very similiar to your

owncloud/music#60

Try to control if the time on server and client are the same, it should be possible that they are different and it introduce a bug.
Btw, i have introduced a bug in the last development version, so i have to correct it, if timestamp is ok, use 0.9.0.0

@ppoetsma
Copy link
Author

Timestamps are identical, at least <1 sec difference. Both use NTP.

I will run curl manually from my Kodi system to Ampache and see what the responses are.

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

I have to fix the bug introduced and after i will check the time problem.

It is weird that the same servers have differents problem. I use the generated api-key? Maybe you use login and password? Or your api-key is expired?

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

Ok the bug introduced is fixed, now i control your time bug

You can use the development version now

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

2019-12-28 11:27:21.642 T:139750358898432 NOTICE: https://....nl/nextcloud/index.php/apps/music/ampache/server/xml.server.php?action=handshake&auth=....&version=350001

Why don't appear timestamp between auth and version? I will check in the plugin.

The correct one should be:

https://....nl/nextcloud/index.php/apps/music/ampache/server/xml.server.php?action=handshake&auth=....&timestamp=....&version=350001

@ppoetsma
Copy link
Author

ppoetsma commented Dec 28, 2019 via email

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

Maybe i have found the problem, api_key url sent lack timestamp and i use login/password, now i try with api_key with and without timestamp

@lusum
Copy link
Owner

lusum commented Dec 28, 2019

Found the bug: in settings you have to unckeck use api key. Nextcloud use username password. They are generated, but not username and password. I will issue a warning dialog in code. Try it and tell me the results.

I have updated the development version, a little more robust and a warning message, try it, if it works, i will close the bug.

@ppoetsma
Copy link
Author

You found what I found: username + password instead of API key. The Nextcloud Music addon gave me the impression that it generates an API key. Yesterday, when I created a 2nd key while troubleshooting this problem, I saw that it is a username and password. I put that into your Kodi Ampache addon configuration and it works. And the requests contain a timestamp too.

I see you updated the readme. Great and thanks!

I will test the last development version now.

@ppoetsma
Copy link
Author

It works fine.

Two questions:

  1. Are you allowed to use the Ampache logo as the addon icon?
  2. Does Ampache support showing cover art embedded in the mp3 file?

@lusum
Copy link
Owner

lusum commented Jan 5, 2020

Ok, perfect.

Are you allowed to use the Ampache logo as the addon icon?

The main ampache developer want to include this addon to the official repository, so, i'm not allowed, but i never asked for it.

Does Ampache support showing cover art embedded in the mp3 file?

Yes, i have some albums with cover art embedded and it works fine

@ppoetsma
Copy link
Author

ppoetsma commented Jan 5, 2020

Then I will check the cover art. Thank for helping, I will close this issue.

@ppoetsma ppoetsma closed this as completed Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants