ISSUE DESCRIPTION [BUG] API Gateway REST: path-based invocation…
- User
ISSUE DESCRIPTION
[BUG] API Gateway REST: path-based invocation (/restapis/{id}/{stage}/user_request/{path}) returns 404 After creating a REST API, adding a resource with a Lambda proxy integration, and deploying to a stage, invoking via the documented path format returns "Invalid API id specified" (404).
Reproduction
# Create Lambda function aws --endpoint-url=http://localhost:4566 lambda create-function \ --function-name test-fn --runtime nodejs22.x --handler index.handler \ --role arn:aws:iam::000000000000:role/r \ --code S3Bucket=...,S3Key=... # Create REST API + resource + integration + deployment API_ID=$(aws --endpoint-url=http://localhost:4566 apigateway create-rest-api --name test | jq -r '.id') ROOT_ID=$(aws --endpoint-url=http://localhost:4566 apigateway get-resources --rest-api-id $API_ID | jq -r '.items[0].id') RES_ID=$(aws --endpoint-url=http://localhost:4566 apigateway create-resource --rest-api-id $API_ID --parent-id $ROOT_ID --path-part hello | jq -r '.id') aws --endpoint-url=http://localhost:4566 apigateway put-method --rest-api-id $API_ID --resource-id $RES_ID --http-method GET --authorization-type NONE aws --endpoint-url=http://localhost:4566 apigateway put-integration --rest-api-id $API_ID --resource-id $RES_ID --http-method GET --type AWS_PROXY --integration-http-method POST --uri "arn:aws:apigateway:eu-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:eu-west-2:000000000000:function:test-fn/invocations" aws --endpoint-url=http://localhost:4566 apigateway create-deployment --rest-api-id $API_ID --stage-name dev # Invoke via documented path curl http://localhost:4566/restapis/$API_ID/dev/_user_request_/helloActual behavior
HTTP 404:
{"message":"Invalid API id specified"}Expected behavior
Request routes through API Gateway to the Lambda function and returns the Lambda response.
Notes
- The API is created successfully (confirmed via get-rest-api and Floci logs)
- The deployment succeeds
- Management plane operations (create/get/update APIs) all work correctly
- Only the data plane invocation path fails
- Tested with Floci 1.5.16
Environment
- Floci 1.5.16 (docker.io/floci/floci:latest)
- Podman 5.8.0 rootless (also likely reproducible with Docker)
- AWS CLI v2
- Region: eu-west-2
Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository using command. Additionally, you can use and to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call ) using or commands. However you don't need to use or before submitting your changes. In fact, only submits currently unstaged changes because it uses to get the changes that need to be submitted. Assistant
Let me start by understanding the issue. The problem is with API Gateway REST API path-based invocation. When using the path format
/restapis/{id}/{stage}/_user_request_/{path}, it returns 404 with "Invalid API id specified".Let me explore the repository structure first to understand how it's organized and find the relevant code.
Assistant
This appears to be a Java project (Maven-based). Let me explore the source code structure.
Assistant
Let me search for apigateway-related files:
Assistant
Let me examine the key files related to the issue - the
_user_request_path handling.Assistant
Now let me examine
AwsServiceRouterandApiGatewayExecuteController:Assistant
This is for AWS integration routing, not for the URL path routing. Let me look at
ApiGatewayExecuteControllerwhich has thedispatchmethod.Assistant
Let me look at
ApiGatewayController.javato check the management plane routingAssistant
Let me investigate the application setup and how resources are registered
Assistant
Let me find the Quarkus application main / JAX-RS configuration:
Assistant
Let me look for application configuration and properties files
Assistant
Let me look at the user request integration test to understand how it's supposed to work
Assistant
Let me check if there's a custom JAX-RS application or any configuration that explicitly registers
Assistant
Let me try a different approach:
Assistant
Let me list all the route mappings in
ApiGatewayControllerto see if any could match the_user_request_pathAssistant
Let me search for the error message "Invalid API id specified
Assistant
Let me check the
ApiGatewayAwsExecuteController:Assistant
Let me try to run the specific test to see if it passes or fails:
Assistant
The mvnw script has an issue with HOME not being set. Let me set it and try again.
Assistant
The test passes. Let me look more carefully at the
ApiGatewayV2Service.getApimethod to understand what happens when it's called with a REST API ID:Assistant
Let me look at the
getApimethod inApiGatewayV2Service:Assistant
Let me look at
ApiGatewayService.getRestApi:Assistant
Let me check the git log for recent changes related to the
_user_request_path or API Gateway:Assistant
Let me search for any commit that mentions
_user_request_:Assistant
Let me check whether that commit is in the current branch or not:
Assistant
Let me look at the changes introduced by this commit:
Assistant
Let me look at the diff in that commit:
Assistant
Let me use the correct flag:
Assistant
Let me look at the
ApiGatewayCustomDomainFilter:Assistant
Let me check the tags to understand version history:
Assistant
Let me check differently:
Assistant
Let me check all the GET endpoints that start with
/restapis/to see if there's a collision:Assistant
Let me check the annotations on
ApiGatewayExecuteController:Assistant
Let me check the application configuration:
Assistant
Let me check
ApiGatewayService.getStageAssistant
Let me look at the
getStagemethod:Assistant
Let me check if there are any wildcard patterns in ApiGatewayController that might intercept the request
Assistant
Let me check the Quarkus/RESTEasy version from the pom.xml
Assistant
Let me check the
RegionResolver:Assistant
Let me look at the full
getRestApiand `restApiKeyAssistant
Let me look at the key method and understand how API IDs are stored:
Assistant
Let me find the
restApiKeymethod:Assistant
Let me fix the grep
Assistant
Let me search for the apiKey method that builds the REST API
Assistant
Let me look at the
Assistant
Let me look at the full dispatch method in ApiGatewayExecuteController:
Assistant
Let me read the dispatch method from line 226:
Assistant
Let me search for any catch-all patterns in ApiGatewayController:
Assistant
Let me check annotations on the AwsExecuteController
Assistant
Let me check if there's any bean discovery configuration:
Assistant
Let me verify the commit history and check if the fix is actually in the current branch
Assistant
Let me verify the commit is in the history
Assistant
Let me create a quick reproduction test to confirm the current behavior:
Assistant
Let me check for any CDI configuration files
Assistant
Let me check for any filters or interceptors that might intercept the request:
Assistant
Let me check if the
SqsQueueUrlRouterFiltercould be interfering:Assistant
Let me look at the Lambda URL routing filter:
Assistant
Let me check S3VirtualHostFilter:
Assistant
Let me check which controllers have explicit scope annotations:
Assistant
Let me check the ApiGatewayController annotations:
Assistant
Let me check if there's a custom Vert.x router or HTTP filter:
Assistant
Let me look at the AwsJsonController to see if it could interfere:
Assistant
Let me check the AwsQueryController:
Assistant
Let me run all API Gateway tests to confirm everything works
Assistant
Let me check the test configuration
Assistant
Let me verify the fix is complete by checking references
Assistant
Let me check the current git status:
Assistant
Let me look at the dispatchV2 method:
Assistant
All tests pass (84 tests, 0 failures). The
ApiGatewayUserRequestControlleris in place and correctly handles the_user_request_path. Let me verify once more by quickly running the specific test:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.