Code Monkey home page Code Monkey logo

Comments (5)

mirobo avatar mirobo commented on July 19, 2024

Additional info:
This is extremly strange... in CI with cypress docker included image, it works fine and locally it worked fine last week. When I tried the version 1.4.5-beta.0 I started to get this error. But now when even when I get back to version 1.4.4 (which worked before) I have the same error locally on Windows (response 400).

I use the exact same NODE_EXTRA_CA_CERTS as in CI.

I'll check the configuration of Node/Dependencies in CI

from cypress-cloud.

agoldis avatar agoldis commented on July 19, 2024

@mirobo Are you seeing anything weird on director service?

from cypress-cloud.

agoldis avatar agoldis commented on July 19, 2024

@mirobo I have just tried sending your payload to local instance of sorry-cypress - it's working fine.

curl --location 'http://localhost:1235/runs' \
--header 'Content-Type: application/json' \
--data '{
    "ci": {
        "params": {},
        "provider": null
    },
    "specs": [
        "cypress\\e2e\\1-getting-started\\todo.cy.js"
    ],
    "commit": {
        "branch": "main",
        "remoteOrigin": "",
        "authorEmail": "mirobo",
        "authorName": "mirobo",
        "message": "update cypress-cloud to 1.4.5-beta.0\n",
        "sha": "0c3a4449fe09f6d6c58fa3f3e5a3630aea68d6d5"
    },
    "platform": {
        "osName": "win32",
        "osVersion": "10.0.19044",
        "browserName": "Electron",
        "browserVersion": "106.0.5249.51"
    },
    "parallel": true,
    "ciBuildId": "2023-03-16T12: 17: 33.582Z",
    "projectId": "test",
    "recordKey": "cccc",
    "specPattern": [
        "cypress/e2e /**/*.cy.{js,jsx,ts,tsx}"
    ],
    "testingType": "e2e",
    "batchSize": 3
}'

from cypress-cloud.

mirobo avatar mirobo commented on July 19, 2024

After the log currents:api network request: I see this:

follow-redirects options {
  maxRedirects: 21,
  maxBodyLength: Infinity,
  protocol: 'http:',
  path: 'https://some-sorry-cypress-director/runs',
  method: 'POST',
  headers: [Object: null prototype] {
    Accept: 'application/json, text/plain, */*',
    'Content-Type': 'application/json',
    'x-cypress-request-attempt': '0',
    'x-cypress-version': '12.6.0',
    'x-ccy-version': '1.5.0',
    'User-Agent': 'axios/1.3.4',
    'Content-Length': '2596',
    'Accept-Encoding': 'gzip, compress, deflate, br',
    host: 'some-sorry-cypress-director'
  },
  agents: { http: undefined, https: undefined },
  auth: undefined,
  beforeRedirect: [Function: dispatchBeforeRedirect],
  beforeRedirects: { proxy: [Function: beforeRedirect] },
  hostname: 'localhost',
  port: '3128',
  host: 'localhost',
  agent: undefined,
  nativeProtocols: {
    'http:': {
      _connectionListener: [Function: connectionListener],
      METHODS: [Array],
      STATUS_CODES: [Object],
      Agent: [Function],
      ClientRequest: [Function: ClientRequest],
      IncomingMessage: [Function: IncomingMessage],
      OutgoingMessage: [Function: OutgoingMessage],
      Server: [Function: Server],
      ServerResponse: [Function: ServerResponse],
      createServer: [Function: createServer],
      validateHeaderName: [Function: __node_internal_],
      validateHeaderValue: [Function: __node_internal_],
      get: [Function: get],
      request: [Function: request],
      setMaxIdleHTTPParsers: [Function: setMaxIdleHTTPParsers],
      maxHeaderSize: [Getter],
      globalAgent: [Getter/Setter]
    },
    'https:': {
      Agent: [Function: Agent],
      globalAgent: [Agent],
      Server: [Function: Server],
      createServer: [Function: createServer],
      get: [Function: get],
      request: [Function: request]
    }
  }
} +0ms

I also just tried with cURL and it works, but I needed to add "--insecure" flag.

curl --location 'https://some-sorry-cypress-director/runs' \
--header 'Content-Type: application/json' \
--insecure \
--data '{
    "ci": {
        "params": {},
        "provider": null
    },
    "specs": [
        "cypress\\e2e\\1-getting-started\\todo.cy.js"
    ],
    "commit": {
        "branch": "main",
        "remoteOrigin": "",
        "authorEmail": "mirobo",
        "authorName": "mirobo",
        "message": "update cypress-cloud to 1.4.5-beta.0\n",
        "sha": "0c3a4449fe09f6d6c58fa3f3e5a3630aea68d6d5"
    },
    "platform": {
        "osName": "win32",
        "osVersion": "10.0.19044",
        "browserName": "Electron",
        "browserVersion": "106.0.5249.51"
    },
    "parallel": true,
    "ciBuildId": "2023-03-16T12: 17: 33.582Z",
    "projectId": "fipo2/system-test",
    "recordKey": "cccc",
    "specPattern": [
        "cypress/e2e /**/*.cy.{js,jsx,ts,tsx}"
    ],
    "testingType": "e2e",
    "batchSize": 3
}'

Response

{
"groupId":"2023-03-16T12: 17: 33.582Z",
"machineId":"f34012d9-8b8f-46f3-8922-3c98ed81b866",
"runId":"dccee29bca5cba898f715e64e3c3eb04",
"runUrl":"https://some-sorry-cypress-dashboard/run/dccee29bca5cba898f715e64e3c3eb04",
"isNewRun":true,
"warnings":[]
}

I guess this is an axios-specific issue? I'll try to execute the request in pure axios to see what happens..

from cypress-cloud.

mirobo avatar mirobo commented on July 19, 2024

@agoldis "proxy-from-env" used in "axios" ( https://github.com/Rob--W/proxy-from-env/blob/master/index.js#L62 ) interprets NO_PROXY differently compared to NPM ( https://github.com/npm/make-fetch-happen/blob/main/lib/agent.js#L93 ) 😤😭🤡.

All I needed was a dot in front of my domain that should not be proxied. Don't ask me why it worked once before locally.. maybe I was just dreaming..

When I used the normal "https" library from Node, it interpreted the NO_PROXY env variable as expected and I could normally do a POST request on the director. All I can say now is: Arghhhhxios.. 🤡

from cypress-cloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.