Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite dabatase in mounted folder is always locked #11

Closed
alebianco opened this issue Jul 29, 2016 · 9 comments

Comments

@alebianco
Copy link

commented Jul 29, 2016

Expected behavior

a sqlite database file can be place is a folder mounted from the host and used normally

Actual behavior

any operation on such database results in a "database is locked" error
database files placed in non-mounted folder work as expected

Information

  • Diagnostic ID from "Diagnose & Feedback" in the menu.
    90E72802-EF07-4D06-8B68-EC91E23CDBBE/2016-07-29_20-36-27
  • host distribution and version (Windows version, build number, etc)
> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      10586  0

Steps to reproduce the behavior

  1. docker run --rm -it -v /c/Users/alebi/Desktop/db/data:/data --name sqlite sqlite /data/data.db
  2. .database
seq  name             file
---  ---------------  ----------------
0    main             /data/data.db
  1. CREATE TABLE IF NOT EXISTS foo(bar int);
    Error: database is locked

Additional info

These are the mounting options

> docker run --rm -v /c/Users/alebi/Desktop/db/data:/data alpine cat /proc/self/mountinfo | Select-String -pattern "/data"

122 102 0:40 /Users/alebi/Desktop/db/data /data rw,relatime - cifs //10.0.75.1/C
rw,vers=1.0,cache=strict,username=alebi,domain=ANTARES,uid=0,noforceuid,gid=0,noforcegid,addr=10.0.75.1,file_mode=0755,dir_mode=0755,iocharset=utf8,nounix,serverino,mapposix,noperm,rsize=61440,wsize=65536,actimeo=1

This seems to be a "common" CIFS issue related to the byte-range blocking that behaves unexpectedly with sqlite locks. It's usually resolved by using the nobrl flag in the mounting options.

The MobyLinux.ps1 script (C:\Program Files\Docker\Docker\resources) used to contain the mount flags, were I could add the nobrl option when needed, as of the latest version (1.12.0-beta21) the mount flags were removed so there's no workaround (yet).

@ebriney

This comment has been minimized.

Copy link
Member

commented Aug 1, 2016

Thanks for reporting, we will add the flag to fix your issue.

@alebianco

This comment has been minimized.

Copy link
Author

commented Aug 1, 2016

thanks @ebriney
in the meantime, if you know of any workaround or changes i can do manually to fix this, please let me know. Most of my images use sqlite with a mounted folder and are unusable at the moment

@ebriney

This comment has been minimized.

Copy link
Member

commented Aug 1, 2016

Unfortunately we moved the binding code in C# so there is no workaround except installing a previous version and wait for the hot fixes release soon

@ebriney ebriney self-assigned this Aug 1, 2016

@dgageot

This comment has been minimized.

Copy link

commented Aug 4, 2016

Closing. nobrl option was added on master branch.

@dgageot dgageot closed this Aug 4, 2016

@howlerwolf1313

This comment has been minimized.

Copy link

commented Aug 5, 2016

Hey @dgageot,
New to Docker in Windows, how do we go about adding that "nobrl" option when mounting shared drives? Do I need to be using the beta to get the fix? Thank you

@alebianco

This comment has been minimized.

Copy link
Author

commented Aug 5, 2016

@howlerwolf1313 it should be released on a beta first (hasn't been released yet that i know) and then hopefully in the stable version after a while.

@dgageot

This comment has been minimized.

Copy link

commented Aug 5, 2016

@howlerwolf1313 It should be relased on beta channel next week

@howlerwolf1313

This comment has been minimized.

Copy link

commented Aug 5, 2016

@alebianco @dgageot Thank you.

@londoncalling

This comment has been minimized.

Copy link

commented May 16, 2017

@dgageot @friism I need help documenting the nobrl flag per the docs issue raised.

See Docker for Windows issue 694 and the docs issue #3147 I opened to track it.

I'm running the latest Docker for Windows build 17.05.0-ce-win-11 (12053), but I need help figuring this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.