apache/shenyu · error · ShenyuException
please config the registerType and serverList
Error message
please config the registerType and serverList
What it means
The gateway-side register listener needs to know which registry type (zookeeper, etcd, nacos, ...) to use and the server list to connect to. If shenyu.register.register-type or shenyu.register.server-lists is blank, RegistryListener construction fails immediately with this ShenyuException.
Solutions
- Set shenyu.register.register-type (e.g. zookeeper, etcd, nacos) and shenyu.register.server-lists (comma-separated addresses)
- Disable registration (shenyu.register.enabled=false) if this deployment should not register
- Ensure the values are not overridden to empty by environment variables or profile configs
Example fix
# before
shenyu:
register:
enabled: true
# after
shenyu:
register:
enabled: true
register-type: zookeeper
server-lists: 127.0.0.1:2181 Defensive patterns
Strategy: validation
Validate before calling
if (StringUtils.isBlank(config.getRegisterType()) || StringUtils.isBlank(config.getServerLists())) {
throw new IllegalArgumentException("shenyu.register.register-type and server-lists are required");
} Try / catch
try {
new RegistryListener(registerConfig);
} catch (ShenyuException e) {
if (e.getMessage().contains("registerType and serverList")) {
log.error("Configure shenyu.register.register-type and shenyu.register.server-lists");
} else throw e;
} Prevention
- Ship a fully filled register block in every gateway profile
- Guard against env-var overrides that yield empty strings
- Only enable the registry starter when registration is intended
When it happens
Trigger: Enabling shenyu.register.enabled=true (or including the registry starter) without setting register-type and/or server-lists in configuration.
Common situations: Deploying the gateway with the cluster/registration starter but leaving the register block empty; copying only part of a sample config; overriding env vars that end up empty strings.
Understand the failure class
Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.
Related errors
- shenyu.jwt.secretKey is not configured. In a multi-instance…
- clientConfig must config " + getClientName() + " properties
- shenyu register into ShenyuDiscoveryService
- grpc client must config the contextPath, ipAndPort
- zookeeper url is empty
AI-assisted analysis of apache/shenyu@567142e072 (2026-09-12).
Data as JSON: /api/errors/cd12f917f50e3dc2.
Report an issue: GitHub.
Appendix: source
Thrown at shenyu-spring-boot-starter/shenyu-spring-boot-starter-registry/src/main/java/org/apache/shenyu/springboot/starter/registry/RegistryListener.java:57
private final String host;
private final String appName;
private final Properties props;
private final ShenyuInstanceRegisterRepository repository;
/**
* Instantiates a new Instance register listener.
*
* @param config the config
*/
public RegistryListener(final RegisterConfig config) {
String registerType = config.getRegisterType();
String serverLists = config.getServerLists();
if (StringUtils.isBlank(registerType) || StringUtils.isBlank(serverLists)) {
throw new ShenyuException("please config the registerType and serverList");
}
repository = ShenyuInstanceRegisterRepositoryFactory.newAndInitInstance(config);
this.props = config.getProps();
String name = props.getProperty("name");
this.appName = StringUtils.isBlank(name) ? "shenyu-gateway" : name;
String host = props.getProperty("host");
this.host = StringUtils.isBlank(host) ? IpUtils.getHost() : host;
}
@Override
public void onApplicationEvent(final WebServerInitializedEvent event) {
if (!registered.compareAndSet(false, true)) {
return;
}
String configPort = props.getProperty("port");
int port = StringUtils.isBlank(configPort) ? event.getWebServer().getPort() : Integer.parseInt(configPort);
InstanceEntity instanceEntity = buildInstanceRegisterDTO(port);
repository.persistInstance(instanceEntity);View on GitHub (pinned to 567142e072)