{"record":{"id":"fcdfd13ae35717ef","repo":"quarkusio/quarkus","slug":"aws-context-not-set-fcdfd1","errorCode":null,"errorMessage":"aws context not set","messagePattern":"aws context not set","errorType":"http","errorClass":"RuntimeException","httpStatus":500,"severity":"error","filePath":"integration-tests/amazon-lambda-rest-resteasy-reactive/src/main/java/io/quarkus/it/amazon/lambda/rest/resteasy/reactive/GreetingResource.java","lineNumber":55,"sourceCode":"        }\n        byte[] rtn = { 4, 5, 6 };\n        return rtn;\n    }\n\n    @POST\n    @Path(\"empty\")\n    public void empty() {\n\n    }\n\n    @GET\n    @Path(\"context\")\n    @Produces(MediaType.TEXT_PLAIN)\n    public void context(@Context com.amazonaws.services.lambda.runtime.Context ctx) {\n        if (ctx == null)\n            throw new RuntimeException();\n        if (ctx.getAwsRequestId() == null)\n            throw new RuntimeException(\"aws context not set\");\n    }\n\n    @GET\n    @Path(\"proxyRequestContext\")\n    @Produces(MediaType.TEXT_PLAIN)\n    public void proxyRequestContext(@Context AwsProxyRequestContext ctx) {\n        if (ctx == null)\n            throw new RuntimeException();\n    }\n\n    @Inject\n    AwsProxyRequest event;\n\n    @GET\n    @Path(\"inject-event\")\n    @Produces(MediaType.TEXT_PLAIN)\n    public void injectEvent() {\n        if (event == null)","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/amazon-lambda-rest-resteasy-reactive/src/main/java/io/quarkus/it/amazon/lambda/rest/resteasy/reactive/GreetingResource.java#L37-L73","documentation":"Thrown by the context endpoint when the injected com.amazonaws.services.lambda.runtime.Context is present but getAwsRequestId() returns null. This means the AWS Lambda context was not propagated into the JAX-RS request, so the resource cannot verify it is running behind a Lambda event. It indicates the Lambda REST binding did not supply a usable AWS context object.","triggerScenarios":"GET /context when the request is not routed through the AWS Lambda HTTP binding (e.g. running outside Lambda/SAM emulation), or a misconfigured AWS Lambda SOAP/REST integration that injects no Context, leaving an empty/anonymous context with null request id.","commonSituations":"Testing locally against plain Quarkus instead of the Lambda runtime or SAM local emulation; deploying with the wrong quarkus-amazon-lambda-rest packaging; invoking the function through a path that bypasses the Lambda event bridge.","solutions":["Deploy/run through the AWS Lambda runtime or SAM local so the Lambda Context is available for injection.","Verify the quarkus-amazon-lambda-rest extension is on the classpath and the function handler is the Quarkus provided one.","Check that aws.lambda.* configuration and the deployment package (zip) produced by the Quarkus Lambda build are used, not a plain JAR runner."],"exampleFix":"// before\nmvn package && java -jar target/quarkus-app/quarkus-run.jar // no Lambda context\n// after\nsam local invoke or deploy target/function.zip built by quarkus:package -Dquarkus.package.type=uber-jar? no -> use the lambda zip","handlingStrategy":"validation","validationCode":"if (!isRunningInLambdaEnvironment()) {\n    skipContextCheck(); // avoid GET /context outside AWS Lambda/SAM\n}","typeGuard":"boolean hasAwsContext(com.amazonaws.services.lambda.runtime.Context ctx) {\n    return ctx != null && ctx.getAwsRequestId() != null;\n}","tryCatchPattern":"try {\n    target(\"/context\").request().get();\n} catch (javax.ws.rs.InternalServerErrorException e) {\n    log.warn(\"AWS Lambda context not available in this environment\");\n}","preventionTips":["Only exercise Lambda context endpoints via SAM local or real Lambda deployment.","Use the Lambda zip package produced by the Quarkus build, not a plain JAR.","Confirm the quarkus-amazon-lambda-rest extension is included."],"tags":["aws-lambda","resteasy-reactive","context-injection"],"backgroundTag":"missing-runtime-context","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}