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

shared memfd open() failed: Function not implemented | trying to run cypress in WSL #4145

Closed
Labels
stage: needs information Not enough info to reproduce the issue stale no activity on this issue for a long period

Comments

@pandasanjay
Copy link

pandasanjay commented May 6, 2019

Current behavior:

I am using WSL as my development env. Now when I am trying to run Cypress . This gives me
shared memfd open() failed: Function not implemented

Steps to reproduce: (app code and test code)

./node_modules/.bin/cypress open
o/p- shared memfd open() failed: Function not implemented

Versions

Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

Is this a issue with cypress?

@jennifer-shehane
Copy link
Member

We haven't seen this issue before.

I suggest you try the troubleshooting tips from WSL: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting

Could you run Cypress in debug mode mode and print the logs here also?

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label May 7, 2019
@pandasanjay
Copy link
Author

pandasanjay commented May 7, 2019

Hi @jennifer-shehane

Here is the debugged o/p below
DEBUG=cypress:* ./node_modules/.bin/cypress open

  cypress:cli cli starts with arguments ["/usr/bin/node","/mnt/c/Users/panda/workspace/gca-admin/node_modules/cypress/bin/cypress","open"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli program parsing arguments +3ms
  cypress:cli opening Cypress +1ms
  cypress:cli parsed cli options {} +700ms
  cypress:cli opening from options {"project":"/mnt/c/Users/panda/workspace/gca-admin"} +0ms
  cypress:cli command line arguments ["--project","/mnt/c/Users/panda/workspace/gca-admin"] +0ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +1ms
  cypress:cli checking if executable exists /home/panda/.cache/Cypress/3.2.0/Cypress/Cypress +17ms
  cypress:cli Binary is executable? : true +6ms
  cypress:cli binaryDir is  /home/panda/.cache/Cypress/3.2.0/Cypress +0ms
  cypress:cli Reading binary package.json from: /home/panda/.cache/Cypress/3.2.0/Cypress/resources/app/package.json +0ms
  cypress:cli Found binary version 3.2.0 installed in: /home/panda/.cache/Cypress/3.2.0/Cypress +5ms
  cypress:cli { verified: true } +6ms
  cypress:cli is Verified ? true +4ms
  cypress:cli needs XVFB? true +0ms
  cypress:cli Starting XVFB +0ms
  cypress:cli spawning Cypress with executable: /home/panda/.cache/Cypress/3.2.0/Cypress/Cypress +248ms
  cypress:cli spawn forcing env overrides { FORCE_COLOR: '1', DEBUG_COLORS: '1', MOCHA_COLORS: '1', FORCE_STDIN_TTY: '1', FORCE_STDOUT_TTY: '1', FORCE_STDERR_TTY: '1' } +0ms
  cypress:cli spawn args [ '--project', '/mnt/c/Users/panda/workspace/gca-admin', '--cwd', '/mnt/c/Users/panda/workspace/gca-admin' ] { dev: undefined, detached: false, stdio: 'inherit' } +2ms
  cypress:ts Running without ts-node hook in environment "production" +0ms
  cypress:server:cypress starting cypress with argv [ '/home/panda/.cache/Cypress/3.2.0/Cypress/Cypress', '--project', '/mnt/c/Users/panda/workspace/gca-admin', '--cwd', '/mnt/c/Users/panda/workspace/gca-admin' ] +0ms
  cypress:server:args argv array: [ 
    '/home/panda/.cache/Cypress/3.2.0/Cypress/Cypress', 
    '--project', '/mnt/c/Users/panda/workspace/gca-admin', 
    '--cwd', '/mnt/c/Users/panda/workspace/gca-admin' 
  ] +3s
  cypress:server:args argv parsed: { _: [ 
    '/home/panda/.cache/Cypress/3.2.0/Cypress/Cypress' ], 
    project: '/mnt/c/Users/panda/workspace/gca-admin', 
    cwd: '/mnt/c/Users/panda/workspace/gca-admin' 
  } +5ms
  cypress:server:args argv options: { _: [ 
    '/home/panda/.cache/Cypress/3.2.0/Cypress/Cypress' 
  ], 
  project: '/mnt/c/Users/panda/workspace/gca-admin', 
  cwd: '/mnt/c/Users/panda/workspace/gca-admin', 
  config: {}, 
  projectRoot: '/mnt/c/Users/panda/workspace/gca-admin' 
  } +1ms

**shared memfd open() failed: Function not implemented**

  cypress:server:appdata path: /home/panda/.config/Cypress/cy/production +1s
  cypress:server:cypress starting in mode interactive +15ms
  cypress:server:appdata path: /home/panda/.config/Cypress/cy/production +4s
  cypress:server:appdata path: /home/panda/.config/Cypress/cy/production/cache +17ms
  cypress:server:appdata path: /home/panda/.config/Cypress/cy/production/browsers +26s
  cypress:server:timers queuing timer id 1 after 500 ms +51ms
  cypress:server:timers child received timer id 1 +0ms
  cypress:server:timers child sending timer id 1 +505ms
  cypress:server:timers clearing timer id 1 from queue { '1': { args: [], ms: 500, cb: [Function] } } +510ms
  cypress:server:saved_state making saved state from /home/panda/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server +6ms
  cypress:server:saved_state for project path /mnt/c/Users/panda/workspace/gca-admin +1ms
  cypress:server:saved_state state path for project /mnt/c/Users/panda/workspace/gca-admin +2ms
  cypress:server:appdata path: /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +1ms
  cypress:server:saved_state full state path /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +1ms
  cypress:server:saved_state making new state file around /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +0ms
  cypress:server:file get values from /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +1ms
  cypress:server:file attempt to get lock on /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +1ms
  cypress:server:file gettin lock succeeded or failed for /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +4ms
  cypress:server:file read /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +1ms
  cypress:server:file read succeeded or failed for /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +3ms
  cypress:server:file attempt to unlock /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +0ms
  cypress:server:timers queuing timer id 2 after 2000 ms +1ms
  cypress:server:timers child received timer id 2 +25ms
  cypress:server:timers clearing timer id 2 from queue { '2': { args: [], ms: 2000, cb: [Function: timeoutTimeout] } } +2ms
  cypress:server:file unlock succeeded or failed for /home/panda/.config/Cypress/cy/production/projects/gca-admin-302fb8fc469922df75cbe90233a955aa/state.json +0ms
  cypress:server:windows creating electron window with options { backgroundColor: '#dfe2e4', width: 800, height: 550, minWidth: 458, minHeight: 400, x: null, y: null, type: 'INDEX', devTools: false, trackState: { width: 'appWidth', height: 'appHeight', x: 'appX', y: 'appY', devTools: 'isAppDevToolsOpen' }, onBlur: [Function: onBlur], onFocus: [Function:
onFocus], onClose: [Function: onClose], show: true, frame: true, transparent: false, icon: NativeImage {}, url: 'file:///home/panda/.cache/Cypress/3.2.0/Cypress/resources/app/packages/desktop-gui/dist/index.html', webPreferences: { preload: '/home/panda/.cache/Cypress/3.2.0/Cypress/resources/app/packages/server/lib/ipc/ipc.js', partition: null, chromeWebSecurity: true, nodeIntegration: false, backgroundThrottling: false, backgroundColor: '#dfe2e4', transparent: false }, contextMenu: false, recordFrameRate: null, onPaint: null, onCrashed: [Function: onCrashed], onNewWindow: [Function: onNewWindow] } +163ms
  cypress:server:timers child sending timer id 2 +2s

@pandasanjay
Copy link
Author

Hi @jennifer-shehane

Any finding with this issue? Please let me know anything extra you need..

@jennifer-shehane
Copy link
Member

No, I don't know what is causing this error. Seems isolated to WSL.

@justin-bits
Copy link

@pandasanjay, I'm having the same issue. Were you able to find a workaround?

@pandasanjay
Copy link
Author

pandasanjay commented Jul 30, 2019

@justin-bits WSL 1 I didn't find the solution yet.

With WSL 2 you can run Headless mode without any issue. I think we can run the Cypress open also, but might need some env config.

https://docs.microsoft.com/en-us/windows/wsl/wsl2-install

@justin-bits
Copy link

justin-bits commented Jul 31, 2019

Thanks for the tip, but I wasn't able to get Cypress open working under WSL 2. It starts without error, but the GUI never opens. It looks like Cypress does not support running under Windows WSL / Ubuntu.

This will prevent me from testing against local builds (which natively run on Linux and won't build on Windows without WSL).

@tgelu
Copy link

tgelu commented Aug 1, 2019

+1

@DanielStoica85
Copy link

Just ran into the same issue. Is there any solution for this?

@justin-bits
Copy link

justin-bits commented Sep 19, 2019

I ended up abandoning trying to get WSL to work and ended up running application builds and Cypress in Git Bash after changing the shell: npm config set script-shell "C:/Program Files/git/bin/bash.exe".

@pandasanjay
Copy link
Author

Finally I found a way which working awesome without any issue in WSL2!

First we have to setup X server (Which is a Desktop like environment) for WSL2.
Follow this post please : Xserver setup in WSL2

Then try to run cypress and you will see the UI is working.

@tomcanham
Copy link

@pandasanjay I'm still having no luck. In fact, here's a ss of getting the same error IN XFCE4 under WSL2:

image

Anyone else gone down this road? Or is headed Cypress just not going to work under WSL? If so, Cypress folks, this is a bit of a showstopper; there are more devs than you might think working under WSL(2) these days -- just FYI.

@tomcanham
Copy link

Looks like this is probably the root cause: microsoft/WSL#3542

@tomcanham
Copy link

Resolved: for me, it was a no-brainer. Although I had WSL2 installed, I hadn't set it as the default subsystem. So when I (re)installed Debian, it used WSL1. Switching to WSL2 (and running under xfce/firefox) worked. So make sure to do a wsl -l -v and make sure you're running under WSL2 if you want a UI :)

@dcharlespyle
Copy link

dcharlespyle commented Aug 24, 2020

I see the exact same error running Pale Moon browser on WSL1, when a video is run using it.

image

This would suggest that WSL1 is involved, as it uses an emulated kernel, unlike WSL2, which uses a real Linux kernel. Best to use WSL2 if you don't want to see this error message with any application used in an emulated Linux environment, and this would include use of cypress-io.

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 18, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment