weaviate/weaviate · error
AWS Access Key
Error message
AWS Access Key
What it means
This is the wrapper applied when the AWS embedding client (multi2vec-bedrock / text2vec-sagemaker / generative-aws) cannot resolve an AWS access key. `getAwsAccessKey` first checks the per-request context header `X-Aws-Access-Key`, then the server-level configured key; if both are empty it returns "no access key found ...", which vectorize wraps as "AWS Access Key: no access key found". Without credentials the client cannot sign the Bedrock/SageMaker request, so vectorization is refused before any API call.
Solutions
- Send `X-Aws-Access-Key` (and `X-Aws-Secret-Key`, optionally `X-Aws-Session-Token`) headers with every request that triggers AWS vectorization — imports AND queries.
- Or configure static credentials server-side via the module's environment variables (e.g. AWS_ACCESS_KEY / CLUSTER-level module config) so clients need not send headers.
- Confirm no reverse proxy or load balancer strips the X-Aws-* headers, and that the header names are exact and case-correct per the module docs.
- Note the module requires static keys — AWS IAM role-based credential chains are not consulted here, so ensure the env values are actually present in the Weaviate container.
Example fix
// before: query without credentials
result, err := client.GraphQL().Get().WithNearText(nearText).Do(ctx)
// err: "AWS Access Key: no access key found"
// after: supply per-request AWS headers
result, err := client.GraphQL().Get().WithNearText(nearText).
WithHeaders(map[string]string{
"X-Aws-Access-Key": os.Getenv("AWS_ACCESS_KEY"),
"X-Aws-Secret-Key": os.Getenv("AWS_SECRET_KEY"),
}).Do(ctx) Defensive patterns
Strategy: validation
Validate before calling
// run BEFORE any AWS-module vectorization call
if os.Getenv("AWS_ACCESS_KEY") == "" && requestHeaders.Get("X-Aws-Access-Key") == "" {
return fmt.Errorf("precondition failed: set X-Aws-Access-Key header or AWS_ACCESS_KEY env var")
}
if os.Getenv("AWS_SECRET_KEY") == "" && requestHeaders.Get("X-Aws-Secret-Key") == "" {
return fmt.Errorf("precondition failed: set X-Aws-Secret-Key header or AWS_SECRET_KEY env var")
} Type guard
func hasAwsCredentials(ctx context.Context, headers http.Header) bool {
return modulecomponents.GetValueFromContext(ctx, "X-Aws-Access-Key") != "" ||
os.Getenv("AWS_ACCESS_KEY") != "" ||
headers.Get("X-Aws-Access-Key") != ""
} Try / catch
result, err := client.GraphQL().Get().WithNearText(nearText).
WithHeaders(awsHeaders).Do(ctx)
if err != nil {
if strings.Contains(err.Error(), "AWS Access Key") || strings.Contains(err.Error(), "AWS Secret Key") {
// do not retry — credentials are missing; refresh keys and fail fast
return nil, fmt.Errorf("missing AWS credentials: %w", err)
}
return nil, err
} Prevention
- Configure static AWS keys in the Weaviate module env so every request has credentials.
- If using header auth, attach X-Aws-Access-Key/X-Aws-Secret-Key to BOTH import and search requests.
- Check proxies/gateways do not strip X-Aws-* headers.
- Remember the module does not use IAM instance profiles — verify env vars inside the container, not on the host.
When it happens
Trigger: Any vectorization through the AWS module (Vectorize, VectorizeQuery, VectorizeMultiModal, imports and nearText/nearImage searches) when neither the request header `X-Aws-Access-Key` nor the module configuration (e.g. AWS_ACCESS_KEY env var / moduleConfig) provides an access key. The same request will next fail on 'AWS Secret Key' if the secret is also missing.
Common situations: Deployments where the operator expected instance-profile/IRSA credentials but the module only supports static keys; headers set on imports but forgotten on search requests (or stripped by a proxy/gateway); keys set for the wrong module or misspelled env var names; migrating from header-based auth after a version change.
Related errors
- cannot revectorize class
- no access key found neither in request header…
- no secret found neither in request header: X-Aws-Secret-Key…
- remote client vectorize
- should vectorize: is vector empty
AI-assisted analysis of weaviate/weaviate@75aa4b6d11 (2026-09-04).
Data as JSON: /api/errors/7af839975cf8bb4a.
Report an issue: GitHub.
Appendix: source
Thrown at usecases/modulecomponents/clients/aws/aws.go:254
}
}
if len(images) > 0 {
_, imageEmbeddings, err = c.vectorize(ctx, nil, images, settings)
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)
}
}
View on GitHub (pinned to 75aa4b6d11)