Cypress: Cannot find unclaimed instance for spec

Created on 11 Aug 2020  ยท  17Comments  ยท  Source: cypress-io/cypress

Current behavior:

I got this on the CL. Run do NOT get recorded
This run will not be recorded. On the dashboard the run will be labeled as timeout.

screenshot-dashboard cypress io-2020 08 11-15_37_47

Screenshot (43)

Warning: We encountered an error talking to our servers.

This error will not alter the exit code.

StatusCodeError: 400

{
  "message": "Cannot find unclaimed instance for spec: cypress\\integration\\dev-tests\\tests_writing_off.spec.js"
}

Desired behavior:

The run to get recorded

Test code to reproduce

cypress run --record
thrugth npm run 'custom script'.
With any sets of tests.

Versions

Version 4.12.1
Windows 10
Electron 80

windows api bug

All 17 comments

Hey @eugenioghio, I've reported this to our Dashboard team to investigate. Is this error continuing on your runs? Or was this error only present on this single run - and has since been passing? Thanks!

Hi @jennifer-shehane , as a matter of facts this error is recurring over and over on all runs.
It happened after I updated cypress.
I will rollback and report here if is this still a thing on older version.

We have identical issue since yesterday morning GMT, still evaluating dashboard.
The issue is showing up on all tests, dashboard needs to be stopped manually.
It appeared on cypress 4.10 but persists after upgrade to 4.12.

@jennifer-shehane please find below some relevant logs.

Registration api call:

2020-08-12T08:24:49.199Z cypress:server:api request to url: POST https://api.cypress.io/runs with params: 
{
  "body": {
    "ci": {
      "params": null,
      "provider": null
    },
    "specs": [
      "cypress\\integration\\api-automation.spec.ts",
      "cypress\\integration\\Some - Tests\\some-test-1.spec.ts",
( removed 13 more for brevity)
    ],
    "commit": {
      "sha": "6f92ebb23930872bfdedbb10682d171091d216d3",
      "branch": "cypress",
      "authorName": "Michal Turecki",
      "authorEmail": "[email protected]",
      "message": "Redacted-1234 Name of run...\n",
      "remoteOrigin": "[email protected]:qa/project",
      "defaultBranch": null
    },
    "group": null,
    "platform": {
      "osCpus": [
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 100281,
            "nice": 0,
            "sys": 104406,
            "idle": 2586593,
            "irq": 14968
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 166671,
            "nice": 0,
            "sys": 195906,
            "idle": 2428703,
            "irq": 78812
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 128234,
            "nice": 0,
            "sys": 89125,
            "idle": 2573921,
            "irq": 1218
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 124687,
            "nice": 0,
            "sys": 75218,
            "idle": 2591375,
            "irq": 1218
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 139765,
            "nice": 0,
            "sys": 71015,
            "idle": 2580500,
            "irq": 890
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 126484,
            "nice": 0,
            "sys": 84843,
            "idle": 2579953,
            "irq": 796
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 124906,
            "nice": 0,
            "sys": 80859,
            "idle": 2585515,
            "irq": 515
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 164953,
            "nice": 0,
            "sys": 76421,
            "idle": 2549906,
            "irq": 1125
          }
        }
      ],
      "osName": "win32",
      "osMemory": {
        "free": 10035662848,
        "total": 17178644480
      },
      "osVersion": "10.0.19041",
      "browserName": "Chrome",
      "browserVersion": "84.0.4147.125"
    },
    "parallel": null,
    "ciBuildId": null,
    "projectId": "redacted",
    "recordKey": "re-d-acted",
    "specPattern": null,
    "tags": [
      ""
    ]
  },
  "headers": {
    "x-route-version": "4",
    "x-os-name": "win32",
    "x-cypress-version": "4.12.1"
  }
} and token: undefined
2020-08-12T08:24:49.199Z cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/runs' }
2020-08-12T08:24:49.199Z cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 }
2020-08-12T08:24:49.204Z 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 }, { address: '172.67.69.12', family: 4 } ] }
2020-08-12T08:24:49.224Z cypress:network:agent got family { family: 4, href: 'https://api.cypress.io/runs' }
2020-08-12T08:24:49.529Z cypress:server:api response { groupId: 'win32-Chrome-84-50e77fc64b', machineId: '0b4928b8-0e9f-4255-9622-redacted', runId: '7b361acd-bded-45c8-adfd-redacted', runUrl: 'https://dashboard.cypress.io/projects/redacted/runs/26', warnings: [], tags: null }

First spec api call:

