Jump to content

SQLiteException: Constraint: NOT NULL constraint failed: UserDatas.HideFromResume


Go to solution Solved by Luke,

Recommended Posts

Posted (edited)

New install with latest stable on Debian Buster. I am using a rclone mount for the data (post solution edit: data -> media files) that is owned by another user but emby user can read/write in it (tested).

Though metadata/cache etc are on the defaults so on /var/lib/emby

Everything seemed to work fine till I realised I could not set a movie as watched. The checkmark becomes red but on refresh it doesn't show it as such. Furthermore if I click on favourite nothing happens.

 

Checking the logs shows the following:

  • clicking watched:
2020-12-03 13:55:56.503 Error HttpServer: Error processing request
        *** Error Report ***
        Version: 4.5.2.0
        Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
        Operating system: Linux version 4.19.0-5-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08)
        Framework: .NET Core 3.1.7
        OS/Process: x64/x64
        Runtime: opt/emby-server/system/System.Private.CoreLib.dll
        Processor count: 1
        Data path: /var/lib/emby
        Application path: /opt/emby-server/system
        SQLitePCL.pretty.SQLiteException: Constraint: NOT NULL constraint failed: UserDatas.HideFromResume
        SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
           at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc)
           at SQLitePCL.pretty.StatementImpl.MoveNext()
           at Emby.Server.Implementations.Data.SqliteUserDataRepository.SaveUserData(Int64 internalUserId, Int64 itemId, UserItemData userData, CancellationToken cancellationToken)
           at Emby.Server.Implementations.Library.UserDataManager.SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken)
           at MediaBrowser.Controller.Entities.BaseItem.MarkPlayed(User user, Nullable`1 datePlayed, Boolean resetPosition)
           at Emby.Server.MediaEncoding.Api.PlaystateService.MarkPlayed(MarkPlayedItem request)
           at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
           at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
           at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
        Source: SQLitePCL.pretty
        TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32)

 

  • clicking favourite:
2020-12-03 13:56:02.419 Error HttpServer: Error processing request
        *** Error Report ***
        Version: 4.5.2.0
        Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
        Operating system: Linux version 4.19.0-5-amd64 (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-6)) #1 SMP Debian 4.19.37-5+deb10u2 (2019-08-08)
        Framework: .NET Core 3.1.7
        OS/Process: x64/x64
        Runtime: opt/emby-server/system/System.Private.CoreLib.dll
        Processor count: 1
        Data path: /var/lib/emby
        Application path: /opt/emby-server/system
        SQLitePCL.pretty.SQLiteException: Constraint: NOT NULL constraint failed: UserDatas.HideFromResume
        SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
           at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc)
           at SQLitePCL.pretty.StatementImpl.MoveNext()
           at Emby.Server.Implementations.Data.SqliteUserDataRepository.SaveUserData(Int64 internalUserId, Int64 itemId, UserItemData userData, CancellationToken cancellationToken)
           at Emby.Server.Implementations.Library.UserDataManager.SaveUserData(User user, BaseItem item, UserItemData userData, UserDataSaveReason reason, CancellationToken cancellationToken)
           at MediaBrowser.Api.UserLibrary.UserLibraryService.MarkFavorite(Guid userId, String itemId, Boolean isFavorite)
           at MediaBrowser.Api.UserLibrary.UserLibraryService.Post(MarkFavoriteItem request)
           at Emby.Server.Implementations.Services.ServiceController.Execute(HttpListenerHost appHost, Object requestDto, IRequest req)
           at Emby.Server.Implementations.Services.ServiceHandler.ProcessRequestAsync(HttpListenerHost appHost, IRequest httpReq, IResponse httpRes, RestPath restPath, String responseContentType, CancellationToken cancellationToken)
           at Emby.Server.Implementations.HttpServer.HttpListenerHost.RequestHandler(IRequest httpReq, ReadOnlyMemory`1 urlString, ReadOnlyMemory`1 localPath, CancellationToken cancellationToken)
        Source: SQLitePCL.pretty
        TargetSite: Void CheckOk(SQLitePCLEx.sqlite3, Int32)

any ideas what went wrong?

Edited by Loke
  • Solution
Posted

Looks like you had the beta server and then tried to roll back to stable. That's not supported. I would either go back up to the beta, or empty out the contents of this directory and make a fresh start:

/var/lib/emby

 

Posted

Or perhaps I misread, you're sharing the data folder with another server. Please note we don't test this sort of thing ourselves, but if you must do this, then at the very least I would keep all of the servers on the same version.

Posted
11 minutes ago, Luke said:

Looks like you had the beta server and then tried to roll back to stable. That's not supported. I would either go back up to the beta, or empty out the contents of this directory and make a fresh start:


/var/lib/emby

 

ah very correct observation Luke! Indeed I had the wrong version set on my saltstack and I had for a bit the beta version. I didn't even remember it!

Cheers. (small hijack) Btw is there a link that always points to the latest stable / beta?

Posted

For direct download, no, but it will always be displayed on our website:

https://emby.media/download

My other advice still stands though, that if you are sharing your data folder with multiple servers then i would keep them on the same version. Otherwise things will change over time, and the server on the older version won't know how to deal with it.

Posted
10 minutes ago, Luke said:

For direct download, no, but it will always be displayed on our website:

https://emby.media/download

My other advice still stands though, that if you are sharing your data folder with multiple servers then i would keep them on the same version. Otherwise things will change over time, and the server on the older version won't know how to deal with it.

Too bad, that means when using configuration tools you have to update the version used. Would be nice if there is link for each type that always points to latest, but it's nothing really important.

 

The data that is shared is just the media files. Not any emby system data.

Posted

OK sorry I, I misunderstood. I thought you were sharing /var/lib/emby with multiple servers.

Posted (edited)
6 minutes ago, Luke said:

OK sorry I, I misunderstood. I thought you were sharing /var/lib/emby with multiple servers.

well re-reading it, I described it poorly. Added a small edit to make it a bit more clear, while not messing with the history of the topic!

Thank you again!

Edited by Loke
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...