quarkusio/quarkus · error · DeploymentException

Invalid @GrpcClient `${targetInfo}` - client name cannot be

Error message

Invalid @GrpcClient `${targetInfo}` - client name cannot be empty

What it means

The @GrpcClient annotation names a client configuration entry (quarkus.grpc.clients.<name>.*). A value consisting only of whitespace (or an empty string) is rejected because the client name is needed to look up configuration and register the client.

Source

Thrown at extensions/grpc/deployment/src/main/java/io/quarkus/grpc/deployment/GrpcClientProcessor.java:181

                    MethodParameterInfo param = clientAnnotation.target().asMethodParameter();
                    clientName = param.method().parameterName(param.position());
                    if (clientName == null) {
                        throw new DeploymentException("Unable to determine the client name from the parameter at position "
                                + param.position()
                                + " in method "
                                + param.method().declaringClass().name() + "#" + param.method().name()
                                + "() - compile the class with debug info enabled (-g) or parameter names recorded (-parameters), or use GrpcClient#value() to specify the service name");
                    }
                } else {
                    // This should never happen because @GrpcClient has @Target({ FIELD, PARAMETER })
                    throw new IllegalStateException(clientAnnotation + " may not be declared at " + clientAnnotation.target());
                }
            } else {
                clientName = clientNameValue.asString();
            }

            if (clientName.trim().isEmpty()) {
                throw new DeploymentException(
                        "Invalid @GrpcClient `" + injectionPoint.getTargetInfo() + "` - client name cannot be empty");
            }

            GrpcClientBuildItem item;
            if (items.containsKey(clientName)) {
                item = items.get(clientName);
            } else {
                item = new GrpcClientBuildItem(clientName);
                items.put(clientName, item);
            }

            Type injectionType = injectionPoint.getRequiredType();
            if (injectionType.name().equals(GrpcDotNames.CHANNEL)) {
                item.addClient(new ClientInfo(GrpcDotNames.CHANNEL, ClientType.CHANNEL, registeredInterceptors));
                continue;
            }

            // Clients supported: blocking stubs, Mutiny stubs, Mutiny client implementing the service interface

View on GitHub (pinned to e1c734241f)

Solutions

  1. Set a non-empty client name: @GrpcClient("hello-service")
  2. Ensure any property/constant feeding the name resolves to a non-blank string at build time
  3. Match the name to a quarkus.grpc.clients.<name> config block

Example fix

// before
@Inject @GrpcClient("") Greeter greeter;

// after
@Inject @GrpcClient("hello-service") Greeter greeter;
Defensive patterns

Strategy: validation

Validate before calling

String name = "hello-service";
if (name == null || name.isBlank()) throw new IllegalStateException("@GrpcClient name must be non-blank");
// then: @GrpcClient(name)

Prevention

When it happens

Trigger: @GrpcClient("") or @GrpcClient(" ") is used on an injection point processed by discoverInjectedClients.

Common situations: Copy-pasted annotation with a placeholder left empty; config-driven name built from an empty property; refactoring that removed the name but left quotes.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/beedabfcd1626706. Report an issue: GitHub.