PlexKodiConnect icon indicating copy to clipboard operation
PlexKodiConnect copied to clipboard

PKC unable to save settings and starts setup wizard and Plex.tv linking in a loop

Open BerziOnline opened this issue 3 years ago • 10 comments

My Kodi is running on a NVIDIA Shield Pro with PKC for years. The plex server is in the same LAN running on the newest version. Server is reachable with PCs and Plex App without any issues.

Out of a sudden I have this problem every few months again, so I'm quite sure it has anything to do with PKC. Starting Kodi leads to the initial setup wizard and wants me to link plex. So I do. After that the setup wizard starts and I answer everything. The last question (if I want to go to the PKC settings now) leads with YES to empty settings and with NO the kodi app restarts and after the start the setup wizard starts again... Here is the behaviour in a video: https://web.tresorit.com/l/HRlHb#7u0rRcJal3c8nFmzsjvkTg

So what I did in the last months over and over again was

  • going back to the original skin
  • following this guide in deleting all databases (https://github.com/croneter/PlexKodiConnect/issues/1489)
  • deleting and re-installing PKC
  • deleting cache of Kodi itself
  • restarting the NVIDIA Shield

But it seems there is a hard problem in saving or reading the PKC settings. In the last seconds of my video you can see the "empty settings" where I'm not able to click anything. It's also the same if I try to reach the settings not directly after the setup wizard. The log shows also errors in loading the settings.xml: https://paste.kodi.tv/ijenikavij

How did I fixed it in the past? I really don't know... I went the steps above through over and over again and sometimes suddenly the settings are there and I can type in the plex server IP. After that everything is working like a charm.

Until a few months later... the game starts again :-/

I could live with that problem, if I knew how to fix it with a structured workflow :-) Even better: The reason for the problem could be fixed :D

Thanks a lot for this great plugin!

BerziOnline avatar Dec 07 '21 18:12 BerziOnline

I'm very sorry for that bug. I'm aware of this bug, but haven't figured out how to solve it.

Seems like the PKC settings file gets somehow corrupted. New settings won't be saved.

Have you tried deleting PKC's settings.xml?

croneter avatar Dec 07 '21 19:12 croneter

Other addons are also suffering of Kodi's very poor handling of add-on settings, see e.g. https://www.reddit.com/r/Addons4Kodi/comments/okk2vk/seren_213/

croneter avatar Dec 08 '21 07:12 croneter

Do make a backup of PKC's settings.xml for this happening again in the future. I will never able to guarantee it not happening again 😞

croneter avatar Dec 08 '21 07:12 croneter

Solution

Jupp, having had a look at your log file, your PKC settings.xml has been corrupted:

ERROR <general>: CAddon[plugin.video.plexkodiconnect]: failed to load addon settings from special://profile/addon_data/plugin.video.plexkodiconnect/settings.xml

Please just exit Kodi, then delete addon_data/plugin.video.plexkodiconnect/settings.xml in your Kodi userdata folder

⚠️ To make your life easier, make sure you have a Kodi-backup for these cases... ⚠️

  • Prepare for disaster:
    • Install PKC as usual, get everything up and running
    • Make a backup of PlexKodiConnect settings.xml (in the folder addon_data/plugin.video.plexkodiconnect in the Kodi userdata folder)
  • Disaster recovery:
    • Quit Kodi
    • Delete PKC's existing settings.xml, copy your backup back in
    • Restart Kodi

croneter avatar Dec 08 '21 07:12 croneter

Thanks a lot for your quick response. Deleting the settings.xml solved it for 50%, but not completely. Also I'm quite sure it will happen in a few weeks to months again, because it did in the past often.

But thanks for your help, I think I have at least a workaround now for a fix if the bug has happened and the setup dialogue starts this kind of loop suddenly. Before I list the steps let me explain what NOT helped for me, to save a little troubleshooting time for others:

  • Disabling/Enabling PKC with an Reboot between
  • Deinstalling PKC without deleting data and re-install again
  • Giving different answers in the setup dialogue
  • Deleting the databases as described in this thread: https://github.com/croneter/PlexKodiConnect/issues/1489
  • Deleting the whole KODI data (I think you can avoid setup your whole KODI new by that point :-) )

So my workaround which has worked for me looks like this:

  • Going to the original skin
  • Deinstall PKC
  • Important: Answer the question for deleting PKC data ans settings with yes
  • Restart KODI and in-between delete the cache of the app
  • Installing PKC again
  • Link Plex and go through the setup dialogue
  • Important: Answer the last question ("...if you want to go to the settings...?") with no. Otherwise my settings were there (first success, yeah!), but when I clicked the field to type in the plex server IP, the input popup didn't open.
  • After your "no"-answer KODI will be restarted or at least in my case a shutdown of the app happens and you can start it manually again
  • Now there shouldn't be another setup dialogue again and you can go directly to the PKC settings to set the plex server IP
  • Everything should work fine again

This is a workaround for this kind of bug, but it doesn't solve the bug itself. But I can live with that :-)

About the tip just deleting the settings.xml: I did that and I saw before that the existing one had just 0 Bytes. After deleting the settings.xml I saw that it now had a few bytes, so the app was able again to write into it. But then I had this issue to not being able to type in the plex server IP. So I decided to choose the workaround above. To be quiet honest I think it could be enough to make out of the points "uninstall + deleting data + install" just one point in deleting the settings.xml and then go on with my workaround. But the effect is the same and in this little unhealthy felt environment I felt a little bit more cleaner to do the re-install process. Also because it has no negative comfort effects, because in both cases I have to setup the PKC settings again in the end.

BerziOnline avatar Dec 09 '21 07:12 BerziOnline

To be quiet honest I think it could be enough to make out of the points "uninstall + deleting data + install" just one point in deleting the settings.xml and then go on with my workaround

Why don't you do just this, much simpler and no need to re-install PKC

  • Prepare for disaster:
    • Install PKC as usual, get everything up and running
    • Make a backup of PlexKodiConnect settings.xml (in the folder addon_data/plugin.video.plexkodiconnect in the Kodi userdata folder)
  • Disaster recovery:
    • Quit Kodi
    • Delete PKC's existing settings.xml, copy your backup back in
    • Restart Kodi

croneter avatar Dec 09 '21 08:12 croneter

Also, if applicable to your situation, you might want to get a new SD card. Might help here, too

croneter avatar Dec 09 '21 08:12 croneter

Copying the backup of the settings.xml over the actual settings is a good idea :D Will it work with an old settings.xml for futured PKC versions as well? I was a little feared to hardcopy the settings.xml in future everytime the bug happens without considering whether there are maybe new settings available in new PKC versions or not. Or is my fear unfounded?

SD card is not applicable to my situation, because it's just the internal storage of the NVIDIA Shield, but thanks for every tip.

BerziOnline avatar Dec 09 '21 13:12 BerziOnline

Will it work with an old settings.xml for futured PKC versions as well?

Yes, no worries at all! If something changes, PKC won't blow up in your face 😉

SD card is not applicable to my situation, because it's just the internal storage of the NVIDIA Shield, but thanks for every tip.

To narrow down the issue: Are you using several PKC widgets simultaneously, by any chance?

croneter avatar Dec 09 '21 15:12 croneter

Yes, no worries at all! If something changes, PKC won't blow up in your face wink

Alright, thank you for optimizing the workaround :)

To narrow down the issue: Are you using several PKC widgets simultaneously, by any chance?

I use the Amber skin with PKC and there are just the following addons active

  • PKC Helper Movies
  • PKC Helper TV Shows

BerziOnline avatar Dec 15 '21 12:12 BerziOnline