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

Opening Firefox on MacOS results in Cannot read property 'on' of undefined error #6356

Closed
fr0 opened this issue Feb 6, 2020 · 13 comments · Fixed by #6370
Closed

Opening Firefox on MacOS results in Cannot read property 'on' of undefined error #6356

fr0 opened this issue Feb 6, 2020 · 13 comments · Fixed by #6370
Assignees

Comments

@fr0
Copy link

fr0 commented Feb 6, 2020

Current behavior:

cypress open
select Firefox 72
start test
Firefox window opens to a blank page
Error happens, then cypress exits with Firefox still open

TypeError: Cannot read property 'on' of undefined
    at new CommandStream (/Users/crfrolik/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/marionette-client/lib/marionette/command-stream.js:25:12)
    at Tcp.<anonymous> (/Users/crfrolik/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/marionette-client/lib/marionette/drivers/tcp.js:81:19)
    at Timeout.waitForSocket [as _onTimeout] (/Users/crfrolik/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/socket-retry-connect/index.js:37:12)
    at listOnTimeout (internal/timers.js:533:17)
    at processTimers (internal/timers.js:475:7)

Versions

Cypress 4.0.0
Mac OS
Firefox 72.0.2 (64-bit)

@jennifer-shehane
Copy link
Member

Can you include the test code to run in Firefox to see this error please? This is likely relevant to the bug as just opening Cypress on our systems with any of our example and test repos does not produce this.

@jennifer-shehane jennifer-shehane added browser: firefox stage: needs information Not enough info to reproduce the issue v4.0.0 🐛 Issue present since 4.0.0 labels Feb 7, 2020
@AtofStryker
Copy link
Contributor

I also ran into this issue. Closing all instances of firefox and restarting the test runner fixed the issue for me

Versions
Cypress 4.0.0
Mac OS
Firefox 72.0.2 (64-bit)

@nottyo
Copy link

nottyo commented Feb 7, 2020

I face this issue as well. The ui test runner is crashed after starting the test. I also tried with an example spec files generated by Cypress and still found a crash.

OS: macOS 10.14.6 Mojave
Cypress: 4.0.0
Node: 12.15.0
Browser: Mozilla Firefox 72.0.2

@clarmso
Copy link
Contributor

clarmso commented Feb 7, 2020

I got the same error, too. Here's the snippet of the output after I picked Firefox 72. I got this output from DEBUG=* npx cypress open.

  cypress:server:open_project resetting project state, preparing to launch browser +3s
  cypress:server:project resetting project instance /Users/clare/Documents/workspace/Homepage +3s
  cypress:proxy:http:util:buffers resetting buffers +0ms
  cypress:server:server Setting remoteAuth undefined +4s
  cypress:network:cors Parsed URL { port: '5000', tld: 'localhost', domain: '' } +4s
  cypress:server:server Setting remoteOrigin http://localhost:5000 +1ms
  cypress:server:server Setting remoteHostAndPort { port: '5000', tld: 'localhost', domain: '' } +0ms
  cypress:server:server Setting remoteDocDomain localhost +0ms
  cypress:server:server Getting remote state: { auth: undefined, props: { port: '5000', tld: 'localhost', domain: '' }, origin: 'http://localhost:5000', strategy: 'http', visiting: undefined, domainName: 'localhost', fileServer: null } +0ms
  cypress:server:open_project launching browser: { channel: 'stable', displayName: 'Firefox', family: 'firefox', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', isChosen: true, majorVersion: 72, name: 'firefox', path: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', version: '72.0.2', isHeaded: true, isHeadless: false }, spec: cypress/integration/homepage.spec.js +47ms
  cypress:server:browsers getBrowserLauncher { browser: { channel: 'stable', displayName: 'Firefox', family: 'firefox', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', isChosen: true, majorVersion: 72, name: 'firefox', path: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', version: '72.0.2', isHeaded: true, isHeadless: false } } +10s
  cypress:server:browsers opening browser { channel: 'stable', displayName: 'Firefox', family: 'firefox', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', isChosen: true, majorVersion: 72, name: 'firefox', path: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', version: '72.0.2', isHeaded: true, isHeadless: false } +485ms
  cypress:server:browsers:firefox firefox open { projectRoot: '/Users/clare/Documents/workspace/Homepage', onBrowserOpen: [Function: onBrowserOpen], onBrowserClose: [Function], browsers: [ { name: 'chrome', family: 'chromium', channel: 'stable', displayName: 'Chrome', version: '80.0.3987.87', path: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', majorVersion: 80 }, { name: 'firefox', family: 'firefox', channel: 'stable', displayName: 'Firefox', version: '72.0.2', path: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', majorVersion: 72 }, { name: 'electron', channel: 'stable', family: 'chromium', displayName: 'Electron', version: '78.0.3904.130', path: '', majorVersion: 78, info: 'Electron is the default browser that comes with Cypress. This is the default browser that runs in headless mode. Selecting this browser is useful when debugging. The version number indicates the underlying Chromium version that Electron uses.' } ], proxyUrl: 'http://localhost:58740', userAgent: null, proxyServer: 'http://localhost:58740', socketIoRoute: '/__socket.io', chromeWebSecurity: true, url: 'http://localhost:5000/__/#/tests/integration/homepage.spec.js', isTextTerminal: false, browser: { channel: 'stable', displayName: 'Firefox', family: 'firefox', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', isChosen: true, majorVersion: 72, name: 'firefox', path: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', version: '72.0.2', isHeaded: true, isHeadless: false } } +0ms
  cypress:server:browsers:firefox available ports: { foxdriverPort: 58745, marionettePort: 58746 } +9ms
  cypress:server:browsers:utils writing extension +8s
  cypress:server:plugins plugin event registered? { event: 'before:browser:launch', isRegistered: false } +6s
  cypress:server:browsers:utils copied extension +89ms
  cypress:server:browsers:firefox firefox directories { path: '/Users/clare/Library/Application Support/Cypress/cy/production/browsers/firefox/interactive', cacheDir: '/Users/clare/Library/Application Support/Cypress/cy/production/browsers/firefox/interactive/CypressCache', extensionDest: '/Users/clare/Library/Application Support/Cypress/cy/production/browsers/firefox/interactive/CypressExtension' } +104ms
  cypress:server:browsers:firefox launch in firefox {
  url: 'http://localhost:5000/__/#/tests/integration/homepage.spec.js',
  args: [
    '-marionette',
    '-new-instance',
    '-foreground',
    '-start-debugger-server',
    '-profile',
    '/Users/clare/Library/Application Support/Cypress/cy/production/browsers/firefox/interactive'
  ]
} +10ms
  cypress:launcher launching browser { channel: 'stable', displayName: 'Firefox', family: 'firefox', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', isChosen: true, majorVersion: 72, name: 'firefox', path: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', version: '72.0.2', isHeaded: true, isHeadless: false } to open about:blank +8s
  cypress:launcher spawning browser { channel: 'stable', displayName: 'Firefox', family: 'firefox', info: 'Firefox support is currently in beta! You can help us continue to improve the Cypress + Firefox experience by [reporting any issues you find](https://on.cypress.io/new-issue).', isChosen: true, majorVersion: 72, name: 'firefox', path: '/Applications/Firefox.app/Contents/MacOS/firefox-bin', version: '72.0.2', isHeaded: true, isHeadless: false } with args about:blank -marionette -new-instance -foreground -start-debugger-server -profile /Users/clare/Library/Application Support/Cypress/cy/production/browsers/firefox/interactive +4ms
  cypress:server:browsers:firefox-util firefox: navigating page with webdriver +0ms
  socket-retry-connect attempt to open socket 58746 localhost +0ms
  cypress:network:connect received error on connect, retrying { iteration: 0, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +5s
  socket-retry-connect socket is not ready trying +8ms
  cypress:network:connect received error on connect, retrying { iteration: 1, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +104ms
  cypress:network:connect received error on connect, retrying { iteration: 2, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +106ms
  socket-retry-connect attempt to open socket 58746 localhost +255ms
  socket-retry-connect socket is not ready trying +3ms
  cypress:network:connect received error on connect, retrying { iteration: 3, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +103ms
  cypress:network:connect received error on connect, retrying { iteration: 4, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +109ms
  socket-retry-connect attempt to open socket 58746 localhost +250ms
  socket-retry-connect socket is not ready trying +2ms
  cypress:network:connect received error on connect, retrying { iteration: 5, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +109ms
  cypress:network:connect received error on connect, retrying { iteration: 6, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +101ms
  cypress:network:connect received error on connect, retrying { iteration: 7, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +105ms
  cypress:network:connect received error on connect, retrying { iteration: 8, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +105ms
  cypress:network:connect received error on connect, retrying { iteration: 9, delay: 100, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +104ms
  socket-retry-connect attempt to open socket 58746 localhost +516ms
  socket-retry-connect socket is not ready trying +2ms
  cypress:network:connect received error on connect, retrying { iteration: 10, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +101ms
  cypress:network:connect received error on connect, retrying { iteration: 11, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +506ms
  socket-retry-connect attempt to open socket 58746 localhost +750ms
  socket-retry-connect socket is not ready trying +2ms
  cypress:network:connect received error on connect, retrying { iteration: 12, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +505ms
  cypress:network:connect received error on connect, retrying { iteration: 13, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +501ms
  socket-retry-connect attempt to open socket 58746 localhost +1s
  socket-retry-connect socket is not ready trying +2ms
  cypress:network:connect received error on connect, retrying { iteration: 14, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +505ms
  cypress:network:connect received error on connect, retrying { iteration: 15, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +506ms
  socket-retry-connect attempt to open socket 58746 localhost +1s
  socket-retry-connect socket is not ready trying +30ms
  cypress:network:connect received error on connect, retrying { iteration: 16, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +501ms
  cypress:network:connect received error on connect, retrying { iteration: 17, delay: 500, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +508ms
  cypress:network:connect received error on connect, retrying { iteration: 18, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +502ms
  socket-retry-connect attempt to open socket 58746 localhost +2s
  socket-retry-connect socket is not ready trying +2ms
  cypress:server:events got request for event: get:project:status, { path: '/Users/clare/Documents/workspace/Homepage' } +7s
  cypress:server:project get project status for client id undefined at path /Users/clare/Documents/workspace/Homepage +7s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.19268446965427977, data: { path: '/Users/clare/Documents/workspace/Homepage', state: 'VALID' } } } +2ms
  cypress:network:connect received error on connect, retrying { iteration: 19, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +1s
  cypress-verbose:server:util:process_profiler all Cypress-launched processes: [
  {
    pid: 11030,
    parentPid: 11025,
    name: 'Cypress',
    pcpu: 6.9,
    pcpuu: 0,
    pcpus: 0,
    pmem: 1.9,
    priority: 46,
    mem_vsz: 6037876,
    mem_rss: 78208,
    nice: 0,
    started: '2020-02-06 23:43:05',
    state: 'sleeping',
    tty: 'ttys001',
    user: 'clare',
    command: 'Cypress',
    params: '--no-sandbox -- --project /Users/clare/Documents/workspace/Homepage --cwd /Users/clare/Documents/workspace/Homepage',
    path: '/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/MacOS',
    group: 'cypress'
  },
  {
    pid: 11117,
    parentPid: 11030,
    name: 'firefox-bin about:blank',
    pcpu: 49.5,
    pcpuu: 0,
    pcpus: 0,
    pmem: 1.7,
    priority: 47,
    mem_vsz: 6715060,
    mem_rss: 71012,
    nice: 0,
    started: '2020-02-06 23:43:40',
    state: 'running',
    tty: 'ttys001',
    user: 'clare',
    command: 'firefox-bin about:blank',
    params: '-marionette -new-instance -foreground -start-debugger-server -profile /Users/clare/Library/Application Support/Cypress/cy/production/browsers/firefox/interactive',
    path: '/Applications/Firefox.app/Contents/MacOS',
    group: 'other'
  },
  {
    pid: 11034,
    parentPid: 11030,
    name: 'Cypress Helper (GPU)',
    pcpu: 14.3,
    pcpuu: 0,
    pcpus: 0,
    pmem: 0.5,
    priority: 31,
    mem_vsz: 4578936,
    mem_rss: 22136,
    nice: 0,
    started: '2020-02-06 23:43:11',
    state: 'running',
    tty: 'ttys001',
    user: 'clare',
    command: 'Cypress Helper (GPU)',
    params: '--type=gpu-process --field-trial-handle=1718379636,13054038478554075484,9142871717285644888,131072 --disable-features=SpareRendererForSitePerProcess --no-sandbox --gpu-preferences=KAAAAAAAAAAgAAAAAAAAAAAAYAAAAAAAEAAAAAAAAAAAAAAAAAAAAOgAAAAcAAAA4AAAAAAAAADoAAAAAAAAAPAAAAAAAAAA+AAAAAAAAAAAAQAAAAAAAAgBAAAAAAAAEAEAAAAAAAAYAQAAAAAAACABAAAAAAAAKAEAAAAAAAAwAQAAAAAAADgBAAAAAAAAQAEAAAAAAABIAQAAAAAAAFABAAAAAAAAWAEAAAAAAABgAQAAAAAAAGgBAAAAAAAAcAEAAAAAAAB4AQAAAAAAAIABAAAAAAAAiAEAAAAAAACQAQAAAAAAAJgBAAAAAAAAoAEAAAAAAACoAQAAAAAAALABAAAAAAAAuAEAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAABgAAABAAAAAAAAAAAAAAAAcAAAAQAAAAAAAAAAAAAAAIAAAAEAAAAAAAAAAAAAAACgAAABAAAAAAAAAAAAAAAAsAAAAQAAAAAAAAAAAAAAANAAAAEAAAAAAAAAABAAAAAAAAABAAAAAAAAAAAQAAAAYAAAAQAAAAAAAAAAEAAAAHAAAAEA',
    path: '/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Frameworks/Cypress Helper (GPU).app/Contents/MacOS',
    group: 'electron-shared'
  },
  {
    pid: 11042,
    parentPid: 11030,
    name: 'Cypress Helper (Renderer)',
    pcpu: 4.7,
    pcpuu: 0,
    pcpus: 0,
    pmem: 1.4,
    priority: 31,
    mem_vsz: 4802688,
    mem_rss: 58628,
    nice: 0,
    started: '2020-02-06 23:43:27',
    state: 'sleeping',
    tty: 'ttys001',
    user: 'clare',
    command: 'Cypress Helper (Renderer)',
    params: '--type=renderer --no-sandbox --autoplay-policy=no-user-gesture-required --use-fake-ui-for-media-stream --field-trial-handle=1718379636,13054038478554075484,9142871717285644888,131072 --disable-features=SpareRendererForSitePerProcess --lang=en-US --app-path=/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app --no-sandbox --no-zygote --preload=/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/lib/ipc/ipc.js --background-color=#dfe2e4 --num-raster-threads=2 --enable-zero-copy --enable-gpu-memory-buffer-compositor-resources --enable-main-frame-before-activation --service-request-channel-token=10980189874776918510 --renderer-client-id=5',
    path: '/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Frameworks/Cypress Helper (Renderer).app/Contents/MacOS',
    group: 'desktop-gui'
  },
  {
    pid: 11120,
    parentPid: 11030,
    name: 'sh',
    pcpu: 0,
    pcpuu: 0,
    pcpus: 0,
    pmem: 0,
    priority: 31,
    mem_vsz: 4279096,
    mem_rss: 1004,
    nice: 0,
    started: '2020-02-06 23:43:46',
    state: 'sleeping',
    tty: 'ttys001',
    user: 'clare',
    command: 'sh',
    params: '-c export LC_ALL=C; ps -axo pid,ppid,pcpu,pmem,pri,vsz,rss,nice,lstart,state,tty,user,command -r; unset LC_ALL',
    path: '/bin',
    group: 'other'
  },
  {
    pid: 11121,
    parentPid: 11120,
    name: 'ps',
    pcpu: 0,
    pcpuu: 0,
    pcpus: 0,
    pmem: 0,
    priority: 31,
    mem_vsz: 4270516,
    mem_rss: 728,
    nice: 0,
    started: '2020-02-06 23:43:46',
    state: 'running',
    tty: 'ttys001',
    user: 'root',
    command: 'ps',
    params: '-axo pid,ppid,pcpu,pmem,pri,vsz,rss,nice,lstart,state,tty,user,command -r',
    path: '',
    group: 'other'
  },
  {
    pid: 11111,
    parentPid: 11030,
    name: 'Cypress Helper',
    pcpu: 0,
    pcpuu: 0,
    pcpus: 0,
    pmem: 0.5,
    priority: 31,
    mem_vsz: 4669288,
    mem_rss: 18892,
    nice: 0,
    started: '2020-02-06 23:43:32',
    state: 'sleeping',
    tty: 'ttys001',
    user: 'clare',
    command: 'Cypress Helper',
    params: '/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/index.js --file /Users/clare/Documents/workspace/Homepage/cypress/plugins/index.js',
    path: '/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Frameworks/Cypress Helper.app/Contents/MacOS',
    group: 'plugin'
  },
  {
    pid: 11040,
    parentPid: 11030,
    name: 'Cypress Helper',
    pcpu: 0,
    pcpuu: 0,
    pcpus: 0,
    pmem: 0.2,
    priority: 31,
    mem_vsz: 4540640,
    mem_rss: 9720,
    nice: 0,
    started: '2020-02-06 23:43:26',
    state: 'sleeping',
    tty: 'ttys001',
    user: 'clare',
    command: 'Cypress Helper',
    params: '--type=utility --field-trial-handle=1718379636,13054038478554075484,9142871717285644888,131072 --disable-features=SpareRendererForSitePerProcess --lang=en-US --service-sandbox-type=network --no-sandbox --ignore-certificate-errors=true --use-fake-device-for-media-stream --ignore-certificate-errors=true --service-request-channel-token=7159383392032820528',
    path: '/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Frameworks/Cypress Helper.app/Contents/MacOS',
    group: 'electron-shared'
  }
] +11s
  cypress:server:util:process_profiler current & mean memory and CPU usage by process group:
  cypress:server:util:process_profiler ┌─────────┬───────────────────┬──────────────┬───────────────────────┬────────────┬────────────────┬──────────┬──────────────┬─────────────┐
  cypress:server:util:process_profiler │ (index) │       group       │ processCount │         pids          │ cpuPercent │ meanCpuPercent │ memRssMb │ meanMemRssMb │ maxMemRssMb │
  cypress:server:util:process_profiler ├─────────┼───────────────────┼──────────────┼───────────────────────┼────────────┼────────────────┼──────────┼──────────────┼─────────────┤
  cypress:server:util:process_profiler │    0    │     'cypress'     │      1       │        '11030'        │    6.9     │      30.5      │  76.38   │     84.6     │    98.04    │
  cypress:server:util:process_profiler │    1    │      'other'      │      3       │ '11117, 11120, 11121' │    49.5    │      16.5      │  71.04   │     24.8     │    71.04    │
  cypress:server:util:process_profiler │    2    │   'desktop-gui'   │      1       │        '11042'        │    4.7     │      5.2       │  57.25   │    69.78     │    82.3     │
  cypress:server:util:process_profiler │    3    │ 'electron-shared' │      2       │    '11034, 11040'     │    14.3    │       11       │  31.11   │    31.27     │    31.43    │
  cypress:server:util:process_profiler │    4    │     'plugin'      │      1       │        '11111'        │     0      │       0        │  18.45   │    24.42     │    30.39    │
  cypress:server:util:process_profiler │    5    │      'TOTAL'      │      8       │          '-'          │    75.4    │      57.8      │  254.23  │    193.04    │   254.23    │
  cypress:server:util:process_profiler └─────────┴───────────────────┴──────────────┴───────────────────────┴────────────┴────────────────┴──────────┴──────────────┴─────────────┘ +11s
  cypress:network:connect received error on connect, retrying { iteration: 20, delay: 1000, err: Error: connect ECONNREFUSED 127.0.0.1:58745     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1056:14) { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 58745 } } +1s
  socket-retry-connect attempt to open socket 58746 localhost +2s
  socket-retry-connect socket is not ready trying +2ms
  cypress:network:connect successfully connected { opts: { host: '127.0.0.1', port: 58745, getDelayMsForRetry: [Function: getDelayMsForRetry] }, iteration: 21 } +1s
info @benmalka/foxdriver:Client request: {"to":"root","type":"listTabs"}
info @benmalka/foxdriver:Client response: {"from":"root","applicationType":"browser","testConnectionPrefix":"server1.conn1.","traits":{"sources":true,"networkMonitor":true,"storageInspector":true,"wasmBinarySource":true,"bulk":true,"webConsoleCommands":true,"allowChromeProcess":true,"heapSnapshots":true,"perfActorVersion":1,"watchpoints":true}}
info @benmalka/foxdriver:Client response: {"preferenceActor":"server1.conn1.preferenceActor1","actorRegistryActor":"server1.conn1.actorRegistryActor2","addonsActor":"server1.conn1.addonsActor3","deviceActor":"server1.conn1.deviceActor4","heapSnapshotFileActor":"server1.conn1.heapSnapshotFileActor5","perfActor":"server1.conn1.perfActor6","selected":0,"tabs":[],"from":"root"}
  socket-retry-connect attempt to open socket 58746 localhost +2s
  socket-retry-connect socket is not ready trying +9ms
  socket-retry-connect attempt to open socket 58746 localhost +2s
  marionette:tcp got socket starting command stream +0ms
  cypress:server:file get values from /Users/clare/Library/Application Support/Cypress/cy/production/cache +21s
  cypress:server:file attempt to get lock on /Users/clare/Library/Application Support/Cypress/cy/production/cache +0ms
  cypress:server:file gettin lock succeeded or failed for /Users/clare/Library/Application Support/Cypress/cy/production/cache +20ms
  cypress:server:file read /Users/clare/Library/Application Support/Cypress/cy/production/cache +0ms
  cypress:server:file read succeeded or failed for /Users/clare/Library/Application Support/Cypress/cy/production/cache +84ms
  cypress:server:file attempt to unlock /Users/clare/Library/Application Support/Cypress/cy/production/cache +0ms
  cypress:server:file unlock succeeded or failed for /Users/clare/Library/Application Support/Cypress/cy/production/cache +3ms
  cypress:server:api request to url: POST https://api.cypress.io/exceptions with params: {"body":{"err":{"name":"TypeError","message":"Cannot read property 'on' of undefined","stack":"TypeError: Cannot read property 'on' of undefined\n    at new CommandStream (<stripped-path>command-stream.js:25:12)\n    at Tcp.<anonymous> (<stripped-path>tcp.js:81:19)\n    at Timeout.waitForSocket [as _onTimeout] (<stripped-path>index.js:37:12)\n    at listOnTimeout (internal<stripped-path>timers.js:533:17)\n    at processTimers (internal<stripped-path>timers.js:475:7)\n"},"version":"4.0.0","osName":"darwin","osVersion":"19.2.0","osCpus":[{"model":"Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz","speed":1800,"times":{"user":12178710,"nice":0,"sys":12241210,"idle":14189430,"irq":0}},{"model":"Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz","speed":1800,"times":{"user":5743320,"nice":0,"sys":7514370,"idle":25348210,"irq":0}},{"model":"Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz","speed":1800,"times":{"user":12276210,"nice":0,"sys":12337590,"idle":13992110,"irq":0}},{"model":"Intel(R) Core(TM) i5-3427U CPU @ 1.80GHz","speed":1800,"times":{"user":5262650,"nice":0,"sys":6410510,"idle":26932720,"irq":0}}],"osMemory":{"free":25260032,"total":4294967296}},"headers":{"x-os-name":"darwin","x-cypress-version":"4.0.0"}} and token: undefined +0ms
  cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/exceptions' } +24s
  cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 } +5s
  cypress:network:connect got addresses { hostname: 'api.cypress.io', port: 443, addresses: [ { address: '104.26.6.176', family: 4 }, { address: '104.26.7.176', family: 4 } ] } +1s
TypeError: Cannot read property 'on' of undefined
    at new CommandStream (/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/marionette-client/lib/marionette/command-stream.js:25:12)
    at Tcp.<anonymous> (/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/marionette-client/lib/marionette/drivers/tcp.js:81:19)
    at Timeout.waitForSocket [as _onTimeout] (/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/socket-retry-connect/index.js:37:12)
    at listOnTimeout (internal/timers.js:533:17)
    at processTimers (internal/timers.js:475:7)

TypeError: Cannot read property 'on' of undefined
    at new CommandStream (/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/marionette-client/lib/marionette/command-stream.js:25:12)
    at Tcp.<anonymous> (/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/marionette-client/lib/marionette/drivers/tcp.js:81:19)
    at Timeout.waitForSocket [as _onTimeout] (/Users/clare/Library/Caches/Cypress/4.0.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/socket-retry-connect/index.js:37:12)
    at listOnTimeout (internal/timers.js:533:17)
    at processTimers (internal/timers.js:475:7)

  cypress:network:agent got family { family: 4, href: 'https://api.cypress.io/exceptions' } +2s
  cypress:server:server Got CONNECT request from location.services.mozilla.com:443 +16s
  cypress:https-proxy Writing browserSocket connection headers { url: 'location.services.mozilla.com:443', headLength: 0, headers: { 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:72.0) Gecko/20100101 Firefox/72.0', 'proxy-connection': 'keep-alive', connection: 'keep-alive', host: 'location.services.mozilla.com:443' } } +20s
  cypress:cli child event fired { event: 'exit', code: 0, signal: null } +51s
  cypress:cli child event fired { event: 'close', code: 0, signal: null } +9ms

I got the same error even after switching repo and closing all instances of Firefox. Here's one of the repo: https://github.com/clarmso/xkcd-throw-calculator-cypress

Cypress 4.0.0
Mac OS Catalina Version 10.15.2
Firefox 72.0.2 (64-bit)

@jennifer-shehane jennifer-shehane changed the title Trying to use Firefox just results in an error Opening Firefox on MacOS results in Cannot read property 'on' of undefined error Feb 7, 2020
@cypress-bot cypress-bot bot added stage: needs investigating Someone from Cypress needs to look at this and removed stage: needs information Not enough info to reproduce the issue labels Feb 7, 2020
@jennifer-shehane
Copy link
Member

jennifer-shehane commented Feb 7, 2020

I am also seeing this error upon opening Firefox during cypress open on MacOS, so we do not need any more information provided since we can reproduce.

I am running cypress-example-kitchensink - this did NOT occur for me as an error during the prerelease as of this commit: 0887302

I did not test run Firefox in MacOS after that commit, so it may be something involved with a commit after or with the merge/build.

Notably when I open Firefox, there is a blank new tab as the first tab and then this second tab shown below.

Screen Shot 2020-02-07 at 12 32 14 PM

Full debug logs:
firefox-launch.log

Workaround

Firefox Developer Edition seems to open fine for me, so you could potentially download this release candidate to run in Firefox in the meantime. https://www.mozilla.org/firefox/developer/

@Kocal
Copy link
Contributor

Kocal commented Feb 7, 2020

I have the same issue on GitHub Actions but with Ubuntu 18.04.

@YOU54F
Copy link
Contributor

YOU54F commented Feb 7, 2020

Just to add further complication to the mix, I have just upgraded our works test suite to cypress 4.0.0 and on cypress open it detected my firefox 72.0.2 64bit installation, on mojave 10.15.2 and it works absolutely a-ok. (node v12.13.1)

Every test is passing correctly, with expection to those which required chromeWebSecurity to be set to false, which is as expected

@kedruff
Copy link

kedruff commented Feb 7, 2020

Additional datapoint: I encountered the same crash as @fr0 when I trigger cypress and Firefox is already open. After closing Firefox, I was able to successfully run my test suite.

edit: Further Additional Context: as @jennifer-shehane first pointed out: with Developer Edition you can open multiple windows at the same time. So, it appears this bug is limited (for the time being) to Firefox 72.

@YOU54F
Copy link
Contributor

YOU54F commented Feb 7, 2020

Additional datapoint: I encountered the same crash as @fr0 when I trigger cypress and Firefox is already open. After closing Firefox, I was able to successfully run my test suite.

edit: Further Additional Context: as @jennifer-shehane first pointed out: with Developer Edition you can open multiple windows at the same time. So, it appears this bug is limited (for the time being) to Firefox 72.

Just tested this and I get the same issue with firefox open, prior to opening cypress.

@clarmso
Copy link
Contributor

clarmso commented Feb 7, 2020

@jennifer-shehane I just reproduce the error on Ubuntu 16.04, so the error isn't specific to Mac OS.

@flotwig
Copy link
Contributor

flotwig commented Feb 7, 2020

This error is easy to reproduce by opening Firefox in two side-by-side Cypress's in GUI mode. Since they share a profile, it will fail, because Firefox will not have opened Marionette at the right port.

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels Feb 7, 2020
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels Feb 7, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 7, 2020

The code for this is done in cypress-io/cypress#6370, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 8, 2020

Released in 4.0.1.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.0.1, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Feb 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants