Jump to content

Emby won't load, corrupt authentication.db, Please help!


Go to solution Solved by a11an,

Recommended Posts

Posted

Hi,

Running on LibreElec amd64, and after a reboot it would not open with the following error

2023-01-02 19:03:06.959 Info AuthenticationRepository: Opening sqlite connection to /storage/.kodi/userdata/addon_data/service.emby4/data/authentication.db
2023-01-02 19:03:06.961 Info AuthenticationRepository: Default journal_mode for /storage/.kodi/userdata/addon_data/service.emby4/data/authentication.db is wal
2023-01-02 19:03:07.019 Error Main: Error in appHost.Init
    *** Error Report ***
    Version: 4.7.11.0
    Command line: /storage/.kodi/addons/service.emby4/libs/system/EmbyServer.dll -programdata /storage/.kodi/userdata/addon_data/service.emby4 -ffmpeg /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffmpeg -ffprobe /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffprobe
    Operating system: Linux version 5.10.76 (jenkins@tsuboi) (x86_64-libreelec-linux-gnu-gcc-10.2.0 (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP Sat Mar 5 19:12:54 CE
    Framework: .NET 6.0.12
    OS/Process: x64/x64
    Runtime: storage/.kodi/addons/tools.dotnet-runtime/bin/shared/Microsoft.NETCore.App/6.0.12/System.Private.CoreLib.dll
    Processor count: 4
    Data path: /storage/.kodi/userdata/addon_data/service.emby4
    Application path: /storage/.kodi/addons/service.emby4/libs/system
    SQLitePCL.pretty.SQLiteException: Error: near "returning": syntax error - Insert Into Devices2 (ReportedDeviceId, ReportedName, CustomName) Values (@ReportedDeviceId, @ReportedName, @CustomName) returning Id 
    SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
       at SQLitePCL.pretty.SQLiteDatabaseConnection.PrepareStatement(ReadOnlySpan`1 sqlUtf8Bytes, String& tail)
       at SQLitePCL.pretty.DatabaseConnection.PrepareStatement(IDatabaseConnection This, ReadOnlySpan`1 sqlUtf8)
       at Emby.Server.Implementations.Security.AuthenticationRepository.GetDeviceId(Int64 internalId, String reportedDeviceId, String reportedDeviceName, Boolean checkForUpdatedDeviceName, IDatabaseConnection db)
       at Emby.Server.Implementations.Security.AuthenticationRepository.Create(AuthenticationInfo info, IDatabaseConnection db, Boolean checkForUpdatedDeviceName)
       at Emby.Server.Implementations.Security.AuthenticationRepository.MigrateTokensToTokens2(IDatabaseConnection db)
       at Emby.Server.Implementations.Security.AuthenticationRepository.Initialize()
       at Emby.Server.Implementations.ApplicationHost.InitDatabases()
       at Emby.Server.Implementations.ApplicationHost.Init()
       at EmbyServer.HostedService.StartAsync(CancellationToken cancellationToken)
    Source: SQLitePCL.pretty
    TargetSite: SQLitePCL.pretty.IStatement PrepareStatement(System.ReadOnlySpan`1[System.Byte], System.String ByRef)
    
2023-01-02 19:03:07.027 Info Main: Shutdown complete

Thinking this was a corrupt authentication.db, I renamed it to .old.  But now when I open emby I get this error

2023-01-02 19:08:16.380 Error Server: Error processing request
	*** Error Report ***
	Version: 4.7.11.0
	Command line: /storage/.kodi/addons/service.emby4/libs/system/EmbyServer.dll -programdata /storage/.kodi/userdata/addon_data/service.emby4 -ffmpeg /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffmpeg -ffprobe /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffprobe
	Operating system: Linux version 5.10.76 (jenkins@tsuboi) (x86_64-libreelec-linux-gnu-gcc-10.2.0 (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP Sat Mar 5 19:12:54 CE
	Framework: .NET 6.0.12
	OS/Process: x64/x64
	Runtime: storage/.kodi/addons/tools.dotnet-runtime/bin/shared/Microsoft.NETCore.App/6.0.12/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /storage/.kodi/userdata/addon_data/service.emby4
	Application path: /storage/.kodi/addons/service.emby4/libs/system
	SQLitePCL.pretty.SQLiteException: Error: near "returning": syntax error - Insert Into Devices2 (ReportedDeviceId, ReportedName, CustomName) Values (@ReportedDeviceId, @ReportedName, @CustomName) returning Id 
	SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
	   at SQLitePCL.pretty.SQLiteDatabaseConnection.PrepareStatement(ReadOnlySpan`1 sqlUtf8Bytes, String& tail)
	   at SQLitePCL.pretty.DatabaseConnection.PrepareStatement(IDatabaseConnection This, ReadOnlySpan`1 sqlUtf8)
	   at Emby.Server.Implementations.Security.AuthenticationRepository.GetDeviceId(Int64 internalId, String reportedDeviceId, String reportedDeviceName, Boolean checkForUpdatedDeviceName, IDatabaseConnection db)
	   at Emby.Server.Implementations.Security.AuthenticationRepository.GetInternalId(String reportedDeviceId)
	   at Emby.Server.Implementations.HttpServer.Security.AuthorizationContext.GetAuthorization(IRequest httpReq)
	   at Emby.Server.Implementations.HttpServer.Security.AuthorizationContext.GetAuthorizationInfo(IRequest requestContext)
	   at Emby.Api.UserService.QueryUsers(BaseUserRequest request, Boolean filterByDevice, Boolean filterByNetwork, Boolean isAuthenticated, Boolean isInLocalNetwork, Int32 startIndex, Nullable`1 limit)
	   at Emby.Api.UserService.GetUsers(GetUsersResult request, Boolean filterByDevice, Boolean filterByNetwork, Boolean isAuthenticated, CancellationToken cancellationToken)
	   at Emby.Api.UserService.Get(GetPublicUsers request)
	   at Emby.Server.Implementations.Services.ServiceController.GetTaskResult(Task task)
	   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: SQLitePCL.pretty.IStatement PrepareStatement(System.ReadOnlySpan`1[System.Byte], System.String ByRef)
	

I have also tried clearing the cache and updating to the latest netcore release.

Completely stuck now, would anyone have any advice?  Thanks.

Happy2Play
Posted

Have you Restarted the Host system?

If it is truly a db issue then you would have to delete/rename the db.

I would question the .NET as I don't think any platform is on that version if it really makes a difference.  But dev will have to comment more.

Posted
16 hours ago, Happy2Play said:

Have you Restarted the Host system?

Yep rebooted a number of times.  I have renamed the authentication.db.old back to the current one, and it back to the original error 

2023-01-03 14:50:17.342 Info AuthenticationRepository: Opening sqlite connection to /storage/.kodi/userdata/addon_data/service.emby4/data/authentication.db
2023-01-03 14:50:17.344 Info AuthenticationRepository: Default journal_mode for /storage/.kodi/userdata/addon_data/service.emby4/data/authentication.db is wal
2023-01-03 14:50:17.405 Error Main: Error in appHost.Init
	*** Error Report ***
	Version: 4.7.11.0
	Command line: /storage/.kodi/addons/service.emby4/libs/system/EmbyServer.dll -programdata /storage/.kodi/userdata/addon_data/service.emby4 -ffmpeg /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffmpeg -ffprobe /storage/.kodi/addons/tools.ffmpeg-tools/bin/ffprobe
	Operating system: Linux version 5.10.76 (jenkins@tsuboi) (x86_64-libreelec-linux-gnu-gcc-10.2.0 (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35.1) #1 SMP Sat Mar 5 19:12:54 CE
	Framework: .NET 6.0.12
	OS/Process: x64/x64
	Runtime: storage/.kodi/addons/tools.dotnet-runtime/bin/shared/Microsoft.NETCore.App/6.0.12/System.Private.CoreLib.dll
	Processor count: 4
	Data path: /storage/.kodi/userdata/addon_data/service.emby4
	Application path: /storage/.kodi/addons/service.emby4/libs/system
	SQLitePCL.pretty.SQLiteException: Error: near "returning": syntax error - Insert Into Devices2 (ReportedDeviceId, ReportedName, CustomName) Values (@ReportedDeviceId, @ReportedName, @CustomName) returning Id 
	SQLitePCL.pretty.SQLiteException: Exception of type 'SQLitePCL.pretty.SQLiteException' was thrown.
	   at SQLitePCL.pretty.SQLiteDatabaseConnection.PrepareStatement(ReadOnlySpan`1 sqlUtf8Bytes, String& tail)
	   at SQLitePCL.pretty.DatabaseConnection.PrepareStatement(IDatabaseConnection This, ReadOnlySpan`1 sqlUtf8)
	   at Emby.Server.Implementations.Security.AuthenticationRepository.GetDeviceId(Int64 internalId, String reportedDeviceId, String reportedDeviceName, Boolean checkForUpdatedDeviceName, IDatabaseConnection db)
	   at Emby.Server.Implementations.Security.AuthenticationRepository.Create(AuthenticationInfo info, IDatabaseConnection db, Boolean checkForUpdatedDeviceName)
	   at Emby.Server.Implementations.Security.AuthenticationRepository.MigrateTokensToTokens2(IDatabaseConnection db)
	   at Emby.Server.Implementations.Security.AuthenticationRepository.Initialize()
	   at Emby.Server.Implementations.ApplicationHost.InitDatabases()
	   at Emby.Server.Implementations.ApplicationHost.Init()
	   at EmbyServer.HostedService.StartAsync(CancellationToken cancellationToken)
	Source: SQLitePCL.pretty
	TargetSite: SQLitePCL.pretty.IStatement PrepareStatement(System.ReadOnlySpan`1[System.Byte], System.String ByRef)
	
2023-01-03 14:50:17.412 Info Main: Shutdown complete

 

Posted

Completely removed emby and removed all the data.  Then rebooted and reinstalled it fresh via kodi (libreElec), but still broken.

Now I get to the Welcome to Emby screen with a spinning wheel and unable to click next.  Log attached.  Would anyone know whats going on? thanks.

 

 

embyserver.txt

  • Solution
Posted

It's now working.  Ended up giving up on the Emby plugin in the libreElec repository.  Installed via docker and working fine, just need to configure it all now!  Seems like a job I do evy year or so!  Hopefully it will be better supported on docker.

If anyone is in the same boat this guide helped me get docker working - 

 

  • Thanks 1
Posted

Thanks for sharing that !

  • 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...