Launching Postgres Linux container under RS5 / 19H1 with a Docker bind mount works, but fails when a Docker volume is used.
Don't explicitly create / specify a volume so that an anonymous volume is created. The behavior is the same when manually creating a named volume with docker volume create pg and instead calling docker run --volume pg:/var/lib/postgresql/data postgres:9.6
"Frame","Module","Location","Address","Path"
"0","FLTMGR.SYS","FltDecodeParameters + 0x1cfd","0xfffff8010c72aa5d","C:\WINDOWS\System32\drivers\FLTMGR.SYS"
"1","FLTMGR.SYS","FltDecodeParameters + 0x1840","0xfffff8010c72a5a0","C:\WINDOWS\System32\drivers\FLTMGR.SYS"
"2","FLTMGR.SYS","FltQueryInformationFile + 0x963","0xfffff8010c762d13","C:\WINDOWS\System32\drivers\FLTMGR.SYS"
"3","ntoskrnl.exe","IofCallDriver + 0x59","0xfffff8010e231819","C:\WINDOWS\system32\ntoskrnl.exe"
"4","ntoskrnl.exe","KeInitializeEvent + 0x64","0xfffff8010e2308c4","C:\WINDOWS\system32\ntoskrnl.exe"
"5","ntoskrnl.exe","SeSetAccessStateGenericMapping + 0x81b","0xfffff8010e7e3e1b","C:\WINDOWS\system32\ntoskrnl.exe"
"6","ntoskrnl.exe","FsRtlIsEcpAcknowledged + 0xd7","0xfffff8010e8ba8d7","C:\WINDOWS\system32\ntoskrnl.exe"
"7","ntoskrnl.exe","SeUnlockSubjectContext + 0x85f","0xfffff8010e7eadef","C:\WINDOWS\system32\ntoskrnl.exe"
"8","ntoskrnl.exe","ObOpenObjectByNameEx + 0x201","0xfffff8010e7e9251","C:\WINDOWS\system32\ntoskrnl.exe"
"9","ntoskrnl.exe","NtCreateFile + 0x8b0","0xfffff8010e82dd50","C:\WINDOWS\system32\ntoskrnl.exe"
"10","ntoskrnl.exe","IoCreateFileEx + 0x11d","0xfffff8010e82d3fd","C:\WINDOWS\system32\ntoskrnl.exe"
"11","ntoskrnl.exe","FsRtlCancellableWaitForSingleObject + 0x1d9","0xfffff8010e8d4f49","C:\WINDOWS\system32\ntoskrnl.exe"
"12","ntoskrnl.exe","NtSetInformationFile + 0xacf","0xfffff8010e22922f","C:\WINDOWS\system32\ntoskrnl.exe"
"13","ntoskrnl.exe","setjmpex + 0x7b95","0xfffff8010e3d1515","C:\WINDOWS\system32\ntoskrnl.exe"
"14","ntoskrnl.exe","KeSynchronizeExecution + 0x2c30","0xfffff8010e3c3b00","C:\WINDOWS\system32\ntoskrnl.exe"
"15","storvsp.sys","VstorSendNotification + 0x1751a","0xfffff80e001aec7a","C:\WINDOWS\System32\drivers\storvsp.sys"
"16","storvsp.sys","VstorSendNotification + 0x1606e","0xfffff80e001ad7ce","C:\WINDOWS\System32\drivers\storvsp.sys"
"17","storvsp.sys","VstorSendNotification + 0xe13f","0xfffff80e001a589f","C:\WINDOWS\System32\drivers\storvsp.sys"
"18","ntoskrnl.exe","NtDeviceIoControlFile + 0x78b","0xfffff8010e7e6b2b","C:\WINDOWS\system32\ntoskrnl.exe"
"19","ntoskrnl.exe","NtDeviceIoControlFile + 0x56","0xfffff8010e7e63f6","C:\WINDOWS\system32\ntoskrnl.exe"
"20","ntoskrnl.exe","setjmpex + 0x7b95","0xfffff8010e3d1515","C:\WINDOWS\system32\ntoskrnl.exe"
"21","ntdll.dll","ZwDeviceIoControlFile + 0x14","0x7ffed975c144","C:\Windows\System32\ntdll.dll"
"22","vp9fs.dll","CreatePlan9FileSystem + 0x2338","0x7ffec1b88e78","C:\Windows\System32\vp9fs.dll"
"23","vp9fs.dll","CreatePlan9FileSystem + 0x28cf","0x7ffec1b8940f","C:\Windows\System32\vp9fs.dll"
"24","vp9fs.dll","vp9fs.dll + 0x11f45","0x7ffec1b81f45","C:\Windows\System32\vp9fs.dll"
"25","vp9fs.dll","vp9fs.dll + 0x91da","0x7ffec1b791da","C:\Windows\System32\vp9fs.dll"
"26","vp9fs.dll","CreatePlan9FileSystem + 0x8abb","0x7ffec1b8f5fb","C:\Windows\System32\vp9fs.dll"
"27","vp9fs.dll","CreatePlan9FileSystem + 0x88f3","0x7ffec1b8f433","C:\Windows\System32\vp9fs.dll"
"28","vp9fs.dll","vp9fs.dll + 0xcec2","0x7ffec1b7cec2","C:\Windows\System32\vp9fs.dll"
"29","vp9fs.dll","CreatePlan9FileSystem + 0xe9a6","0x7ffec1b954e6","C:\Windows\System32\vp9fs.dll"
"30","vp9fs.dll","CreatePlan9FileSystem + 0xdb28","0x7ffec1b94668","C:\Windows\System32\vp9fs.dll"
"31","vp9fs.dll","vp9fs.dll + 0x69fb","0x7ffec1b769fb","C:\Windows\System32\vp9fs.dll"
"32","vp9fs.dll","CreatePlan9FileSystem + 0x12f90","0x7ffec1b99ad0","C:\Windows\System32\vp9fs.dll"
"33","vp9fs.dll","CreatePlan9FileSystem + 0x127ac","0x7ffec1b992ec","C:\Windows\System32\vp9fs.dll"
"34","vp9fs.dll","vp9fs.dll + 0xb1bb","0x7ffec1b7b1bb","C:\Windows\System32\vp9fs.dll"
"35","vp9fs.dll","CreatePlan9FileSystem + 0x941b","0x7ffec1b8ff5b","C:\Windows\System32\vp9fs.dll"
"36","vp9fs.dll","CreatePlan9FileSystem + 0x90d6","0x7ffec1b8fc16","C:\Windows\System32\vp9fs.dll"
"37","vp9fs.dll","vp9fs.dll + 0xb30e","0x7ffec1b7b30e","C:\Windows\System32\vp9fs.dll"
"38","vp9fs.dll","CreatePlan9FileSystem + 0x9d21","0x7ffec1b90861","C:\Windows\System32\vp9fs.dll"
"39","vp9fs.dll","vp9fs.dll + 0x4b46","0x7ffec1b74b46","C:\Windows\System32\vp9fs.dll"
"40","vp9fs.dll","CreatePlan9FileSystem + 0x181b","0x7ffec1b8835b","C:\Windows\System32\vp9fs.dll"
"41","KernelBase.dll","VirtualProtect + 0xc0","0x7ffed69f4ee0","C:\Windows\System32\KernelBase.dll"
"42","ntdll.dll","TpCallbackIndependent + 0x553","0x7ffed96f3713","C:\Windows\System32\ntdll.dll"
"43","ntdll.dll","RtlInitializeResource + 0x872","0x7ffed96f4152","C:\Windows\System32\ntdll.dll"
"44","kernel32.dll","BaseThreadInitThunk + 0x14","0x7ffed8827bd4","C:\Windows\System32\kernel32.dll"
"45","ntdll.dll","RtlUserThreadStart + 0x21","0x7ffed972ce71","C:\Windows\System32\ntdll.dll"
Here's a procmon screenshot showing the sequence of API calls leading to the failures is pretty similar until the access denied
Launching Postgres Linux container under RS5 / 19H1 with a Docker bind mount works, but fails when a Docker volume is used.
Bind mount successful example
Startup logs
Volume failure example
Don't explicitly create / specify a volume so that an anonymous volume is created. The behavior is the same when manually creating a named volume with
docker volume create pgand instead callingdocker run --volume pg:/var/lib/postgresql/data postgres:9.6Startup logs
Environment info
docker version
docker info
Debugging
I used procmon to trace the API calls through
vmwp.exethat seem to cause the specific failure. It appears thatCreateFileis passed the same arguments in both cases, but getsaccess deniedwhen avolumeis used, but is successful with abind mount:The stack trace for that API call is
Here's a procmon screenshot showing the sequence of API calls leading to the failures is pretty similar until the
access deniedComplete logs available in https://gist.github.com/Iristyle/f4867a954ab7545f38c030e4d91ef511
Postgres Info
Postgres is running the command
eval 'initdb --username="$POSTGRES_USER" --pwfile=<(echo "$POSTGRES_PASSWORD") '"$POSTGRES_INITDB_ARGS"in the container at the time of failure: https://github.com/docker-library/postgres/blob/master/docker-entrypoint.sh#L75Which I believe is originating from https://github.com/postgres/postgres/blob/REL9_6_STABLE/src/bin/initdb/initdb.c#L3260
And ultimately originates from the Postgres function
durable_link_or_renameat https://github.com/postgres/postgres/blob/REL9_6_STABLE/src/backend/storage/file/fd.c#L707See also the related docker-library/postgres#253