Jellyfin client database (on OSMC KODI) keeps malforming

After initial setup and partially scanning the Jellyfin server and adding half my series to KODI, my server database corrupted (disk full). I’ve set up Jellyfin server again, and can perfectly access from other pc web interface without problem, and play movies. Server end works.

The OSMC KODI client successfully connects to Jellyfin server. I cannot however get the KODI client to finish a scan. It does not even want to add libraries, all libraries get set to dynamic. The library scan starts and immediately fails into an error with reference to KODI log. According to kodi log, The client side database on KODI also got corrupted, or “malformed”.

I have performed local database reset, and removed jellyfin from kodi, including all setup and other related data, by uninstalling from the menu. Nothing helps. The new install immediately complained about the same issue though. So it seems something lingers on my KODI setup that messes up the database from the start.

What can I do to get client Jellyfin working again?
How can I completely uninstall, scrub and purge everything that has to do with jellyfin so i can start again?

Relevant part of KODI log:

2025-03-11 18:50:38.395 T:1286070496 NOTICE: JELLYFIN.jellyfin_kodi.database → ERROR::jellyfin_kodi/database/init.py:165 type: <class ‘sqlite3.DatabaseError’> value: database disk image is malformed
2025-03-11 18:50:38.618 T:1286070496 NOTICE: JELLYFIN.jellyfin_kodi.full_sync → INFO::jellyfin_kodi/full_sync.py:603 --<[ fullsync ]
2025-03-11 18:50:38.683 T:1286070496 NOTICE: JELLYFIN.jellyfin_kodi.library → ERROR::jellyfin_kodi/library.py:539 database disk image is malformed
Traceback (most recent call last):
File “jellyfin_kodi/library.py”, line 535, in remove_library
sync.remove_library(library_id)
File “jellyfin_kodi/helper/wrapper.py”, line 41, in wrapper
result = func(self, dialog=dialog, *args, **kwargs)
File “jellyfin_kodi/full_sync.py”, line 534, in remove_library
items = db.get_item_by_media_folder(library_id.replace(‘Mixed:’, “”))
File “jellyfin_kodi/database/jellyfin_db.py”, line 53, in get_item_by_media_folder
return self.cursor.fetchall()
DatabaseError: database disk image is malformed
2025-03-11 18:50:39.771 T:1076883680 NOTICE: JELLYFIN.jellyfin_kodi.full_sync → INFO::jellyfin_kodi/full_sync.py:56 -->[ fullsync ]
2025-03-11 18:50:42.719 T:1076883680 NOTICE: JELLYFIN.jellyfin_kodi.full_sync → INFO::jellyfin_kodi/full_sync.py:187 starting sync with [u’ed0ca5a1598db0aef10ecf65c11eb475’, u’767bffe4f11c93ef34b805451a696a4e’, u’f137a2dd21bbc1b99aa5c0f6bf02a805’, u’5ddaa59a73205234890fdcfc683e14ed’, u’bbb159b13df2340a3ccc408b59455617’, u’e2c00f297a5f80af390f52f72e782147’, u’Boxsets:']
2025-03-11 18:50:42.807 T:1076883680 NOTICE: JELLYFIN.jellyfin_kodi.jellyfin.http → ERROR::jellyfin_kodi/jellyfin/http.py:124 404 Client Error: Not Found for url: http://{jellyfin-server}/Users/85990e50250842ce8a7e6756bd8780bc/Items/ed0ca5a1598db0aef10ecf65c11eb475
2025-03-11 18:50:44.195 T:1076883680 NOTICE: JELLYFIN.jellyfin_kodi.full_sync → ERROR::jellyfin_kodi/full_sync.py:274 full sync exited unexpectedly
2025-03-11 18:50:44.225 T:1076883680 NOTICE: JELLYFIN.jellyfin_kodi.full_sync → ERROR::jellyfin_kodi/full_sync.py:275
Traceback (most recent call last):
File “jellyfin_kodi/full_sync.py”, line 249, in process_library
library = self.server.jellyfin.get_item(library_id.replace(‘Mixed:’, “”))
File “jellyfin_kodi/jellyfin/api.py”, line 139, in get_item
return self.users(“/Items/%s” % item_id)
File “jellyfin_kodi/jellyfin/api.py”, line 92, in users
return self._get(“Users/{UserId}%s” % handler, params)
File “jellyfin_kodi/jellyfin/api.py”, line 61, in _get
return self._http(“GET”, handler, {‘params’: params})
File “jellyfin_kodi/jellyfin/api.py”, line 58, in _http
return self.client.request(request)
File “jellyfin_kodi/jellyfin/http.py”, line 159, in request
raise HTTPException(r.status_code, error)
HTTPException
2025-03-11 18:50:44.314 T:1076883680 NOTICE: JELLYFIN.jellyfin_kodi.full_sync → INFO::jellyfin_kodi/full_sync.py:603 --<[ fullsync ]
2025-03-11 18:50:44.339 T:1076883680 NOTICE: JELLYFIN.jellyfin_kodi.library → ERROR::jellyfin_kodi/library.py:332
Traceback (most recent call last):
File “jellyfin_kodi/library.py”, line 328, in startup
sync.libraries()
File “jellyfin_kodi/full_sync.py”, line 109, in libraries
self.start()
File “jellyfin_kodi/full_sync.py”, line 193, in start
self.process_library(library)
File “jellyfin_kodi/full_sync.py”, line 249, in process_library
library = self.server.jellyfin.get_item(library_id.replace(‘Mixed:’, “”))
File “jellyfin_kodi/jellyfin/api.py”, line 139, in get_item
return self.users(“/Items/%s” % item_id)
File “jellyfin_kodi/jellyfin/api.py”, line 92, in users
return self._get(“Users/{UserId}%s” % handler, params)
File “jellyfin_kodi/jellyfin/api.py”, line 61, in _get
return self._http(“GET”, handler, {‘params’: params})
File “jellyfin_kodi/jellyfin/api.py”, line 58, in _http
return self.client.request(request)
File “jellyfin_kodi/jellyfin/http.py”, line 159, in request
raise HTTPException(r.status_code, error)
HTTPException

Could it be a problematic SD card?

You are probably using the ‘Jellyfin for Kodi’ plugin, if so you can reset the database within the settings of the plugin.
There are also option like repair repository which you could try first.

If that does ‘t help, you could try removing the following folders through SSH:
~/.kodi/userdata/addon_data/plugin.video.jellyfin
~/.kodi/userdata/Database (maybe only the movies, tvshow and music db files)
~/.kodi/userdata/Thumbnails

After this run ‘systemctl restart mediacenter’ and you should get a clean Kodi.

Thanks Sam.
SD card is fine but it could be that the 4GB SD card is getting too full. I’ll try again after removing ~/.kodi/userdata/Thumbnails. It is huge.

Just to chime in here. While I was troubleshooting the Thumbnail issue, I tried to use PlexKodiConnect, which did not resolve the thumbnail issue. Maybe the problem experienced by @Florissimo is somehow related to the same bug that causes the thumbnail issue.

Tried the repair and reset database options from within Jellyfin. That did not help. Uninstalled JF plus all related data. Then had a look in ~/.kodi/userdata/Database. Besides the normal Kodi databases there was still a jellyfin.db present! Deleted only that. Going to reinstall jellyfin now and see if it now works as a first install and setup. I’ll post update here.

Well creating ample space on the SD card did not solve the issue. So that was not it.

Well that did the trick. The jellyfin.db database does not get removed when the jellyfin plugin is removed - not even if the option “remove data” is given.
Manual deletion through ssh is required to get Jellyfin working again with a new install. (command: rm ~/.kodi/userdata/Database/jellyfin.db)

After removal of the jellyfin.db, and removal and reinstall of Jellyfin plugin, Jellyfin works again.

Thanks M@Theetjuh for the assist, it put me on the right track.

1 Like