Jellyfin Forum
SQLite database getting locked down? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: SQLite database getting locked down? (/t-sqlite-database-getting-locked-down)



SQLite database getting locked down? - temping - 2023-08-30

Hey everyone!

I'm new to creating my own server and serving my media.  I have been using Jellyfin in docker in Ubuntu server for over 2 months now and it was working perfectly fine last night.

Today, however, nothing wants to run.  When taking a look at the docker logs, I saw
Code:
Busy: SQLitePCL.pretty.SQLiteException: database is locked
  at SQLitePCL.pretty.SQLiteException.Throw(Int32 rc, Int32 extended, String msg)
  at SQLitePCL.pretty.SQLiteException.CheckOk(sqlite3 db, Int32 rc)
  at SQLitePCL.pretty.SQLiteDatabaseConnection.PrepareStatement(String sql, String& tail)
  at SQLitePCL.pretty.DatabaseConnection.PrepareStatement(IDatabaseConnection This, String sql)
  at SQLitePCL.pretty.DatabaseConnection.Execute(IDatabaseConnection This, String sql)
  at Emby.Server.Implementations.Data.BaseSqliteRepository.GetConnection(Boolean readOnly)
  at Emby.Server.Implementations.Data.SqliteItemRepository.Initialize(SqliteUserDataRepository userDataRepo, IUserMnager userManager)
  at Emby.Server.Implementations.ApplicationHost.InitializeServices()
  at Jellyfin.Server.Program.StartApp(StartupOptions options)

I don't know why the database is locked and would appreciate any help to unlock it


RE: SQLite database getting locked down? - Venson - 2023-08-30

Hey @temping

The error that the database is locked, is usually an indicator for 2 instances of Jellyfin running at the same time. Is this maybe the issue here?


RE: SQLite database getting locked down? - temping - 2023-08-30

So, one of things I noticed when trying to find out what happened here is that my samba share wasn't active.  So, once I found the problem with jellyfin and posted here, I turned my attention to the missing samba share and found that one of the drives in my disk pool has errors and the pool is degraded


Code:
  pool: Moria
state: DEGRADED
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
  scan: resilver in progress since Wed Aug 30 13:47:40 2023
        360G scanned at 58.0M/s, 7.22G issued at 1.16M/s, 19.6T total
        0B resilvered, 0.04% done, no estimated completion time
config:

        NAME                                    STATE    READ WRITE CKSUM
        Moria                                  DEGRADED    0    0    0
          raidz1-0                              DEGRADED  113    14    0
            ata-WDC_WD200EDGZ-11BLDS0_8LH847GR  ONLINE    108    14    0
            sdi                                UNAVAIL      3  126    2
            sdc                                ONLINE      0    0    0
            ata-WDC_WD200EDGZ-11BLDS0_8LHLR3VR  ONLINE      0    0    0

errors: 130 data errors, use '-v' for a list
I'm thinking that the locked database is because of this?


RE: SQLite database getting locked down? - Venson - 2023-08-30

Well you should really replace those two drives but the pool is reported as only Degraded but still functional. Its unlikely that this is the root issue if its still redundant. Its A issue you should really fix, fast but nothing to do with JF