ssm parameter store key with prefix '/' is not supported
I'm getting a 502 bad gateway when I followed the guide. This is my request:
curl $OPENAI_BASE_URL/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "anthropic.claude-3-sonnet-20240229-v1:0",
"messages": [
{
"role": "user",
"content": "Hello!"
}
]
}'
This is my response:
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>
I also created this on US-WEST-2 (Oregon). I'm not sure what could be the cause of this issue?
I was able to verify that my API key is correct, and the URL is correct. I'm not sure what part of this am I doing incorrectly.
Sorry, I can't reproduce this issue, can you please check if you have enable the access to Sonnet model in Bedrock console.
Also, you can try with below request and see if get a successful response.
curl -s $OPENAI_BASE_URL/models -H "Authorization: Bearer $OPENAI_API_KEY"
I'm having the same issue in us-east-1 in one of my accounts; the other (setup with the same deployment tool from this repo, same models, etc) is working fine. The curl command above also returns the same 502 message for the effected account. Looking in cloudwatch I see the following errors in the lambda function logs:
[ERROR] ParameterNotFound: An error occurred (ParameterNotFound) when calling the GetParameter operation: Traceback (most recent call last): File "/var/lang/lib/python3.12/importlib/__init__.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1387, in _gcd_import File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed File "/var/task/api/app.py", line 10, in <module> from api.routers import model, chat, embeddings File "/var/task/api/routers/model.py", line 5, in <module> from api.auth import api_key_auth File "/var/task/api/auth.py", line 13, in <module> api_key = ssm.get_parameter(Name=api_key_param, WithDecryption=True)["Parameter"][ File "/var/lang/lib/python3.12/site-packages/botocore/client.py", line 565, in _api_call return self._make_api_call(operation_name, kwargs) File "/var/lang/lib/python3.12/site-packages/botocore/client.py", line 1021, in _make_api_call raise error_class(parsed_response, operation_name)
Edit: after double checking my config, it was caused by having the wrong value in the parameter store. It's working now.
Please make sure you create the ssm parameter in every region you deployed the tool as per step 1.
I had the same error. To fix it, I added "ssm:GetParametersByPath" to the policy. Possible explanation: In the parameter store I had to fully qualify the parameter name, something like /org/member/...; this implies path navigation.
Old issue, close for no updates. Please raise a new one if the bug still exists.