Skip to content

serverless | aws | python requirement | invalid volume error #105

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

Closed
duttasantanuGH opened this issue Nov 22, 2017 · 9 comments
Closed

serverless | aws | python requirement | invalid volume error #105

duttasantanuGH opened this issue Nov 22, 2017 · 9 comments
Labels

Comments

@duttasantanuGH
Copy link

docker: Error response from daemon: invalid volume specification: 'C:\Users\sant_\python-s3-thumbnail:/var/task:z'.
See 'docker run --help'

I am using windows docker (docker toolkit). I have also tried to run the same in conda virtual environment and nodejs CLI but got the same result in all cases.

Thanks for your support in advance.

@dschep dschep added the bug label Nov 22, 2017
@dschep
Copy link
Contributor

dschep commented Nov 22, 2017

Interesting, I wonder if windows doesn't support the :z option to volume mounts in docker. It's only relevant to Linux systems with SELinux enabled, but it's a no-op on macOS (not an error like this). I'm not sure when I'll get to this as I don't use windows systems for development so I'd have to set one up with docker, python, nodejs, & serverless ☹️

@duttasantanuGH
Copy link
Author

Thanks for your response. But without this, I am stuck completely. Will really appreciate if you can help out.

@heri16
Copy link
Contributor

heri16 commented Dec 14, 2017

I might be able to fix this.
There are two things that need to be done:

  1. Enable shared drive in Docker Taskbar settings

  2. Update lib/pip.js to replace backslash in servicePath with forward slashes.

Why: the docker run command requires windows paths to be specified in the forward-slash form of e:/folder or /e/folder. The shell that is currently used to run serverless matters a lot:

  • cmd.exe - servicePath is in the form of 'e:\folder' (backslash needs to be replaced)
  • bash inside WSL Win10 - servicePath is in the form of '/mnt/e/folder' (need to remove /mnt prefix)
  • git-bash.exe - servicePath is in the form of '/e/folder' (already correct)

Note: For usage of docker from Windows 10 WSL command line, see https://blog.jayway.com/2017/04/19/running-docker-on-bash-on-windows/

@heri16
Copy link
Contributor

heri16 commented Dec 14, 2017

For usage of dockerizePip on Windows with the above patch #110, do Step 1 only if running serverless on windows, or do both Step 1 & 2 if running serverless inside WSL.

  1. Enabling shared volume in Windows Docker Taskbar settings

  2. Installing the Docker client on Windows Subsystem for Linux (Ubuntu)

@dschep

@kichik
Copy link
Contributor

kichik commented Feb 27, 2018

I've also had this issue with Docker Toolbox for Windows. The instructions to enable a shared drive don't apply to it. Docker Toolbox seems to require the /c/Users/... syntax for volumes. The error disappeared once I upgraded to Docker for Windows. It'd be nice to add support for Docker Toolbox or somehow block it with a clear message.

@heri16
Copy link
Contributor

heri16 commented Jun 12, 2018

@kichik was your commit #141 simply because you had the legacy Docker version of windows installed?

@kichik
Copy link
Contributor

kichik commented Jun 12, 2018

@heri16 Probably. But I think #144 was more of a fix for this specific issue.

@kingwill101
Copy link

having a similar issue

Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Installing required Python packages with python3.6...
Serverless: Docker Image: lambci/lambda:build-python3.6

  Error --------------------------------------------------

  docker: Error response from daemon: invalid volume specification: 'C:/Users/kingwill101/observerbot:/var/task:z'.
See 'docker run --help'.


     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

Error: docker: Error response from daemon: invalid volume specification: 'C:/Users/kingwill101/observerbot:/var/task:z'.See 'docker run --help'.

    at ServerlessPythonRequirements.installRequirements (C:\Users\kingwill101\observerbot\node_modules\serverless-python-requirements\lib\pip.js:106:11)
From previous event:
    at PluginManager.invoke (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:390:22)
    at PluginManager.spawn (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:408:17)
    at Deploy.BbPromise.bind.then.then (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\plugins\deploy\deploy.js:123:50)
From previous event:
    at Object.before:deploy:deploy [as hook] (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\plugins\deploy\deploy.js:113:10)
    at BbPromise.reduce (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:390:55)
From previous event:
    at PluginManager.invoke (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:390:22)
    at PluginManager.run (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\classes\PluginManager.js:421:17)
    at variables.populateService.then.then (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:157:33)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at Serverless.run (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\lib\Serverless.js:144:8)
    at serverless.init.then (C:\Users\kingwill101\AppData\Roaming\npm\node_modules\serverless\bin\serverless:43:50)
    at <anonymous>

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information -----------------------------
     OS:                     win32
     Node Version:           8.11.2
     Serverless Version:     1.30.1

@kichik
Copy link
Contributor

kichik commented Aug 31, 2018

@glenfordwilliams please try with the latest version of the plugin. If it still happens, attach the log, version numbers, and information about your Docker installation (Docker Toolbox or Docker for Windows, versions, etc.)

And please tag me in that ticket so I can see it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants