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

RangeError: Maximum call stack size exceeded at _deconstructPacket in CI Pipeline #15101

Closed
poponuts opened this issue Feb 16, 2021 · 47 comments · Fixed by #16311
Closed

RangeError: Maximum call stack size exceeded at _deconstructPacket in CI Pipeline #15101

poponuts opened this issue Feb 16, 2021 · 47 comments · Fixed by #16311
Assignees
Labels
type: regression A bug that didn't appear until a specific Cy version release v6.5.0 🐛 Issue present since 6.5.0

Comments

@poponuts
Copy link

poponuts commented Feb 16, 2021

Current behavior

Upgrading to cypress version 6.5.0 and running it on Bitbucket Pipeline CI via parallel tests, the error is encountered:

RangeError: Maximum call stack size exceeded
    at _deconstructPacket (/root/.cache/Cypress/6.5.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:21:28)
    at _deconstructPacket (/root/.cache/Cypress/6.5.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)
...
at _deconstructPacket (/root/.cache/Cypress/6.5.0/Cypress/resources/app/packages/socket/node_modules/socket.io-The Test Runner unexpectedly exited via a exit event with signal SIGILL

I've checked similar issues in the past and they have been fixed by succeeding Cypress versions. Could it be on the package.json and package-lock.json having the latest version Cypress v6.5.0 while my docker image is still pointing to cypress/base:14.15.4

Desired behavior

The Test runner should not exit in the CI pipeline and continue to generate test results.

Test code to reproduce

bitbucket-pipelines.yml

image: cypress/base:14.15.4
options:
  max-time: 20

tests: &tests
  name: Run tests
  caches:
    - node
    - cypress
  script:
    - set +e # continue executing next steps regardless of errors
    - cypress_version=$HOST npx cypress run --record --key $CYPRESS_DASHBOARD_KEY --parallel --ci-build-id $BITBUCKET_BUILD_NUMBER
  artifacts:
    - cypress/screenshots/**
    - cypress/videos/**
    - cypress/test-reports/mocha/*.json
    - cypress/test-reports/junit.xml

pipelines:
  default:
  - step:
      name: Prepare dependencies
      caches:
        - npm
        - cypress
        - node
      script:
        - npm ci
        - npx @bahmutov/print-env BITBUCKET # let's see the environment variables right away
  - parallel: # run N steps in parallel
    - step:
        <<: *tests
    - step:
        <<: *tests
    - step:
        <<: *tests
definitions:
  caches:
    npm: $HOME/.npm
    cypress: $HOME/.cache/Cypress

Versions

Cypress version 6.5.0
Running locally on MacOS works fine.
Running on Bitbucket pipeline CI is when the issue is encountered.

@ronnyek
Copy link

ronnyek commented Feb 16, 2021

We too just started seeing this in our CI/CD pipelines just last night. I'm not sure if we recently just upgraded the version of cypress we target, but definitely happening now.

So we were targeting ^6.3.0, and since 6.5 was released 19hr ago, we must have just grabbed the latest 6.5 and started encountering these problems.

@syedmuhdahmad
Copy link

syedmuhdahmad commented Feb 22, 2021

Reverting the cypress to 6.4.0 has fixed this issue for some reason. Only one thing is common between @poponuts and my code is the definition part

definitions:
caches:
npm: $HOME/.npm
cypress: $HOME/.cache/Cypress

@CypressHarry
Copy link

A user has reported that these errors no longer appear after upgrading to version 6.6.0. Can others here confirm that the issue is solved upon upgrade?

@dingraham01
Copy link

@CypressHarry
I am still seeing it after upgrading to 6.6.0.

RangeError: Maximum call stack size exceeded at _deconstructPacket (/root/.cache/Cypress/6.6.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:21:28)

@TimVee
Copy link

TimVee commented Mar 4, 2021

I have the same problem, but locally on Windows. I'm on Cypress 6.6.0.

@TimVee
Copy link

TimVee commented Mar 5, 2021

I got this bug to occur consistently in open mode by making a request with a timeout that is shorter than the request takes. I made a small repo with a reproducible example: https://github.com/TimVee/deconstructPacked-bug.

@dingraham01
Copy link

This bug is preventing our team from upgrading to any Cypress version past 6.4.
Is there any traction on this? Thanks.

@poponuts
Copy link
Author

poponuts commented Mar 12, 2021

Now, with 6.6.0, even on my local machine, it is producing same error. With 6.5.0, it was only on our CI pipeline. Trying to isolate the problem, It seems to fail on a spec file that uses Cypress.Promise . Further error message:

    at Promise._settlePromiseFromHandler (/Users/poponuts/Library/Caches/Cypress/6.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/poponuts/Library/Caches/Cypress/6.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/poponuts/Library/Caches/Cypress/6.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/poponuts/Library/Caches/Cypress/6.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/Users/poponuts/Library/Caches/Cypress/6.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/poponuts/Library/Caches/Cypress/6.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/poponuts/Library/Caches/Cypress/6.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/poponuts/Library/Caches/Cypress/6.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:456:21)

@poponuts
Copy link
Author

Hi @CypressHarry I hope this is being looked at by the team. @TimVee already provided a reproducible repo.

By the way, I get same error on tests/specs that does not contain Cypress.Promise too. Will need to downgrade to 6.4.0 as a workaround.

@grant-dot-dev
Copy link

grant-dot-dev commented Mar 17, 2021

I'm having this same issue on 6.6.0 will this all be fixed in 6.7.2?

@hmonglee
Copy link

Same issue with 6.7.1

@RobbeCl
Copy link

RobbeCl commented Mar 20, 2021

Same in 6.8.0

@hmonglee
Copy link

downgrade to 6.4.0 and it's work.... please fix this

@creage
Copy link

creage commented Mar 23, 2021

@jennifer-shehane can we have your attention to this issue please? It is a blocking one, preventing from upgrading to the latest Cypress for many people here.

@t00
Copy link

t00 commented Mar 23, 2021

@jennifer-shehane I created a new issue as instructed by support and included an app to reproduce the same issue: #15629

@t00
Copy link

t00 commented Mar 23, 2021

For anyone having an issue with slowly responding tested api - temporarily changing responseTimeout in cypress.json to a value higher than 30000 should fix the issue but will cause tests which should fail in 30 seconds - to pass.

{
  "responseTimeout": 60000
}

@shutchison-bai
Copy link

Also experiencing this. Downgraded to 6.4.0 for now.

@jasonw-rr
Copy link

I start seeing this in the past 2 weeks, and downgraded to v6.4.0 worked for me

@poponuts
Copy link
Author

This is still an issue. @bahmutov @jennifer-shehane any inputs on this? (someone provided a replicable repo above)
For additional error message (so Cypress team can isolate the possible problematic packages):

at Socket.packet (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/socket/node_modules/socket.io/dist/socket.js:161:21)
    at /Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/socket/node_modules/socket.io/dist/socket.js:270:18
    at /Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/lib/socket-base.js:312:28
    at tryCatcher (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/promise.js:725:18)
    at _drainQueueStep (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/Users/poponuts/Library/Caches/Cypress/6.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (internal/timers.js:456:21)

@lookininward
Copy link

Have also been experiencing this issue on test suite that runs to successful completion locally and most of the time in CI (Github Actions).

@lookininward
Copy link

lookininward commented Mar 31, 2021

Downgrading to 6.4.0 has also solved the issue for us, was experiencing it on 6.5.0 up to 6.8.0.

@prashant-kajale
Copy link

same issue on 6.8

@poponuts
Copy link
Author

poponuts commented Apr 5, 2021

The issue still persists on 7.0.0

@t00
Copy link

t00 commented Apr 6, 2021

@jennifer-shehane will a hot-fix release be available soon?

@mysticdevx
Copy link

Same problem occurs with:
Cypress v 7.0.0
MacOS 11.2.3

RangeError: Maximum call stack size exceeded at _deconstructPacket (/root/.cache/Cypress/7.0.0/Cypress/resources/app/packages/socket/node_modules/socket.io-parser/dist/binary.js:40:32)

@kamiloski
Copy link

Get this on 7.0.1

@shutchison-bai
Copy link

Getting this on 7.1.0. Would like to use the new features in 7.1.0, but can't until this issue is resolved.

@AdeZwart
Copy link

AdeZwart commented Apr 14, 2021

We are also seeing this issue running the tests on our Azure DevOps CI pipelines. And we've upgraded to 7.0.1 and still have the issue there:

    RangeError: Maximum call stack size exceeded
    at _deconstructPacket (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io-parser\dist\binary.js:21:28)
    [...]
    at _deconstructPacket (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io-parser\dist\binary.js:40:32)
    at _deconstructPacket (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io-parser\dist\binary.js:32:26)
    at Object.deconstructPacket (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io-parser\dist\binary.js:16:17)
    at Encoder.encodeAsBinary (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io-parser\dist\index.js:81:41)
    at Encoder.encode (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io-parser\dist\index.js:43:29)
    at Client._packet (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io\dist\client.js:167:44)
    at Socket.packet (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io\dist\socket.js:161:21)
    at E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\socket\node_modules\socket.io\dist\socket.js:270:18
    at E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\lib\socket-base.js:325:28
    at tryCatcher (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:547:31)
    at Promise._settlePromise (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:604:18)
    at Promise._settlePromise0 (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:649:10)
    at Promise._settlePromises (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:725:18)
    at _drainQueueStep (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:93:12)
    at _drainQueue (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (E:\agent-5\_work\4\s\.cache\Cypress\7.0.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:461:21)

It doesn't seem consistent in our case. Usually if I run the pipeline again it will be fine.
Update: Running both 7.0.1 and 7.1.0 it actually seems to crash when the request exceeds the default timeout of 30000ms. First the test runner briefly shows that the test fails due to a timeout and then it crashes completely.

@jennifer-shehane
Copy link
Member

This is also a reproducible example although a bit more finicky to reproduce since you have to stop/start the test in open mode. #15629 (comment)

@danielxdam
Copy link

Upgrading from 4.0.1 to 7.2 today. Stepped through each major version between and noticed no problems locally but observed this issue in the aws/codebuild/standard:5.0 that runs it in the CI/CD on 6.9.1 and 7.2.0. Switching to 6.4.0 seems to resolve it for now.

@jennifer-shehane jennifer-shehane added type: regression A bug that didn't appear until a specific Cy version release v6.5.0 🐛 Issue present since 6.5.0 and removed type: bug labels Apr 28, 2021
@jennifer-shehane
Copy link
Member

This is a regression introduced in 6.5.0.

6.5.0 commits. I've narrowed it down to this PR where it was introduced: #14479 which is unfortunate because it is a gigantic commit, but hopefully this will help us track it down.

Issue not present: 0abb5ef
Issue present: af26fbe

@jennifer-shehane
Copy link
Member

This may be due to the socket.io updates in the PR which required some patches to handled specific circular references.

@grant-dot-dev
Copy link

Is this something that can be reported and fixed ? It would be great to be able to get from 6.40 > latest version :-)

@kuceb kuceb assigned kuceb and flotwig and unassigned kuceb Apr 29, 2021
@cypress-bot cypress-bot bot added stage: to do and removed stage: ready for work The issue is reproducible and in scope labels Apr 29, 2021
@jennifer-shehane jennifer-shehane added stage: ready for work The issue is reproducible and in scope and removed stage: ready for work The issue is reproducible and in scope labels Apr 29, 2021
flotwig added a commit that referenced this issue May 3, 2021
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: work in progress labels May 4, 2021
@cypress-bot cypress-bot bot added stage: pending release and removed stage: needs review The PR code is done & tested, needs review labels May 5, 2021
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 5, 2021

The code for this is done in cypress-io/cypress#16311, 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 May 10, 2021

Released in 7.3.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: regression A bug that didn't appear until a specific Cy version release v6.5.0 🐛 Issue present since 6.5.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.