quarkusio/quarkus · error · IllegalArgumentException

Parameter type should be provided.

Error message

Parameter type should be provided.

What it means

StorkConfigUtil.requireRegistrarTypeNotBlank is a guard used when building Stork registrar-only configuration (buildRegistrarOnlyConfiguration, addRegistrarTypeIfAbsent). It throws IllegalArgumentException when the service-registration 'type' parameter is null or blank, because a Stork registrar cannot be constructed without knowing which registry (consul, eureka, kubernetes) to talk to.

Source

Thrown at extensions/smallrye-stork/runtime/src/main/java/io/quarkus/stork/StorkConfigUtil.java:285

                Enumeration<InetAddress> addresses = iface.getInetAddresses();
                while (addresses.hasMoreElements()) {
                    InetAddress addr = addresses.nextElement();
                    if (!addr.isLoopbackAddress() && addr instanceof Inet4Address) {
                        return addr;
                    }
                }
            }
        } catch (SocketException e) {
            LOGGER.error("Error checking network interfaces", e);
        }

        return null;
    }

    public static void requireRegistrarTypeNotBlank(String type) {
        if (type == null || type.isBlank()) {
            throw new IllegalArgumentException("Parameter type should be provided.");
        }
    }

}

View on GitHub (pinned to e1c734241f)

Solutions

  1. Set quarkus.stork.<service>.service-registration.type (e.g. consul, eureka, kubernetes) in application.properties.
  2. If building configuration programmatically, pass a non-blank type string to StorkConfigUtil.
  3. Wrap the call with an explicit blank check and a helpful error message pointing at the offending service config.

Example fix

// before
String type = config.getValue("quarkus.stork." + service + ".service-registration.type");
StorkConfigUtil.requireRegistrarTypeNotBlank(type);

// after
String type = config.getValue("quarkus.stork." + service + ".service-registration.type");
if (type == null || type.isBlank()) {
    type = "consul"; // or fail fast with a service-specific message
}
StorkConfigUtil.requireRegistrarTypeNotBlank(type);
Defensive patterns

Strategy: validation

Validate before calling

if (type == null || type.isBlank()) {
    throw new IllegalStateException("quarkus.stork.<svc>.service-registration.type must be set before building registrar config");
}
StorkConfigUtil.requireRegistrarTypeNotBlank(type);

Try / catch

try {
    StorkConfigUtil.requireRegistrarTypeNotBlank(type);
} catch (IllegalArgumentException e) {
    LOG.error("Missing stork registrar type; check quarkus.stork.*.service-registration.type", e);
}

Prevention

When it happens

Trigger: Calling StorkConfigUtil APIs that build registrar configuration while the resolved registrar type string is null or empty — e.g. quarkus.stork.<service>.service-registration.type is unset and the caller passes it straight through, or programmatic configuration omits the type.

Common situations: quarkus.stork.my-service.service-registration.type left blank in application.properties; YAML config where the type key exists but has an empty value; code that computes the type from an environment variable that is not set; refactors that renamed the config key leaving the old one ignored.

Related errors


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