{"record":{"id":"e2d5a88ea475b618","repo":"juspay/hyperswitch","slug":"missing-proxyhttp-or-proxyhttps-in-globalstate-gl","errorCode":null,"errorMessage":"Missing proxyHttp or proxyHttps in globalState. globalState.proxyHttp=${httpUrl}, globalState.proxyHttps=${httpsUrl}, Cypress.env(\"PROXY_HTTP\")=${Cypress.env(\"PROXY_HTTP\")}, Cypress.env(\"PROXY_HTTPS\")=${Cypress.env(\"PROXY_HTTPS\")}","messagePattern":"Missing proxyHttp or proxyHttps in globalState\\. globalState\\.proxyHttp=(.+?), globalState\\.proxyHttps=(.+?), Cypress\\.env\\(\"PROXY_HTTP\"\\)=(.+?), Cypress\\.env\\(\"PROXY_HTTPS\"\\)=(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cypress-tests/cypress/support/commands.js","lineNumber":248,"sourceCode":"\nfunction createUcsConfigs(globalState, flow, type) {\n  // --- Phase 1: Environment Setup & Validation ---\n  const ucsEnabled = globalState.get(\"ucsEnabled\");\n  if (!ucsEnabled) {\n    cy.task(\n      \"cli_log\",\n      `UCS ${type} config creation skipped - ucsEnabled is false or not set`\n    );\n    return;\n  }\n\n  const httpUrl = globalState.get(\"proxyHttp\");\n  const httpsUrl = globalState.get(\"proxyHttps\");\n  const connector = globalState.get(\"connectorId\");\n  const methodFlowInput = flow || globalState.get(\"methodFlow\");\n\n  if (!httpUrl || !httpsUrl) {\n    throw new Error(\n      `Missing proxyHttp or proxyHttps in globalState. globalState.proxyHttp=${httpUrl}, globalState.proxyHttps=${httpsUrl}, Cypress.env(\"PROXY_HTTP\")=${Cypress.env(\"PROXY_HTTP\")}, Cypress.env(\"PROXY_HTTPS\")=${Cypress.env(\"PROXY_HTTPS\")}`\n    );\n  }\n\n  if (!connector || !methodFlowInput) {\n    throw new Error(\"Missing connectorId or methodFlow in globalState\");\n  }\n\n  if (!globalState) {\n    throw new Error(\"Missing required parameter: globalState\");\n  }\n\n  // --- Phase 2: Data Preparation ---\n  const merchantId = globalState.get(\"merchantId\");\n  const adminApiKey = globalState.get(\"adminApiKey\");\n  const baseUrl = globalState.get(\"baseUrl\");\n\n  if (!merchantId || !adminApiKey || !baseUrl) {","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/juspay/hyperswitch/blob/9b8b89dc378b62c9a6feda647bad4719d2de7699/cypress-tests/cypress/support/commands.js#L230-L266","documentation":"Thrown by createUcsConfigs in cypress-tests/cypress/support/commands.js during UCS rollout/shadow config creation: it requires both globalState proxy URLs (proxyHttp from PROXY_HTTP and proxyHttps from PROXY_HTTPS) to talk to the UCS proxy. The message dumps both globalState values and both Cypress.env values, so it doubles as a diagnostics dump for which source is missing.","triggerScenarios":"A UCS-enabled test (ucsEnabled true in globalState) runs where globalState.get('proxyHttp')/get('proxyHttps') are empty — i.e. Cypress.env('PROXY_HTTP')/('PROXY_HTTPS') were never provided for the run (missing --env flags / CI variables).","commonSituations":"Running UCS specs on a machine or CI job without the proxy env vars; enabling ucsEnabled for a suite without also provisioning the proxy endpoints; renaming the env vars in config without updating commands.js.","solutions":["Provide both env vars for the run, e.g. --env PROXY_HTTP=http://proxy:8080,PROXY_HTTPS=https://proxy:8443 (or in cypress.config/CI secrets)","Use the message dump to confirm which of the four values is empty before fixing","If UCS should not run in this environment, leave ucsEnabled unset/false so the function skips instead of throwing"],"exampleFix":"// before (run without proxy envs)\nnpx cypress run --env ucsEnabled=true\n// throws: Missing proxyHttp or proxyHttps ...\n\n// after\nnpx cypress run --env ucsEnabled=true,PROXY_HTTP=http://localhost:8080,PROXY_HTTPS=https://localhost:8443","handlingStrategy":"validation","validationCode":"// Before UCS config creation\nconst httpUrl = globalState.get('proxyHttp') || Cypress.env('PROXY_HTTP');\nconst httpsUrl = globalState.get('proxyHttps') || Cypress.env('PROXY_HTTPS');\nif (!httpUrl || !httpsUrl) {\n  cy.log('UCS config creation skipped: PROXY_HTTP / PROXY_HTTPS not configured');\n  return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision PROXY_HTTP and PROXY_HTTPS in every environment that sets ucsEnabled","Use the error's four-value dump to identify whether globalState or Cypress.env is the empty source","Leave ucsEnabled false in environments without the UCS proxy"],"tags":["cypress","ucs","configuration","proxy","environment"],"backgroundTag":null,"analyzedSha":"9b8b89dc378b62c9a6feda647bad4719d2de7699","analyzedAt":"2026-08-16T09:01:53.433Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}