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

Violation of UNIQUE constraint during sync #1480

Closed
YoBii opened this issue May 22, 2021 · 3 comments
Closed

Violation of UNIQUE constraint during sync #1480

YoBii opened this issue May 22, 2021 · 3 comments

Comments

@YoBii
Copy link

YoBii commented May 22, 2021

Describe the bug

I was setting up a fresh installation of Kodi Matrix with PKC. During initial sync one item causes the sync to halt due to a violation of UNIQUE constraint when inserting into DB. I can reproduce the issue. Sync will always stall at this specific item.
I am uncertain what is the column with the UNIQUE constraint here. I guess country_link.media_id..?
Please tell me what information you need. Truncated log below

Log

(I tried activating debug logging but it didn't include more info when the error occurs)

2021-05-22 18:54:06.080 T:22820    INFO <general>: PLEX.movies: ADD movie plex_id: 87957 - Sherlock Holmes - Spiel im Schatten
2021-05-22 18:54:06.091 T:22820   ERROR <general>: PLEX.sync: Exception encountered: UNIQUE constraint failed: country_link.media_id, country_link.media_type, country_link.country_id
2021-05-22 18:54:06.091 T:22820   ERROR <general>: PLEX.utils: Error encountered:  - UNIQUE constraint failed: country_link.media_id, country_link.media_type, country_link.country_id
2021-05-22 18:54:06.097 T:22820   ERROR <general>: PLEX.utils: _____________________________________________________________
2021-05-22 18:54:06.097 T:22820   ERROR <general>: PLEX.utils:     Traceback (most recent call last):
2021-05-22 18:54:06.097 T:22820   ERROR <general>: PLEX.utils:       File "C:\Users\user\AppData\Roaming\Kodi\addons\plugin.video.plexkodiconnect\resources\lib\library_sync\common.py", line 31, in run
2021-05-22 18:54:06.097 T:22820   ERROR <general>: PLEX.utils:         self._run()
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:       File "C:\Users\user\AppData\Roaming\Kodi\addons\plugin.video.plexkodiconnect\resources\lib\library_sync\process_metadata.py", line 81, in _run
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:         context.add_update(item['xml'][0],
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:       File "C:\Users\user\AppData\Roaming\Kodi\addons\plugin.video.plexkodiconnect\resources\lib\itemtypes\movies.py", line 113, in add_update
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:         self.kodidb.modify_countries(kodi_id,
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:       File "C:\Users\user\AppData\Roaming\Kodi\addons\plugin.video.plexkodiconnect\resources\lib\kodi_db\video.py", line 270, in modify_countries
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:         self._modify_link_and_table(kodi_id,
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:       File "C:\Users\user\AppData\Roaming\Kodi\addons\plugin.video.plexkodiconnect\resources\lib\db.py", line 33, in wrapper
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:         return method(self, *args, **kwargs)
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:       File "C:\Users\user\AppData\Roaming\Kodi\addons\plugin.video.plexkodiconnect\resources\lib\kodi_db\video.py", line 247, in _modify_link_and_table
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:         self.cursor.execute('INSERT INTO %s VALUES (?, ?, ?)' % link_table,
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils:     sqlite3.IntegrityError: UNIQUE constraint failed: country_link.media_id, country_link.media_type, country_link.country_id
2021-05-22 18:54:06.098 T:22820   ERROR <general>: PLEX.utils: _____________________________________________________________


@YoBii
Copy link
Author

YoBii commented May 22, 2021

I tried the version from the BETA repo and it does not have this issue.

@croneter
Copy link
Owner

As always please share your entire debug log, see https://github.com/croneter/PlexKodiConnect/wiki/How-to-Report-A-Bug

@YoBii
Copy link
Author

YoBii commented May 22, 2021

Since the issue disappeared with the beta build I won't bother going back for now. In case I come across this again I'll update with full log.

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