question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cypress server StatusCodeError: 412 on hookId and hookName is required

See original GitHub issue

Current behavior:

When we run cypress in parallel, cypress@4.10.0 and above receives service error during Uploading Results. Cypress dashboard will be pending and never finish.

See the below error messages:

  (Uploading Results)

We encountered an unexpected error talking to our servers.

Because you passed the --parallel flag, this run cannot proceed because it requires a valid response from our servers.

The --ciBuildId flag you passed was: xxx

The server's response was:

StatusCodeError: 412

{
  "message": "Request should follow putInstanceRequest@2.1.0 schema",
  "errors": [
    "data.hooks.1.hookId is required",
    "data.hooks.1.hookName is required"
  ],
  "object": {
    "stats": {
      "suites": 8,
      "tests": 16,
      "passes": 16,
      "pending": 0,
      "skipped": 0,
      "failures": 0,
      "wallClockStartedAt": "2020-08-14T20:33:38.948Z",
      "wallClockEndedAt": "2020-08-14T20:34:28.554Z",
      "wallClockDuration": 49606
    },
    "tests": [
      {
        "testId": "r4",
        "title": [
          "Generic Landing Page",
          "Landing Page Components",
          "Should be present on load"
        ],
        "state": "passed",

Desired behavior:

Tested different cypress versions includes 4.9.0, 4.10.0 and 4.12.1. 4.9.0 works fine without issues. Looking at the change log https://github.com/cypress-io/cypress/releases/tag/v4.10.0 It includes hooks updates. That might cause the server error issue. We have downgrade cypress from the latest version to 4.9.0 to run tests with cypress server.

Test code to reproduce

cypress run --headless --browser chrome --record --key=<key> --ci-build-id=<build_id> --parallel --config baseUrl=<url>

Versions

4.10.0 and above

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kucebcommented, Aug 26, 2020

erroring on nested hooks is implemented in #8400

0reactions
cypress-bot[bot]commented, Sep 1, 2020

Released in 5.1.0.

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Cypress Documentation
Cypress comes with an npm CLI module that parses the arguments, starts the Xvfb server (if necessary), and then opens Cypress. Some common...
Read more >
Error Messages | Cypress Documentation
We found an error preparing your test file. This message means that Cypress encountered an error when compiling and/or bundling your test file....
Read more >
Web Security - Cypress Documentation
If the remote server requests a client certificate for a configured URL, Cypress will supply ... Different superdomain per test requires cy.origin command....
Read more >
Network Requests - Cypress Documentation
Requests that are not stubbed actually reach your server. ... Requires seeding data; Much slower; Harder to test edge cases. Suggested Use.
Read more >
Introduction | Cypress Documentation
Because of this, you'll need it to run in the background - else your CI provider will never move onto the next command....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found