Skip to content

NotFoundException: API

0

I have a django project that uses codebuild that was set up previously by other web developers. I made changes to my repository on codecommit and when code pipeline tries to run, I have this error message. raise error_class(parsed_response, operation_name) botocore.errorfactory.NotFoundException: An error occurred (NotFoundException) when calling the GetRestApi operation: Invalid API identifier specified. I checked API gateway but couldn't find any API identifier with that name and since it runs through codebuild and code pipeline, I can't change that manually myself. I am not sure how to fix this and would love to rollback to a version of my website that worked because now I have an "internal server error" whenever anyone tries to go on the website.

1 Answer
0

Hello,

From your query, I understand that you have made changes to your repository on code commit and when the code pipeline tries to run, you were observing the below message:

error message. raise error_class(parsed_response, operation_name) botocore.errorfactory.NotFoundException: An error occurred (NotFoundException) when calling the GetRestApi operation: Invalid API identifier specified

This kind of message generally occurs when you are using boto3 client for 'apigatewayv2' with REST API. Kindly note that REST API is not V2 API and you need to use boto3 client for 'apigateway' with REST API. API Gateway V2 is used to deploy and create websocket APIs, whereas Version 1 is used to deploy and create REST APIs.

A sample snippet will be something like this:

==========

import boto3

client = boto3.client('apigateway')

response = client.get_rest_api( restApiId='string' )

==========

[+] https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/apigateway/client/get_rest_api.html#

AWS
SUPPORT ENGINEER

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.