Skip to content

WSL Unknown path format #371

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
davegravy opened this issue Jun 13, 2019 · 10 comments
Open

WSL Unknown path format #371

davegravy opened this issue Jun 13, 2019 · 10 comments

Comments

@davegravy
Copy link

On WSL Ubuntu 18.04LTS I'm getting

Unknown path format

when I use dockerizePip=true

in node_modules/serverless-python-requirements/lib/docker.js, getBindPath is being called with servicePath=="/home/davidg/lambda-serverless-test/.serverless/requirements"

That function seems to require the servicePath point to somewhere on my windows filesystem (/mnt/c/...) Is there no support for projects located in my wsl home directory?

FWIW I followed the README instructions regarding running under WSL and did step 1 and 2.

@BerserkerGaruk
Copy link

BerserkerGaruk commented Sep 13, 2019

I upgraded to WSL2 on the insider preview and get the same issue when running inside of a point not in /c/ (changed mount path). Flipping the !isWsl check in the bellow code (line 103-107)
function getBindPath(serverless, servicePath) { // Determine bind path if (process.platform !== 'win32' && isWsl) { return servicePath; }
Will allow the plugin to skip the getBindPath function from inside WSL, but it should be totally valid to run the serverless plugin completely inside of the WSL filesystem (even more so since in WSL2 there is a significant slowdown when accessing windows files as the linux is now its own filesystem now).

If I'm running inside WSL, but running my python code from inside the linux side of the filesystem and not the /c/ or /mnt/c/ mount the code checks that I have to have one of the following formats:
/'drive_letter'/
/mnt/c/
c:/
but will then fail as I don't throwing the error. If you bypass this entire function when it doesn't find a path format though it will succeed and run.

@jnguyen32
Copy link

Having this same issue as well.

@blbradley
Copy link

This became an issue starting in 5.x, 4.3.0 works well.

@satyajitghana
Copy link

any solutions ?

Using WSL2 with Docker-Desktop

  Error: Unknown path format owleaf/.cache/serverless-python-requirements/2eebda49882e665cca2bf1e3a571b1c2f6ec0d2bac04ecf76484eb7dce7fd498_slspyc...
      at getBindPath (/mnt/d/Courses/TSAI-DeepVision-EVA4.0-Phase-2/01-Deploy-To-AWS/sls-flask-ml-test/node_modules/serverless-python-requirements/lib/docker.js:132:11)
 Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              14.5.0
     Framework Version:         1.74.1
     Plugin Version:            3.6.15
     SDK Version:               2.3.1
     Components Version:        2.31.12

@tyjenkins
Copy link

I had the same issue.
After debugging a bit in node_modules/serverless-python-requirements/lib/docker.js I found that the correct path was being passed into the getBindPath function.
However there is an if statement at the top

// Determine bind path
  if (process.platform !== 'win32' && !isWsl) {
    return servicePath;
  }

For me

  • process.platform = linux
  • isWsl = true

So it does NOT immediately return servicePath; but continues on to some code that falls over.
To get it to work for me locally I put return servicePath; at the top of the function and it worked.

I am guessing this was added for the original WSL on windows and hasn't been updated for WSL2.

@juanmarin96
Copy link

Any update or fix for this bug?

@eddylit
Copy link

eddylit commented Aug 31, 2021

I am also looking for an update or fix as this is still occurring...

@wbraik
Copy link

wbraik commented Sep 18, 2021

How is it not fixed yet ? WSL 2 has been out for a while now...

@ECallihan
Copy link

Thanks so much @tyjenkins your solution worked for me.

@Stasmo
Copy link

Stasmo commented May 7, 2024

This was fixed in 5.4.x and can be closed.

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

Successfully merging a pull request may close this issue.