{"record":{"id":"7b5c81c4d0e76613","repo":"quarkusio/quarkus","slug":"principal-was-null-7b5c81","errorCode":null,"errorMessage":"principal was null","messagePattern":"principal was null","errorType":"exception","errorClass":"RuntimeException","httpStatus":500,"severity":"error","filePath":"integration-tests/elytron-undertow/src/main/java/io/quarkus/it/undertow/elytron/OpenApiServlet.java","lineNumber":16,"sourceCode":"package io.quarkus.it.undertow.elytron;\n\nimport java.io.IOException;\n\nimport jakarta.servlet.ServletException;\nimport jakarta.servlet.annotation.WebServlet;\nimport jakarta.servlet.http.HttpServlet;\nimport jakarta.servlet.http.HttpServletRequest;\nimport jakarta.servlet.http.HttpServletResponse;\n\n@WebServlet(name = \"ServletGreeting\", urlPatterns = \"/openapi/*\")\npublic class OpenApiServlet extends HttpServlet {\n    @Override\n    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n        if (req.getUserPrincipal().getName() == null) {\n            throw new RuntimeException(\"principal was null\");\n        }\n        resp.setStatus(200);\n        resp.addHeader(\"Content-Type\", \"text/plain\");\n        resp.getWriter().write(\"hello\");\n    }\n\n    @Override\n    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n        if (req.getUserPrincipal().getName() == null) {\n            throw new RuntimeException(\"principal was null\");\n        }\n        String name = req.getReader().readLine();\n        resp.setStatus(200);\n        resp.addHeader(\"Content-Type\", \"text/plain\");\n        resp.getWriter().write(\"hello \" + name);\n    }\n}\n","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/elytron-undertow/src/main/java/io/quarkus/it/undertow/elytron/OpenApiServlet.java#L1-L34","documentation":"Sentinel check in an elytron-undertow integration-test servlet (/openapi/*): the authenticated request's UserPrincipal (or its name) is null where the test expects an authenticated principal. Test-app guard on the request security context, not production validation.","triggerScenarios":"Thrown at integration-tests/elytron-undertow/src/main/java/io/quarkus/it/undertow/elytron/OpenApiServlet.java:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the client authenticates before calling the endpoint","Check the security constraint covering /openapi/*"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}