2020-08-12T08:24:49.564Z cypress:server:api request to url: POST https://api.cypress.io/runs/7b361acd-bded-45c8-adfd-redacted/instances with params: {
  "body": {
    "spec": "cypress\\integration\\api-automation.spec.ts",
    "groupId": "win32-Chrome-84-50e77fc64b",
    "machineId": "0b4928b8-0e9f-4255-9622-redacted",
    "platform": {
      "osCpus": [
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 100281,
            "nice": 0,
            "sys": 104406,
            "idle": 2586593,
            "irq": 14968
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 166671,
            "nice": 0,
            "sys": 195906,
            "idle": 2428703,
            "irq": 78812
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 128234,
            "nice": 0,
            "sys": 89125,
            "idle": 2573921,
            "irq": 1218
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 124687,
            "nice": 0,
            "sys": 75218,
            "idle": 2591375,
            "irq": 1218
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 139765,
            "nice": 0,
            "sys": 71015,
            "idle": 2580500,
            "irq": 890
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 126484,
            "nice": 0,
            "sys": 84843,
            "idle": 2579953,
            "irq": 796
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 124906,
            "nice": 0,
            "sys": 80859,
            "idle": 2585515,
            "irq": 515
          }
        },
        {
          "model": "AMD Ryzen 7 3700X 8-Core Processor             ",
          "speed": 3600,
          "times": {
            "user": 164953,
            "nice": 0,
            "sys": 76421,
            "idle": 2549906,
            "irq": 1125
          }
        }
      ],
      "osName": "win32",
      "osMemory": {
        "free": 10035662848,
        "total": 17178644480
      },
      "osVersion": "10.0.19041",
      "browserName": "Chrome",
      "browserVersion": "84.0.4147.125"
    }
  },
  "headers": {
    "x-route-version": "5",
    "x-os-name": "win32",
    "x-cypress-version": "4.12.1"
  }
} and token: undefined
2020-08-12T08:24:49.564Z cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/runs/7b361acd-bded-45c8-adfd-redacted/instances' }
2020-08-12T08:24:49.564Z cypress:network:agent got family { family: 4, href: 'https://api.cypress.io/runs/7b361acd-bded-45c8-adfd-redacted/instances' }
2020-08-12T08:24:50.154Z cypress:server:record failed creating instance { stack: 'StatusCodeError: 400 - {"message":"Cannot find unclaimed instance for spec: cypress\\\\integration\\\\api-automation.spec.ts"}\n' + '    at new StatusCodeError (C:\\Users\\me\\AppData\\Local\\Cypress\\Cache\\4.12.1\\Cypress\\resources\\app\\packages\\server\\node_modules\\request-promise-core\\lib\\errors.js:32:15)\n' + '    at Request.plumbing.callback (C:\\Users\\me\\AppData\\Local\\Cypress\\Cache\\4.12.1\\Cypress\\resources\\app\\packages\\server\\node_modules\\request-promise-core\\lib\\plumbing.js:104:33)\n' + '    at Request.RP$callback [as _callback] (C:\\Users\\me\\AppData\\Local\\Cypress\\Cache\\4.12.1\\Cypress\\resources\\app\\packages\\server\\node_modules\\request-promise-core\\lib\\plumbing.js:46:31)\n' + '    at Request.self.callback (C:\\Users\\me\\AppData\\Local\\Cypress\\Cache\\4.12.1\\Cypress\\resources\\app\\packages\\server\\node_modules\\@cypress\\request\\request.js:185:22)\n' + '    at Request.emit (events.js:210:5)\n' + '    at Request.<anonymous> (C:\\Users\\me\\AppData\\Local\\Cypress\\Cache\\4.12.1\\Cypress\\resources\\app\\packages\\server\\node_modules\\@cypress\\request\\request.js:1156:10)\n' + '    at Request.emit (events.js:210:5)\n' + '    at IncomingMessage.<anonymous> (C:\\Users\\me\\AppData\\Local\\Cypress\\Cache\\4.12.1\\Cypress\\resources\\app\\packages\\server\\node_modules\\@cypress\\request\\request.js:1078:12)\n' + '    at Object.onceWrapper (events.js:299:28)\n' + '    at IncomingMessage.emit (events.js:215:7)\n' + '    at endReadableNT (_stream_readable.js:1183:12)\n' + '    at processTicksAndRejections (internal/process/task_queues.js:80:21)' }
Warning: We encountered an error talking to our servers.

This run will not be recorded.

This error will not alter the exit code.

StatusCodeError: 400

{
  "message": "Cannot find unclaimed instance for spec: cypress\\integration\\api-automation.spec.ts"
}

