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 · 10 comments
Closed

sqlite dabatase in mounted folder is always locked #11

alebianco opened this issue Jul 29, 2016 · 10 comments

Comments

@alebianco
Copy link

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
Copy link
Member

ebriney commented Aug 1, 2016

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

@alebianco
Copy link
Author

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
Copy link
Member

ebriney 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
Copy link
Member

dgageot commented Aug 4, 2016

Closing. nobrl option was added on master branch.

@dgageot dgageot closed this as completed Aug 4, 2016
@howlerwolf1313
Copy link

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
Copy link
Author

@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
Copy link
Member

dgageot commented Aug 5, 2016

@howlerwolf1313 It should be relased on beta channel next week

@howlerwolf1313
Copy link

@alebianco @dgageot Thank you.

@londoncalling
Copy link

londoncalling 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.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants