{"record":{"id":"6fb3ceeace610a74","repo":"weaviate/weaviate","slug":"aws-secret-key-6fb3ce","errorCode":null,"errorMessage":"AWS Secret Key","messagePattern":"AWS Secret Key","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"usecases/modulecomponents/clients/aws/aws.go","lineNumber":258,"sourceCode":"\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &modulecomponents.VectorizationCLIPResult[[]float32]{\n\t\tTextVectors:  textEmbeddings,\n\t\tImageVectors: imageEmbeddings,\n\t}, nil\n}\n\nfunc (c *Client) vectorize(ctx context.Context, texts, images []string, settings Settings,\n) ([][]float32, [][]float32, error) {\n\taccessKey, err := c.getAwsAccessKey(ctx)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"AWS Access Key\")\n\t}\n\tsecretKey, err := c.getAwsAccessSecret(ctx)\n\tif err != nil {\n\t\treturn nil, nil, errors.Wrapf(err, \"AWS Secret Key\")\n\t}\n\tawsSessionToken, err := c.getAwsSessionToken(ctx)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tmaxRetries := 5\n\n\tif settings.Service == Bedrock {\n\t\treturn c.sendBedrockRequest(ctx, texts, images, accessKey, secretKey, awsSessionToken, maxRetries, settings)\n\t} else {\n\t\treturn c.sendSagemakerRequest(ctx, texts, accessKey, secretKey, awsSessionToken, maxRetries, settings)\n\t}\n}\n\nfunc (c *Client) sendBedrockRequest(ctx context.Context,\n\ttexts, images []string,\n\tawsKey, awsSecret, awsSessionToken string,\n\tmaxRetries int,","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/weaviate/weaviate/blob/75aa4b6d11f8818305aafd4440b4e32794f7ca04/usecases/modulecomponents/clients/aws/aws.go#L240-L276","documentation":"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.","triggerScenarios":"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'.","commonSituations":"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.","solutions":["Set the module-level secret in the Weaviate module configuration (environment variable consumed as the AWS secret access key) and restart Weaviate.","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).","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.","Check that no reverse proxy/ingress strips the X-AWS-* headers from client requests."],"exampleFix":"// before: client sends only the access key\nheaders := map[string]string{\"X-AWS-Access-Key\": accessKey}\n// after: send both credentials\nheaders := map[string]string{\n  \"X-AWS-Access-Key\":        accessKey,\n  \"X-AWS-Secret-Access-Key\": secretKey,\n}","handlingStrategy":"validation","validationCode":"const required = [\"X-AWS-Access-Key\", \"X-AWS-Secret-Access-Key\"];\nconst missing = required.filter(h => !headers[h] && !moduleConfigHasAwsSecret);\nif (missing.length) throw new Error(`AWS vectorization requires: ${missing.join(\", \")}`);","typeGuard":null,"tryCatchPattern":"try {\n  await weaviate.collections.get(name).query.nearText(query, {headers: awsHeaders});\n} catch (e) {\n  if (String(e).includes(\"AWS Secret Key\")) {\n    console.error(\"AWS secret not configured: set X-AWS-Secret-Access-Key header or module-level secret\");\n  }\n  throw e;\n}","preventionTips":["Configure the module-level AWS secret at deploy time and assert it in startup/health checks.","Always send X-AWS-Access-Key and X-AWS-Secret-Access-Key as a pair when using per-request credentials.","Add a canary vectorization call to deployment smoke tests that fails fast on missing credentials.","Document that this client requires static credentials and does not use the ambient IAM role chain."],"tags":["aws","authentication","configuration","missing-credential"],"backgroundTag":"missing-aws-secret-key","analyzedSha":"75aa4b6d11f8818305aafd4440b4e32794f7ca04","analyzedAt":"2026-09-04T14:58:20.392Z","contentChangedAt":"2026-09-04T14:58:20.392Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}