@speedwellsoftware Thanks for reporting. This issue may be isolated to Windows as it seems to be occurring in all Windows OS's so far.

Hello. We have the same issue. Maybe this information can help you to identify issue

CI: TeamCity
OS Windows 6.3.9600
Browser: Electron 80.0.3987.165
Cypress: v4.10.0

Error message

[07:59:52][Step 6/8] Warning: We encountered an error talking to our servers.
[07:59:52][Step 6/8]
[07:59:52][Step 6/8] This run will not be recorded.
[07:59:52][Step 6/8]
[07:59:52][Step 6/8] This error will not alter the exit code.
[07:59:52][Step 6/8]
[07:59:52][Step 6/8] StatusCodeError: 400
[07:59:52][Step 6/8]
[07:59:52][Step 6/8] {
[07:59:52][Step 6/8] "message": "Cannot find unclaimed instance for spec: cypress\integration\filtering\tran-filter-enter-navigation.spec.ts"
[07:59:52][Step 6/8] }

Aug 10, 2020 at 03:21pm (UTC) - last successful execution
Aug 11, 2020 at 07:55am (UTC) - first Timed out execution

From Aug 11 all 13 test executions have time out state.

I'm also experiencing the very same problem after upgrading to Cypress version 4.12.0.

Our engineering team has released a fix for this issue - of seeing the Cannot find unclaimed instance for spec error when running in Windows OS's.

Please comment here or open a new issue if you continue to see this issue on new runs that are recorded to the Dashboard.

Hi Jennifer, We are also experiencing same issue when ran tests "Cannot find unclaimed instance for spec " locally or on Azure DevOps pipeline, it gets worst when used it along with -parallel flag which suppresses original issue (Cannot find unclaimed instance for spec )

I've seen your comments on engineering team has released a fix but there is no information on changelog on a release will it be possible to tell when can we get a new bug fix
?

@amargourishetty This was a fix made by our API team. When you record tests to our Dashboard - this makes API requests - the original bug was in introduced around 2 days ago on one of those requests, so that fix went out immediately without requiring an update to a new Cypress version.

All new runs made after the comment above should no longer have this issue. If you are seeing this error on new runs after that time, please run cypress run in debug mode mode and print the entire set of logs here.

@jennifer-shehane Thank you for a fix - it works!

Thanks for the fix, it works.

@jennifer-shehane Hi, please reopen this issue as the problem is back - our ovenight run fails again with the same message:

Warning: We encountered an error talking to our servers.

This run will not be recorded.

This error will not alter the exit code.

StatusCodeError: 400

{
  "message": "Cannot find unclaimed instance for spec: cypress\\integration\\name.spec.ts"
}

@t00 Thanks for reporting the reoccurrence of this issue. Our API engineering team is currently investigating. Sorry for the inconvenience.

I'm still facing this issue in the latest version of cypress (5.0.0) on Windows. Here is the full log with debug enabled if it helps:

2020-08-21T07:43:14.970Z cypress:server:run formatting Node version. { version: '12.14.1', path: undefined }
  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
  โ”‚ Cypress:    5.0.0                                                                              โ”‚
  โ”‚ Browser:    Chrome 84 (headless)                                                               โ”‚
  โ”‚ Specs:      1 found (my-app\my_tests.spec.js)                                   โ”‚
  โ”‚ Searched:   cypress\integration\my-app\my_tests.spec.js                         โ”‚
  โ”‚ Params:     Tag: false, Group: false, Parallel: false                                          โ”‚
  โ”‚ Run URL:    https://dashboard.cypress.io/projects/td8e9s/runs/11                               โ”‚
  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2020-08-21T07:43:14.970Z cypress:server:record before spec run { spec: { name: 'my-app\\my_tests.spec.js', relative: 'cypress\\integration\\my-app\\my_tests.spec.js', absolute: 'C:/JenkinsHome/workspace/PolicyCenter10Jenkins_master/cypress/integration/my-app/my_tests.spec.js', specType: 'integration' } }
