quarkusio/quarkus · error · IllegalArgumentException

Impossible to register service. Missing required 'type' for

Error message

Impossible to register service. Missing required 'type' for the following services: ${services}

What it means

StorkRegistrarConfigRecorder.setupServiceRegistrarConfig collects every service whose registration config lacks a 'type'. If any are missing, it aggregates the service names and throws IllegalArgumentException listing them, because Stork cannot instantiate service registrars without knowing the target registry implementation.

Source

Thrown at extensions/smallrye-stork/runtime/src/main/java/io/quarkus/stork/StorkRegistrarConfigRecorder.java:85

        } else {
            failOnMissingRegistrarTypesForMultipleRegistrars(registrationConfigs);
        }
    }

    private static void failOnMissingRegistrarTypesForMultipleRegistrars(List<ServiceConfig> registrationConfigs) {
        List<String> servicesWithMissingType = new ArrayList<>();
        for (ServiceConfig registrationConfig : registrationConfigs) {
            var enabled = Boolean
                    .parseBoolean(registrationConfig.serviceRegistrar().parameters().getOrDefault("enabled", "true"));
            if (enabled && registrationConfig.serviceRegistrar().type().isBlank()) {
                servicesWithMissingType.add(registrationConfig.serviceName());
                LOGGER.info("Missing 'type' for service '" + registrationConfig.serviceName()
                        + "'. This may lead to a runtime error.");
            }

        }
        if (!servicesWithMissingType.isEmpty()) {
            throw new IllegalArgumentException(
                    "Impossible to register service. Missing required 'type' for the following services: " +
                            String.join(", ", servicesWithMissingType));
        }
    }

}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Add quarkus.stork.<service>.service-registration.type for every service named in the error message (comma-separated list).
  2. Diff your active config profile (application-%prod.properties etc.) — the missing key may only be absent in the failing profile.
  3. Check for key typos; unknown properties are ignored so a misspelled 'type' key behaves exactly like a missing one.

Example fix

// before (application.properties)
quarkus.stork.orders.service-registration.type=consul
quarkus.stork.billing.service-registration.address=billing-svc

// after
quarkus.stork.orders.service-registration.type=consul
quarkus.stork.billing.service-registration.type=eureka
quarkus.stork.billing.service-registration.address=billing-svc
Defensive patterns

Strategy: validation

Validate before calling

// Before startup, verify each configured stork service declares a type
// quarkus.stork.<service>.service-registration.type must exist for every
// service listed under quarkus.stork.*

Try / catch

try {
    recorder.setupServiceRegistrarConfig(...);
} catch (IllegalArgumentException e) {
    LOG.error("Stork registrar config incomplete: " + e.getMessage());
}

Prevention

When it happens

Trigger: Multiple quarkus.stork.<service>.service-registration entries exist but one or more omit quarkus.stork.<service>.service-registration.type; setupServiceRegistrarConfig runs at startup and fails listing all offending service names.

Common situations: Bulk-editing application.properties and dropping a type line for one of several registered services; per-environment config files where only prod defines types; a typo like service-registartion.type that Quarkus silently ignores; adding a new service entry and forgetting its type.

Related errors


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