{"record":{"id":"6544321f78cde315","repo":"juspay/hyperswitch","slug":"no-credentials-found-for-connectorname-in-creds","errorCode":null,"errorMessage":"No credentials found for ${connectorName} in creds.json — skipping connector creation","messagePattern":"No credentials found for (.+?) in creds\\.json — skipping connector creation","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cypress-tests/cypress/support/commands.js","lineNumber":1565,"sourceCode":"            },\n          ],\n        },\n      ];\n      delete createConnectorBody.payment_methods_enabled;\n    } else {\n      createConnectorBody.payment_methods_enabled = paymentMethodsEnabled;\n    }\n\n    // readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature\n    // it is best to use then() to handle the response within the same block of code\n    cy.readFile(globalState.get(\"connectorAuthFilePath\")).then(\n      (jsonContent) => {\n        const { authDetails } = getValueByKey(\n          JSON.stringify(jsonContent),\n          connectorName\n        );\n        if (!authDetails) {\n          throw new Error(\n            `No credentials found for ${connectorName} in creds.json — skipping connector creation`\n          );\n        }\n        createConnectorBody.connector_account_details =\n          authDetails.connector_account_details;\n        cy.request({\n          method: \"POST\",\n          url: `${globalState.get(\"baseUrl\")}/account/${merchantId}/connectors`,\n          headers: {\n            \"Content-Type\": \"application/json\",\n            Accept: \"application/json\",\n            \"api-key\": globalState.get(\"apiKey\"),\n          },\n          body: createConnectorBody,\n          failOnStatusCode: false,\n        }).then((response) => {\n          logRequestId(response.headers[\"x-request-id\"]);\n","sourceCodeStart":1547,"sourceCodeEnd":1583,"githubUrl":"https://github.com/juspay/hyperswitch/blob/9b8b89dc378b62c9a6feda647bad4719d2de7699/cypress-tests/cypress/support/commands.js#L1547-L1583","documentation":"Thrown by the createNamedConnectorCallTest command (cypress-tests/cypress/support/commands.js:1565) when the credentials file at globalState.get('connectorAuthFilePath') (creds.json) has no entry for the requested connectorName, as resolved by getValueByKey. Despite the wording '…skipping connector creation', it does NOT skip — it throws and fails the test.","triggerScenarios":"connectorName key absent from creds.json (exact, case-sensitive match — 'Adyen' is not 'adyen'); connectorAuthFilePath pointing at the wrong environment's creds file; an empty or malformed JSON file so getValueByKey returns null authDetails; a newly added connector whose credentials were never provisioned.","commonSituations":"A new connector enabled in the test matrix without adding its creds block; the creds-file env var pointing at a template instead of the real file; connector identifier renames drifting from creds keys; local runs against a sample creds.json.","solutions":["Open the file at globalState.get('connectorAuthFilePath') and confirm a key exactly matching connectorName exists with a connector_account_details object","Add the missing connector's credentials block to the correct environment's creds file","Fix any case/spelling mismatch between the spec's connectorName and the creds key (note the API name is normalized via getOriginalConnectorName, e.g. stripeconnect -> stripe)","If credentials genuinely cannot be provided, exclude the connector from the run instead of letting it throw","Fix the upstream message so it stops claiming 'skipping' when it actually throws"],"exampleFix":"// before — throws (fails the test) despite the 'skipping' wording\ncy.createNamedConnectorCallTest('payment_processor', body, pm, globalState, 'stripeconnect', 'label');\n// after — pre-check creds and skip gracefully\ncy.readFile(globalState.get('connectorAuthFilePath')).then((json) => {\n  const { authDetails } = getValueByKey(JSON.stringify(json), 'stripeconnect');\n  if (!authDetails) {\n    cy.task('cli_log', 'stripeconnect creds missing — skipping connector test');\n    return;\n  }\n  cy.createNamedConnectorCallTest('payment_processor', body, pm, globalState, 'stripeconnect', 'label');\n});","handlingStrategy":"validation","validationCode":"cy.readFile(globalState.get('connectorAuthFilePath')).then((json) => {\n  const { authDetails } = getValueByKey(JSON.stringify(json), connectorName);\n  if (!authDetails) {\n    throw new Error(`Pre-flight: ${connectorName} has no creds — fix creds.json or exclude this connector from the run`);\n  }\n});","typeGuard":"const hasConnectorCreds = (json, name) => {\n  const { authDetails } = getValueByKey(JSON.stringify(json), name);\n  return Boolean(authDetails && authDetails.connector_account_details);\n};","tryCatchPattern":null,"preventionTips":["Keep an inventory: every connector in the test matrix must have a creds entry","Validate the creds file once in a global before() hook","Name creds keys exactly as the API connector identifiers (case-sensitive)","Remember this command throws despite its 'skipping' wording — pre-check or exclude"],"tags":["cypress","hyperswitch","connectors","credentials","config"],"backgroundTag":null,"analyzedSha":"9b8b89dc378b62c9a6feda647bad4719d2de7699","analyzedAt":"2026-08-16T09:01:53.433Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}