2020-08-21T07:43:14.985Z cypress:server:api request to url: POST https://api.cypress.io/runs/9583660c-c890-44d4-8fa8-26c68c5335ce/instances with params: {"body":{"spec":"cypress\\integration\\my-app\\my_tests.spec.js","groupId":"win32-Chrome-84-93c69e07ce","machineId":"c224efa7-9b3a-4ddf-8c61-11f89e38f2fb","platform":{"osCpus":[{"model":"Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz","speed":2300,"times":{"user":5851593,"nice":0,"sys":2067515,"idle":3769855093,"irq":149953}},{"model":"Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz","speed":2300,"times":{"user":8712859,"nice":0,"sys":1822750,"idle":3767238375,"irq":14343}},{"model":"Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz","speed":2300,"times":{"user":9124109,"nice":0,"sys":2004375,"idle":3766645500,"irq":13875}},{"model":"Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz","speed":2300,"times":{"user":7558437,"nice":0,"sys":1720734,"idle":3768494812,"irq":13156}},{"model":"Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz","speed":2300,"times":{"user":6291125,"nice":0,"sys":1436562,"idle":3770046296,"irq":9562}},{"model":"Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz","speed":2300,"times":{"user":6841437,"nice":0,"sys":2701609,"idle":3768230937,"irq":14765}},{"model":"Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz","speed":2300,"times":{"user":6250609,"nice":0,"sys":1780515,"idle":3769742843,"irq":11375}},{"model":"Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz","speed":2300,"times":{"user":5728078,"nice":0,"sys":1528203,"idle":3770517687,"irq":13453}}],"osName":"win32","osMemory":{"free":19789500416,"total":34359328768},"osVersion":"6.3.9600","browserName":"Chrome","browserVersion":"84.0.4147.135"}},"headers":{"x-route-version":"5","x-os-name":"win32","x-cypress-version":"5.0.0"}} and token: undefined
2020-08-21T07:43:14.985Z cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/runs/9583660c-c890-44d4-8fa8-26c68c5335ce/instances' }
2020-08-21T07:43:14.985Z cypress:network:agent got family { family: 4, href: 'https://api.cypress.io/runs/9583660c-c890-44d4-8fa8-26c68c5335ce/instances' }
2020-08-21T07:43:15.079Z cypress:server:record failed creating instance { stack: 'StatusCodeError: 400 - {"message":"Cannot find unclaimed instance for spec: cypress\\\\integration\\\\my-app\\\\my_tests.spec.js"}\n' + '    at new StatusCodeError (C:\\Users\\Administrator\\AppData\\Local\\Cypress\\Cache\\5.0.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\request-promise-core\\lib\\errors.js:32:15)\n' + '    at Request.plumbing.callback (C:\\Users\\Administrator\\AppData\\Local\\Cypress\\Cache\\5.0.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\request-promise-core\\lib\\plumbing.js:104:33)\n' + '    at Request.RP$callback [as _callback] (C:\\Users\\Administrator\\AppData\\Local\\Cypress\\Cache\\5.0.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\request-promise-core\\lib\\plumbing.js:46:31)\n' + '    at Request.self.callback (C:\\Users\\Administrator\\AppData\\Local\\Cypress\\Cache\\5.0.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\@cypress\\request\\request.js:185:22)\n' + '    at Request.emit (events.js:223:5)\n' + '    at Request.<anonymous> (C:\\Users\\Administrator\\AppData\\Local\\Cypress\\Cache\\5.0.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\@cypress\\request\\request.js:1156:10)\n' + '    at Request.emit (events.js:223:5)\n' + '    at IncomingMessage.<anonymous> (C:\\Users\\Administrator\\AppData\\Local\\Cypress\\Cache\\5.0.0\\Cypress\\resources\\app\\packages\\server\\node_modules\\@cypress\\request\\request.js:1078:12)\n' + '    at Object.onceWrapper (events.js:312:28)\n' + '    at IncomingMessage.emit (events.js:228:7)\n' + '    at endReadableNT (_stream_readable.js:1185:12)\n' + '    at processTicksAndRejections (internal/process/task_queues.js:81:21)\n' }
Warning: We encountered an error talking to our servers.

This run will not be recorded.

This error will not alter the exit code.

StatusCodeError: 400

{
  "message": "Cannot find unclaimed instance for spec: cypress\\integration\\my-app\\my_tests.spec.js"
}

Our engineering team has released a fix for this issue - of seeing the Cannot find unclaimed instance for spec error when running in Windows OS's. This fix should be immediate and not require a new version of Cypress.

Please comment here or open a new issue if you continue to see this issue on any new runs that are recorded to the Dashboard.

Our engineering team has released a fix for this issue - of seeing the Cannot find unclaimed instance for spec error when running in Windows OS's. This fix should be immediate and not require a new version of Cypress.

Please comment here or open a new issue if you continue to see this issue on any new runs that are recorded to the Dashboard.

The issue is fixed now. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zbigniewkalinowski picture zbigniewkalinowski  ยท  3Comments

Francismb picture Francismb  ยท  3Comments

tahayk picture tahayk  ยท  3Comments

szabyg picture szabyg  ยท  3Comments

brian-mann picture brian-mann  ยท  3Comments