{"record":{"id":"6c02f37cd0c0f5fa","repo":"quarkusio/quarkus","slug":"unable-to-determine-the-client-name-from-the-param","errorCode":null,"errorMessage":"Unable to determine the client name from the parameter at position ${position} in method ${class}#${method}() - compile the class with debug info enabled (-g) or parameter names recorded (-parameters), or use GrpcClient#value() to specify the service name","messagePattern":"Unable to determine the client name from the parameter at position (.+?) in method (.+?)#(.+?)\\(\\) - compile the class with debug info enabled \\(-g\\) or parameter names recorded \\(-parameters\\), or use GrpcClient#value\\(\\) to specify the service name","errorType":"validation","errorClass":"DeploymentException","httpStatus":null,"severity":"error","filePath":"extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcClientProcessor.java","lineNumber":166,"sourceCode":"\n        for (InjectionPointInfo injectionPoint : beanDiscovery.getInjectionPoints()) {\n            AnnotationInstance clientAnnotation = injectionPoint.getRequiredQualifier(GrpcDotNames.GRPC_CLIENT);\n            if (clientAnnotation == null) {\n                continue;\n            }\n            Set<String> registeredInterceptors = getRegisteredInterceptors(injectionPoint);\n\n            String clientName;\n            AnnotationValue clientNameValue = clientAnnotation.value();\n            if (clientNameValue == null || clientNameValue.asString().equals(GrpcClient.ELEMENT_NAME)) {\n                // Determine the service name from the annotated element\n                if (clientAnnotation.target().kind() == Kind.FIELD) {\n                    clientName = clientAnnotation.target().asField().name();\n                } else if (clientAnnotation.target().kind() == Kind.METHOD_PARAMETER) {\n                    MethodParameterInfo param = clientAnnotation.target().asMethodParameter();\n                    clientName = param.method().parameterName(param.position());\n                    if (clientName == null) {\n                        throw new DeploymentException(\"Unable to determine the client name from the parameter at position \"\n                                + param.position()\n                                + \" in method \"\n                                + param.method().declaringClass().name() + \"#\" + param.method().name()\n                                + \"() - compile the class with debug info enabled (-g) or parameter names recorded (-parameters), or use GrpcClient#value() to specify the service name\");\n                    }\n                } else {\n                    // This should never happen because @GrpcClient has @Target({ FIELD, PARAMETER })\n                    throw new IllegalStateException(clientAnnotation + \" may not be declared at \" + clientAnnotation.target());\n                }\n            } else {\n                clientName = clientNameValue.asString();\n            }\n\n            if (clientName.trim().isEmpty()) {\n                throw new DeploymentException(\n                        \"Invalid @GrpcClient `\" + injectionPoint.getTargetInfo() + \"` - client name cannot be empty\");\n            }\n","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcClientProcessor.java#L148-L184","documentation":"When @GrpcClient is placed on a method parameter (CDI initializer) without an explicit value, Quarkus derives the client name from the parameter name, which requires debug info (-g) or -parameters compiler flags. When the parameter name is not recorded in the bytecode, deployment fails with this error.","triggerScenarios":"A method like void setGreeter(@GrpcClient Greeter g) has no name recorded for the parameter at the given position: the class was compiled without -g and without -parameters, and @GrpcClient.value() was not set.","commonSituations":"Maven/Gradle builds that strip debug info (maven.compiler.debug=false); Kotlin/other-language compilation without parameter name retention; annotated methods in dependencies compiled elsewhere; IDE-compiled classes without -parameters.","solutions":["Add value to the annotation: @GrpcClient(\"service-name\") on the parameter","Compile with parameter names: set <parameters>true</parameters> (maven.compiler.parameters) or enable -g debug info","Set maven-compiler-plugin <debug>true</debug> and <debuglevel>names</debuglevel>","Move the injection to a field, where the field name is always available"],"exampleFix":"// before\n@Inject\nvoid setGreeter(@GrpcClient Greeter greeter) { ... }\n\n// after\n@Inject\nvoid setGreeter(@GrpcClient(\"hello-service\") Greeter greeter) { ... }","handlingStrategy":"validation","validationCode":"// annotate parameters explicitly instead of relying on -parameters\nvoid setGreeter(@GrpcClient(\"hello-service\") Greeter greeter) { ... }\n// or verify build config: maven.compiler.parameters=true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit value to @GrpcClient on parameter injection","Enable <parameters>true</parameters> in maven-compiler-plugin project-wide","Prefer field injection where the name is always retained"],"tags":["grpc","cdi","compiler-flags"],"backgroundTag":"missing-parameter-names","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"}