weaviate/weaviate · error

AWS Secret Key

Error message

AWS Secret Key

What it means

This error is produced in Client.vectorize (usecases/modulecomponents/clients/aws/aws.go:258) when c.getAwsAccessSecret(ctx) fails, i.e. no AWS secret access key could be resolved. The client looks for the secret first in the request header X-AWS-Secret-Access-Key, then in the module-level configured secret (e.g. AWS_SECRET_ACCESS_KEY in the module config); if both are empty it returns 'no secret key found...' which this Wrapf annotates with the 'AWS Secret Key' prefix. It applies to every AWS vectorization path: Bedrock and SageMaker, text, image and multimodal, batch and query.

Solutions

  1. Set the module-level secret in the Weaviate module configuration (environment variable consumed as the AWS secret access key) and restart Weaviate.
  2. Send the header X-AWS-Secret-Access-Key with the secret on each near-text/vectorize request (headers are passed through the GraphQL/gRPC request).
  3. Verify both X-AWS-Access-Key and X-AWS-Secret-Access-Key are supplied together if relying on per-request credentials; the access key alone is not enough.
  4. Check that no reverse proxy/ingress strips the X-AWS-* headers from client requests.

Example fix

// before: client sends only the access key
headers := map[string]string{"X-AWS-Access-Key": accessKey}
// after: send both credentials
headers := map[string]string{
  "X-AWS-Access-Key":        accessKey,
  "X-AWS-Secret-Access-Key": secretKey,
}
Defensive patterns

Strategy: validation

Validate before calling

const required = ["X-AWS-Access-Key", "X-AWS-Secret-Access-Key"];
const missing = required.filter(h => !headers[h] && !moduleConfigHasAwsSecret);
if (missing.length) throw new Error(`AWS vectorization requires: ${missing.join(", ")}`);

Try / catch

try {
  await weaviate.collections.get(name).query.nearText(query, {headers: awsHeaders});
} catch (e) {
  if (String(e).includes("AWS Secret Key")) {
    console.error("AWS secret not configured: set X-AWS-Secret-Access-Key header or module-level secret");
  }
  throw e;
}

Prevention

When it happens

Trigger: Any vectorization/query call through the AWS modules (text2vec-aws bedrock or sagemaker, multimodal) when neither the per-request header X-AWS-Secret-Access-Key nor the module-level AWS secret is set. Typical call chain: Vectorize/VectorizeQuery/VectorizeMultiModal -> vectorize -> getAwsAccessSecret -> error wrapped as 'AWS Secret Key'.

Common situations: Weaviate deployed without AWS_SECRET_ACCESS_KEY configured for the module while clients rely on ambient AWS credential chain (which this client does not use); client sends X-AWS-Access-Key but forgets X-AWS-Secret-Access-Key; key rotation removed the env var from the deployment; header name typo'd or stripped by a proxy; using IAM roles instead of static keys which this client does not support.

Related errors


AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04). Data as JSON: /api/errors/6fb3ceeace610a74. Report an issue: GitHub.

Appendix: source

Thrown at usecases/modulecomponents/clients/aws/aws.go:258

		if err != nil {
			return nil, err
		}
	}
	return &modulecomponents.VectorizationCLIPResult[[]float32]{
		TextVectors:  textEmbeddings,
		ImageVectors: imageEmbeddings,
	}, nil
}

func (c *Client) vectorize(ctx context.Context, texts, images []string, settings Settings,
) ([][]float32, [][]float32, error) {
	accessKey, err := c.getAwsAccessKey(ctx)
	if err != nil {
		return nil, nil, errors.Wrapf(err, "AWS Access Key")
	}
	secretKey, err := c.getAwsAccessSecret(ctx)
	if err != nil {
		return nil, nil, errors.Wrapf(err, "AWS Secret Key")
	}
	awsSessionToken, err := c.getAwsSessionToken(ctx)
	if err != nil {
		return nil, nil, err
	}
	maxRetries := 5

	if settings.Service == Bedrock {
		return c.sendBedrockRequest(ctx, texts, images, accessKey, secretKey, awsSessionToken, maxRetries, settings)
	} else {
		return c.sendSagemakerRequest(ctx, texts, accessKey, secretKey, awsSessionToken, maxRetries, settings)
	}
}

func (c *Client) sendBedrockRequest(ctx context.Context,
	texts, images []string,
	awsKey, awsSecret, awsSessionToken string,
	maxRetries int,

View on GitHub (pinned to 75aa4b6d11)