juspay/hyperswitch · error · Error

No credentials found for ${connectorName} in creds.json — sk

Error message

No credentials found for ${connectorName} in creds.json — skipping connector creation

What it means

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.

Source

Thrown at cypress-tests/cypress/support/commands.js:1565

            },
          ],
        },
      ];
      delete createConnectorBody.payment_methods_enabled;
    } else {
      createConnectorBody.payment_methods_enabled = paymentMethodsEnabled;
    }

    // readFile is used to read the contents of the file and it always returns a promise ([Object Object]) due to its asynchronous nature
    // it is best to use then() to handle the response within the same block of code
    cy.readFile(globalState.get("connectorAuthFilePath")).then(
      (jsonContent) => {
        const { authDetails } = getValueByKey(
          JSON.stringify(jsonContent),
          connectorName
        );
        if (!authDetails) {
          throw new Error(
            `No credentials found for ${connectorName} in creds.json — skipping connector creation`
          );
        }
        createConnectorBody.connector_account_details =
          authDetails.connector_account_details;
        cy.request({
          method: "POST",
          url: `${globalState.get("baseUrl")}/account/${merchantId}/connectors`,
          headers: {
            "Content-Type": "application/json",
            Accept: "application/json",
            "api-key": globalState.get("apiKey"),
          },
          body: createConnectorBody,
          failOnStatusCode: false,
        }).then((response) => {
          logRequestId(response.headers["x-request-id"]);

View on GitHub (pinned to 9b8b89dc37)

Solutions

  1. Open the file at globalState.get('connectorAuthFilePath') and confirm a key exactly matching connectorName exists with a connector_account_details object
  2. Add the missing connector's credentials block to the correct environment's creds file
  3. 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)
  4. If credentials genuinely cannot be provided, exclude the connector from the run instead of letting it throw
  5. Fix the upstream message so it stops claiming 'skipping' when it actually throws

Example fix

// before — throws (fails the test) despite the 'skipping' wording
cy.createNamedConnectorCallTest('payment_processor', body, pm, globalState, 'stripeconnect', 'label');
// after — pre-check creds and skip gracefully
cy.readFile(globalState.get('connectorAuthFilePath')).then((json) => {
  const { authDetails } = getValueByKey(JSON.stringify(json), 'stripeconnect');
  if (!authDetails) {
    cy.task('cli_log', 'stripeconnect creds missing — skipping connector test');
    return;
  }
  cy.createNamedConnectorCallTest('payment_processor', body, pm, globalState, 'stripeconnect', 'label');
});
Defensive patterns

Strategy: validation

Validate before calling

cy.readFile(globalState.get('connectorAuthFilePath')).then((json) => {
  const { authDetails } = getValueByKey(JSON.stringify(json), connectorName);
  if (!authDetails) {
    throw new Error(`Pre-flight: ${connectorName} has no creds — fix creds.json or exclude this connector from the run`);
  }
});

Type guard

const hasConnectorCreds = (json, name) => {
  const { authDetails } = getValueByKey(JSON.stringify(json), name);
  return Boolean(authDetails && authDetails.connector_account_details);
};

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of juspay/hyperswitch@9b8b89dc37 (2026-08-16). Data as JSON: /api/errors/6544321f78cde315. Report an issue: GitHub.