cypress: "RangeError: Invalid time value" while upgrading to Debian 12

Current behavior

Cypress test execution randomly failed with the following error:

Invalid time value
RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at <embedded>:3215:1041876
    at a (<embedded>:3215:1041943)
    at <embedded>:3215:1045471
    at Array.forEach (<anonymous>)
    at <embedded>:3215:1045428
    at <embedded>:3215:1045489
    at ChildProcess.exithandler (node:child_process:422:7)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:322:12)
Error: Process completed with exit code 1.

Desired behavior

No response

Test code to reproduce

I did not create an example to reproduce the issue yet.

Cypress Version

13.2.0

Node version

18.18.0

Operating System

Debian GNU/Linux 12 (bookworm)

Debug Logs

[...]
  cypress:server:server-base Got CONNECT request from www.google.com:443 +4s
  cypress:https-proxy Writing browserSocket connection headers { url: 'www.google.com:443', headLength: 0, headers: { host: 'www.google.com:443', 'proxy-connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36' } } +4s
  cypress:https-proxy Got first head bytes { url: 'www.google.com:443', head: '\x16\x03\x01\x02\x00\x01\x00\x01�\x03\x03�+�Yht��2-f�\x0FwqJT�d\x04�a�l��Y���\x17\x16 G����cR>�,\x15\fO\x15�^���\x02' } +1ms
  cypress:https-proxy Making intercepted connection to 45575 +153ms
  cypress:network:connect successfully connected { opts: { port: 45575, host: 'localhost', getDelayMsForRetry: [Function: h] }, iteration: 0 } +4s
  cypress:https-proxy received upstreamSocket callback for request { port: 45575, hostname: 'localhost', err: undefined } +6ms
  cypress:server:util:socket_allowed allowing socket { localPort: 40836 } +4s
  cypress:launcher:browsers chrome stderr: [742:761:0921/095003.709925:ERROR:cert_verify_proc_builtin.cc(701)] CertVerifyProcBuiltin for www.google.com failed:
----- Certificate i=0 (OU=Cypress Proxy Server Certificate,O=Cypress Proxy CA,L=Internet,ST=Internet,C=Internet,CN=www.google.com) -----
ERROR: No matching issuer found +5s
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 40790 } +891ms
  cypress:server:util:socket_allowed allowed socket closed, removing { localPort: 40802 } +50ms
Invalid time value
RangeError: Invalid time value
    at Date.toISOString (<anonymous>)
    at <embedded>:3215:1041876
    at a (<embedded>:3215:1041943)
    at <embedded>:3215:1045471
    at Array.forEach (<anonymous>)
    at <embedded>:3215:1045428
    at <embedded>:3215:1045489
    at ChildProcess.exithandler (node:child_process:422:7)
    at ChildProcess.emit (node:events:513:28)
    at maybeClose (node:internal/child_process:1091:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:513:28)
    at Pipe.<anonymous> (node:net:322:12)
  cypress:server:cloud:api request to url: POST https://api.cypress.io/exceptions with params: {"body":{"err":{"name":"RangeError","message":"Invalid time value","stack":"RangeError: Invalid time value\n    at Date.toISOString (<anonymous>)\n    at <embedded>:3215:1041876\n    at a (<embedded>:3215:1041943)\n    at <embedded>:3215:1045471\n    at Array.forEach (<anonymous>)\n    at <embedded>:3215:1045428\n    at <embedded>:3215:1045489\n    at ChildProcess.exithandler (node:child_process:422:7)\n    at ChildProcess.emit (node:events:513:28)\n    at maybeClose (node:internal<stripped-path>child_process:1091:16)\n    at Socket.<anonymous> (node:internal<stripped-path>child_process:449:11)\n    at Socket.emit (node:events:513:28)\n    at Pipe.<anonymous> (node:net:322:12)"},"version":"13.2.0","osName":"linux","osVersion":"Debian - ","osCpus":[{"model":"Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz","speed":2793,"times":{"user":219800,"nice":60,"sys":33850,"idle":597240,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz","speed":2793,"times":{"user":250590,"nice":60,"sys":34730,"idle":610040,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz","speed":2793,"times":{"user":273100,"nice":0,"sys":33370,"idle":591510,"irq":0}},{"model":"Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz","speed":2793,"times":{"user":263550,"nice":60,"sys":34060,"idle":599640,"irq":0}}],"osMemory":{"free":22449184768,"total":29447667712}},"headers":{"x-os-name":"linux","x-cypress-version":"13.2.0"}} and token: undefined +0ms
  cypress:network:agent addRequest called { isHttps: true, href: 'https://api.cypress.io/exceptions' } +6s
  cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 } +2s
  cypress:server:browsers killing browser process +7s
  cypress:server:browsers:chrome closing remote interface client { options: { gracefulShutdown: true } } +7s
  cypress:server:browsers:cri-client closing cri client { closed: false, target: 'FDB37F27C7B2495A33FD0DDD73FC937D' } +7s
  cypress:server:browsers:chrome closing chrome +1ms
  cypress:proxy:http:util:prerequests metrics: { browserPreRequestsReceived: 23, proxyRequestsReceived: 2, immediatelyMatchedRequests: 0, unmatchedRequests: 2, unmatchedPreRequests: 0 } +0ms
  cypress:server:browsers:cri-client closed cri client { closed: true, target: 'FDB37F27C7B2495A33FD0DDD73FC937D' } +3ms
  cypress:server:browsers:cri-client closing cri client { closed: false, target: 'ws://127.0.0.1:37431/devtools/browser/25b75542-324c-4311-a413-58dbc4a948f7' } +0ms
  cypress:server:browsers:cri-client closed cri client { closed: true, target: 'ws://127.0.0.1:37431/devtools/browser/25b75542-324c-4311-a413-58dbc4a948f7' } +8ms
2023-09-21T09:50:06.066Z cypress:cli child event fired { event: 'exit', code: 1, signal: null }
2023-09-21T09:50:06.067Z cypress:cli Stopping Xvfb
Error: Process completed with exit code 1.

Other

I’m having this issue since I upgraded my Docker image used to execute the Cypress tests from Debian 11 to Debian 12. This issue occurred randomly and quite often (like 30% of the time). When I downgrade to Debian 11 without changing anything else, I don’t have this issue anymore. I don’t think the debug log can help as this issue could randomly occurs at different stage of the execution of the tests.

Does anyone have any idea what is causing this problem?

About this issue

  • Original URL
  • State: closed
  • Created 9 months ago
  • Reactions: 1
  • Comments: 19 (7 by maintainers)

Most upvoted comments

i upgraded to Cypress 13.3.2 about a week ago, and I did not have any problem since.

For posterity: Cypress 13.3.2 Node 16.20.0 Ubuntu 23.04

@MikeMcC399 Cypress 13.3.0 works fine for me. Thank you!