This message was deleted.
# ask-for-help
s
This message was deleted.
c
@Lamia Zaghloul removing the apigateway shouldn’t impact the bentoml service, technically you can modify the terraform script and remove the api gateway layer
m
I'm also hitting this error. Actually I'm not even trying to invoke the lambda. I am just trying to do what the lambda function does and directly invoke the endpoint through boto3. Did you find a way around it?
Copy code
runtime = boto3.client('runtime.sagemaker')
    try:
        sagemaker_response = runtime.invoke_endpoint(
            EndpointName="[endpointname]",
            ContentType=safeget(event, 'headers', 'Content-Type', default='application/json'),
            CustomAttributes=safeget(event, 'path', default='')[1:],
            Body=b64decode(event.get('body')) if event.get('isBase64Encoded') else event.get('body')
        )
Okay, it turned out I was making a dumb mistake: • I added some prints to the lambda to see what it was receiving that was different from my test JSON • Of course, it included a key 'path:'/predict' as part of the request, and when I added that to my test JSON and used it in the snippet above, it worked