Skip to content

Broken on Windows? #516

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

Open
milesgranger opened this issue May 14, 2020 · 2 comments
Open

Broken on Windows? #516

milesgranger opened this issue May 14, 2020 · 2 comments

Comments

@milesgranger
Copy link

Hi,
I develop on Linux most times but have to maintain the project for Windows users as well, and suddently I'm getting:

STDERR: docker: Error response from daemon: error evaluating symlinks from mount source
  "/host_mnt/c/Users/milesg/AppData/Local/UnitedIncome/serverless-python-requirements/Cache/f52b7315270e4c47921f517927ed78b1b035439622227a53dbed30da6f4c9e01_slspyc": 
lstat /host_mnt: function not implemented.
Full error trace
PS C:\Users\milesg\serverless-python-requirements\example_native_deps> serverless package Serverless: Adding Python requirements helper... Serverless: Generated requirements from C:\Users\milesg\serverless-python-requirements\example_native_deps\requirements.txt in C:\Users\milesg\serverless-python-requirements\example_native_deps\.serverless\requirements.txt... Serverless: Installing requirements from C:\Users\milesg\AppData\Local\UnitedIncome\serverless-python-requirements\Cache\f52b7315270e4c47921f517927ed78b1b035439622227a53dbed30da6f4c9e01_slspyc\requirements.txt ... Serverless: Docker Image: lambci/lambda:build-python3.6 Serverless: Using download cache directory C:\Users\milesg\AppData\Local\UnitedIncome\serverless-python-requirements\Cache\downloadCacheslspyc Serverless: Running docker run --rm -v C\:/Users/milesg/AppData/Local/UnitedIncome/serverless-python-requirements/Cache/f52b7315270e4c47921f517927ed78b1b035439622227a53dbed30da6f4c9e01_slspyc\:/var/task\:z -v C\:/Users/milesg/AppData/Local/UnitedIncome/serverless-python-requirements/Cache/downloadCacheslspyc\:/var/useDownloadCache\:z -u 0 lambci/lambda\:build-python3.6 python -m pip install -t /var/task/ -r /var/task/requirements.txt --cache-dir /var/useDownloadCache...

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

Error: STDOUT:

STDERR: docker: Error response from daemon: error evaluating symlinks from mount source "/host_mnt/c/Users/milesg/AppData/Local/UnitedIncome/serverless-python-requirements/Cache/f52b7315270e4c47921f517927ed78b1b035439622227a53dbed30da6f4c9e01_slspyc": lstat /host_mnt: function not implemented.

  at C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\lib\pip.js:325:13
  at Array.forEach (<anonymous>)
  at installRequirements (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\lib\pip.js:312:28)
  at installRequirementsIfNeeded (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\lib\pip.js:556:3)
  at ServerlessPythonRequirements.installAllRequirements (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\lib\pip.js:635:29)
  at ServerlessPythonRequirements.tryCatcher (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\bluebird\js\release\util.js:16:23)
  at Promise._settlePromiseFromHandler (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\bluebird\js\release\promise.js:547:31)
  at Promise._settlePromise (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\bluebird\js\release\promise.js:604:18)
  at Promise._settlePromise0 (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\bluebird\js\release\promise.js:649:10)
  at Promise._settlePromises (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\bluebird\js\release\promise.js:729:18)
  at Promise._fulfill (C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\bluebird\js\release\promise.js:673:18)
  at C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\bluebird\js\release\nodeback.js:42:21
  at C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\fs-extra\lib\copy\copy.js:120:12
  at C:\Users\milesg\serverless-python-requirements\example_native_deps\node_modules\serverless-python-requirements\node_modules\graceful-fs\polyfills.js:243:20
  at C:\Users\milesg\AppData\Roaming\npm\node_modules\serverless\node_modules\graceful-fs\polyfills.js:243:20
  at FSReqCallback.oncomplete (fs.js:155:23)

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

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

Your Environment Information ---------------------------
Operating System: win32
Node Version: 12.16.3
Framework Version: 1.70.1
Plugin Version: 3.6.11
SDK Version: 2.3.0
Components Version: 2.30.10

I thought perhaps it was something in my project, but cloning this repo and running it on the example_native_deps gave the same error. I'm not that good with Windows, but have tried it with PowerShell, cmd prompt, as well as git bash terminal, all with the same results.

Docker version: 19.03.8

@milesgranger milesgranger changed the title Boken on Windows? Broken on Windows? May 15, 2020
@tom-dq
Copy link

tom-dq commented May 26, 2020

I had an error like this, and now it's working. In the interim I did ever so many things and I'm not sure which (if any) were responsible for the resolution. But in case it helps, here was my heavy-handed workaround:

  • Enroll in the Windows Insiders program and make sure you're running Windows 10 version 2004 so you can get WSL2.
  • Install WSL2.
  • Do step 2 of Windows dockerizePip notes
  • Uninstall Docker.
  • Restart the computer.
  • Reinstall Docker.
  • Disable caching like this:
custom:
  pythonRequirements:
    dockerizePip: true
    useDownloadCache: false
    useStaticCache: false

Caveat: Whenever I have to work with Docker I'm flailing in the dark; I have no idea if the above steps were what made it work for me, or even if they are coherent. Good luck!

@milesgranger
Copy link
Author

Thanks @tom-dq!

The workaround for me was to just do everything inside of docker. This made it easier on Windows users, so far as they only need Python and Docker for dev, no more npm/serverless installs.

Now the Python project has a subcommand that does all the serverless stuff inside of the lambdaci docker container, thus dockerizePip: false, and been going well thus far.

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

No branches or pull requests

2 participants