Database always corrupted in Windows

server-docker

#1

Host OS version: Windows 10 (Docker for Windows Beta)
Plex Media Server version : 1.4.4
Docker tag for the image latest
Brief description of the issue or bug

Steps to reproduce
1. Refresh/Scan large library (any)
2. database disk image is malformed

Is Docker version not work in Windows?

    Apr 01, 2017 15:49:55.052 [0x7f16ec693800] ERROR - SQLITE3:0x10, 11, database corruption at line 59437 of [fc49f556e4]
    Apr 01, 2017 15:49:55.052 [0x7f16ec693800] ERROR - SQLITE3:0x10, 11, database corruption at line 59479 of [fc49f556e4]
    Apr 01, 2017 15:49:55.052 [0x7f16ec693800] ERROR - SQLITE3:0x10, 11, statement aborts at 10: [select max(max(metadata_items.changed_at),max(metadata_items.resources_changed_at)) from metadata_items] database disk image is malformed
    Apr 01, 2017 15:49:55.053 [0x7f16ec693800] ERROR - Database corruption: sqlite3_statement_backend::loadOne: database disk image is malformed
    Apr 01, 2017 15:49:55.053 [0x7f16ec693800] ERROR - Error: Unable to set up server: sqlite3_statement_backend::loadOne: database disk image is malformed (N4soci10soci_errorE)

#2

Docker
Version 17.03.1-ce-rc1-win3 (10625)
Channel: edge
1795b35


#3

I'm not a docker expert by any means but since PMS in Docker is actually Linux based, I can speak to that. Are you terminating the image abruptly?

If so, it's the same as powering off the computer.

Since you seem to be the only one reporting this, it implies something with your computer or how Docker/PMS is being shut down.

Does this lead to any ideas?


#4

I can speak to that. Are you terminating the image abruptly?
No, i stop or kill it after malformed only

Since you seem to be the only one reporting this, it implies something with your computer or how Docker/PMS is being shut down.
tried different computer


#5

@ChuckPA said:
Since you seem to be the only one reporting this
As you see, there is only 3 pages in the comment section.
It doesn't mean that i am only one...

github.com/plexinc/pms-docker
(Note that the underlying filesystem needs to support file locking. Known to not be default enabled on remote filesystems like NFS)
I found this information on the github.
Docker for Windows also using remote filesystem SMB for volume.

Is Plex Docker version not work in Windows?


#6

It works perfectly. You can't put it on a remote network share if this is what you ask

SMB does not support the file locking needed to operate the database. NFS supports it if you enable it.


#7

@ChuckPA said:
It works perfectly. You can't put it on a remote network share if this is what you ask

SMB does not support the file locking needed to operate the database. NFS supports it if you enable it.
I DOES NOT PUT ON NETWORK SHARE MANUALLY.

