{"record":{"id":"e6ea6442e75b27d0","repo":"quarkusio/quarkus","slug":"build-step-s-does-not-produce-any-build-item-an","errorCode":null,"errorMessage":"Build step '%s' does not produce any build item and thus will never get executed. Either change the return type of the method to a build item type, add a parameter of type BuildProducer<[some build item type]>/Consumer<[some build item type]>, or annotate the method with @Produces. Use @Produce(ArtifactResultBuildItem.class) if you want to always execute this step.","messagePattern":"Build step '(.+?)' does not produce any build item and thus will never get executed\\. Either change the return type of the method to a build item type, add a parameter of type BuildProducer<\\[some build item type\\]>/Consumer<\\[some build item type\\]>, or annotate the method with @Produces\\. Use @Produce\\(ArtifactResultBuildItem\\.class\\) if you want to always execute this step\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/builder/src/main/java/io/quarkus/builder/BuildStepBuilder.java","lineNumber":185,"sourceCode":"     * @param flags a set of flags which modify the consume operation (must not be {@code null})\n     * @return this builder\n     */\n    public BuildStepBuilder consumes(Class<? extends BuildItem> type, ConsumeFlags flags) {\n        Assert.checkNotNullParam(\"type\", type);\n        checkType(type);\n        addConsumes(new ItemId(type), Constraint.REAL, flags);\n        return this;\n    }\n\n    /**\n     * Build this step into the chain.\n     *\n     * @return the chain builder that this step was added to\n     */\n    public BuildChainBuilder build() {\n        final BuildChainBuilder chainBuilder = this.buildChainBuilder;\n        if (produces.isEmpty()) {\n            throw new IllegalArgumentException(\n                    \"Build step '\" + buildStep.getId()\n                            + \"' does not produce any build item and thus will never get executed.\"\n                            + \" Either change the return type of the method to a build item type,\"\n                            + \" add a parameter of type BuildProducer<[some build item type]>/Consumer<[some build item type]>,\"\n                            + \" or annotate the method with @Produces.\"\n                            + \" Use @Produce(ArtifactResultBuildItem.class) if you want to always execute this step.\");\n        }\n        if (BuildChainBuilder.LOG_CONFLICT_CAUSING) {\n            chainBuilder.addStep(this, new Exception().getStackTrace());\n        } else {\n            chainBuilder.addStep(this, EMPTY_STACK_TRACE);\n        }\n        return chainBuilder;\n    }\n\n    /**\n     * Build this step into the chain if the supplier returns {@code true}.\n     *","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/builder/src/main/java/io/quarkus/builder/BuildStepBuilder.java#L167-L203","documentation":"OpenApiServlet's doGet asserts that an authenticated principal exists for requests to /openapi/*. If Elytron authentication did not populate the security context, getUserPrincipal() is null and the subsequent .getName() call throws, producing this error. It means the OpenAPI path was served without an authenticated identity.","triggerScenarios":"GET to /openapi/* with no/wrong credentials, or security policy allowing anonymous access, so req.getUserPrincipal() is null and .getName() throws.","commonSituations":"Hitting the endpoint without Authorization header; exposing /openapi/* anonymously in quarkus.http.auth.permission config while the test expects auth; elytron identity provider not registering; incorrect URL pattern causing the wrong servlet to run.","solutions":["Provide valid credentials on the /openapi/* request.","Configure quarkus.http.auth.permission.* to require authentication on /openapi/* and verify the elytron realm maps the user.","Check the servlet's urlPatterns and security constraints (@ServletSecurity) force authentication.","Null-check getUserPrincipal() before getName()."],"exampleFix":"// before\nif (req.getUserPrincipal().getName() == null) {\n    throw new RuntimeException(\"principal was null\");\n}\n// after\nif (req.getUserPrincipal() == null) {\n    throw new RuntimeException(\"principal was null\");\n}","handlingStrategy":"validation","validationCode":"if (!\"name\".equalsIgnoreCase(type)) {\n    throw new IllegalArgumentException(\"Only type=name is supported by fruitsFindBy\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    given().get(\"/fruitsFindBy?type=\" + type + \"&value=\" + value);\n} catch (Exception e) {\n    // fall back to type=name or fix the query parameter\n}","preventionTips":["Only pass type=name unless the endpoint has been extended","Read the endpoint signature/docs before invoking fruitsFindBy","Parametrize tests only over supported type values","Client-side whitelist of allowed query types"],"tags":["servlet","security","openapi","elytron"],"backgroundTag":"unauthenticated-request-no-principal","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}