Using shared drives results in "Database is locked" error

Firstly this is my first time using the docker, so it’s very likely that I’ve just been an idiot.

I’m running the linuxserver/plexpy image with the config mapped to a config folder on my c:. The first run works totally fine, but the second result gives the error described below.

Expected behavior

No issues with database

Actual behavior

2016-06-27 06:33:53 - ERROR :: MainThread : Uncaught exception: Traceback (most recent call last):
File “/opt/plexpy/PlexPy.py”, line 247, in
main()
File “/opt/plexpy/PlexPy.py”, line 173, in main
plexpy.initialize(config_file)
File “/opt/plexpy/plexpy/init.py”, line 194, in initialize
plextv.refresh_users()
File “/opt/plexpy/plexpy/plextv.py”, line 36, in refresh_users
monitor_db = database.MonitorDatabase()
File “/opt/plexpy/plexpy/database.py”, line 125, in init
self.connection.execute(“PRAGMA journal_mode = %s” % plexpy.CONFIG.JOURNAL_MODE)
OperationalError: database is locked

Traceback (most recent call last):
File “/opt/plexpy/PlexPy.py”, line 247, in
main()
File “/opt/plexpy/PlexPy.py”, line 173, in main
plexpy.initialize(config_file)
File “/opt/plexpy/plexpy/init.py”, line 194, in initialize
plextv.refresh_users()
File “/opt/plexpy/plexpy/plextv.py”, line 36, in refresh_users
monitor_db = database.MonitorDatabase()
File “/opt/plexpy/plexpy/database.py”, line 125, in init
self.connection.execute(“PRAGMA journal_mode = %s” % plexpy.CONFIG.JOURNAL_MODE)
sqlite3.OperationalError: database is locked

Information

Note that if I store the config with a relative path (I’m guessing the files get saved in the VM?) then it works fine. It’s only when the config location is on a shared drive that I have issues.

  • the output of:

    • Moby Notification > Diagose & Feedback on Windows : 2D5411F8-CB14-4EC2-B790-F4F80F583E04/2016-06-27_07-44-56
  • Windows 10 Build 14295.rs1_release.160318-1628

Steps to reproduce the behavior

  1. Ensure you have a share to a local drive configured.
  2. Install the plexpy container using the following:
  3. docker create --name=plexpy -v /etc/localtime:/etc/localtime:ro -v C:/docker/plexpy:/config -v C:/docker/logs:/logs:ro -p 8181:8181 linuxserver/plexpy
  4. Start the container
  5. Ideally visit the site, and configure it (you would need a plex install to do so)
  6. Restart the container
  7. Note that the site doesn’t work, and the database issues are now in the log.

If you instead create the container without using a shared drive the above will work fine.

1 Like