It's Docker.
Docker for Windows using SMB for volume mount.
(information came from Docker Inc offically github https://github.com/docker/for-win/issues/39#issuecomment-285777521)

WHAT I ASK IT:
Is that meaning the plex docker version does not support Windows offically?


#8

Do NOT use SMB volume reference..

Show me your configuration.


#9

AGAIN.
Docker for Windows use SMB for volume mount (local drive, NOT NETWORK).
There is no options to choose how to mount volume in Windows.
I never manually change to SMB for volume mount.

  1. You said "SMB does not support the file locking needed to operate the database."
  2. Docker for Windows use SMB for volume mount (https://github.com/docker/for-win/issues/39#issuecomment-285777521) WHAT I ASK IS: Is that meaning the plex docker version does not support Windows offically?

Can you check how docker work in Windows and read my posts again?


#10

From the docker wiki.

-v :/config The path where you wish Plex Media Server to store its configuration data. This database can grow to be quite large depending on the size of your media collection. This is usually a few GB but for large libraries or libraries where index files are generated, this can easily hit the 100s of GBs. If you have an existing database directory see the section below on the directory setup. (Note that the underlying filesystem needs to support file locking. Known to not be default enabled on remote filesystems like NFS)

In Windows, when on the local hard drive uses NTFS file locking. When using SMB, there is no file locking unless it is enabled. All those users who are having SMB file locking problems are because of how SMB works.

I have asked the Docker dev to make the change to the Wiki itself. It will shortly include NFS and SMB. I'm sure he will also include a warning about doing this is at your own risk.


#11

Sorry, can you read my post and the Docker github post by Docker inc Developer?

Until now, Docker still using SMB to mount the volume.
It does not mount local hard drive NTFS directly

SMB is the only method to mount volume in Windows (by Docker inc)

WHAT I ASK AND WANT TO CONFIRM IS:
Is that meaning the plex docker version does not support Windows offically?
Please don't argue SMB again. It is the only method to use volume in "Docker for Windows."
I have posted the link which commented by Docker inc Developer

I know we are not expert, but can you read carefully before answer.


#12

I have read the post you referred to. They clearly speak of changing ownership and the limitation.

I clearly speak to your problem of corrupted database.

Both are because of SMB/CIFS limitation.

I say this again:

  1. Plex docker supports Windows.
  2. Plex docker does not support moving your /config to ANY network share which does not have file locking enabled. This is your responsibility to enable & guarantee. File locking is provided, by default, by every operating system for local files.
  3. Read the Plex Docker WIki. It tells you all this.

#13

@ChuckPA said:
I have read the post you referred to. They clearly speak of changing ownership and the limitation.

I clearly speak to your problem of corrupted database.

Both are because of SMB/CIFS limitation.

I say this again:

  1. Plex docker supports Windows.
  2. Plex docker does not support moving your /config to ANY network share which does not have file locking enabled. This is your responsibility to enable & guarantee. File locking is provided, by default, by every operating system for local files.
  3. Read the Plex Docker WIki. It tells you all this.

Plex docker supports Windows.
Docker for WIndows use SMB for volume mount.
Can you tell me how Plex (Docker WIndows) support it but not using SMB?
Plex docker does not support moving your /config to ANY network share which does not have file locking enabled.
AGAIN.
Can you read HOW MY POST AGAIN AND HOW "Docker for Windows" works?
I NEVER MOVE MY CONFIG TO ANY NETWORK SHARE

Read the Plex Docker WIki. It tells you all this.
Read the Github post and Google "How docker for windows work".
It tell you all this.


#14

Even on Windows, inside the container, it is Ubuntu Linux.

This is how it works.


#15

SHOW ME YOUR DOCKER CONFIG


#16

@ChuckPA said:
Docker Plex is Ubuntu .

Use the released container.

You mean via VM or Hyper V?
Then, it is not Windows, not "Docker for Windows" , no NTFS.


#17

@ChuckPA said:
Even on Windows, inside the container, it is Ubuntu Linux.

This is how it works.

/config have to mount to container (* it is alpine, not ubuntu)
-v x:\config:/config
It is using SMB to mount in the container.

PLEASE MAKE SURE YOU KNOW HOW "Docker for Windows" work before answer again PLZ PLZ PLZ.
If you can read the Docker Inc post above again, they still using SMB to implement volume mount today.


#18

@Avarus.box said:

@ChuckPA said:
Even on Windows, inside the container, it is Ubuntu Linux.

This is how it works.

/config have to mount to container
-v x:\config:/config
It is using SMB to mount in the container.

PLEASE MAKE SURE YOU KNOW HOW "Docker for Windows" work before answer again PLZ PLZ PLZ.
If you can read the Docker Inc post above again, they still using SMB to implement volume mount today.

Is x:\config a Windows local hard drive or is it a network share?

You tell me you are using SMB to mount the container. IF your config is inside that container, then you are causing your own problem and you are telling it to use a network share which requires file locking


#19

@ChuckPA said:

@Avarus.box said:

@ChuckPA said:
Even on Windows, inside the container, it is Ubuntu Linux.

This is how it works.

/config have to mount to container
-v x:\config:/config
It is using SMB to mount in the container.

PLEASE MAKE SURE YOU KNOW HOW "Docker for Windows" work before answer again PLZ PLZ PLZ.
If you can read the Docker Inc post above again, they still using SMB to implement volume mount today.

Is x:\config a Windows local hard drive or is it a network share?

I SAY IT MANY TIME
LOCAL DRIVE

PLEASE READ HOW "Docker for Windows" WORK BEFORE ARGUE.
("Docker for Windows" is a program name)


#20

I ask one last time.

Drive X is a local hard drive? Drive X is normally a network share. Please be absolutely clear on this.