testcontainers/testcontainers-java · warning
The tenant name is not configurable on slim mode, so this…
Error message
The tenant name is not configurable on slim mode, so this option will be ignored.
What it means
OceanBaseCEContainer.configure logs this warning when a custom tenant name is set while running in SLIM mode. The slim OceanBase image does not support tenant configuration, so the option is ignored and tenantName is reset to the default to keep the generated username correct. The container still starts, but with the default tenant rather than the one requested.
Solutions
- Switch to the full (non-slim) mode via withMode(Mode.NORMAL) if a custom tenant is required.
- Remove the withTenantName call and use the default tenant/username in SLIM mode.
- Update your connection credentials to use the default tenant's username, since the tenant name is reset.
Example fix
// before
new OceanBaseCEContainer("oceanbase/oceanbase-ce:latest")
.withMode(Mode.SLIM).withTenantName("customTenant");
// after
new OceanBaseCEContainer("oceanbase/oceanbase-ce:latest")
.withMode(Mode.NORMAL).withTenantName("customTenant"); Defensive patterns
Strategy: validation
Validate before calling
if (mode == Mode.SLIM && !OceanBaseCEContainer.DEFAULT_TENANT_NAME.equals(tenantName)) {
throw new IllegalArgumentException("Custom tenant name is not supported in SLIM mode");
} Prevention
- Only set custom tenants with the full OceanBase image/mode
- Keep mode and tenant configuration in one factory to avoid mismatches
- Use the default tenant username in SLIM mode connection strings
When it happens
Trigger: Calling withTenantName("myTenant") (non-default tenant) while withMode(Mode.SLIM) is set on OceanBaseCEContainer.
Common situations: Copying a full-mode OceanBase config to the slim image; assuming slim images expose the same OB_TENANT_NAME env knob; CI configs sharing a container factory between modes.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- Services named do not exist, but wait conditions have been…
- Could not get a port for
- Changing startup timeout is not supported with mode
- Unexpected scheme
- Configured Image Substitutor could not be loaded
AI-assisted analysis of testcontainers/testcontainers-java@8e549514e3 (2026-09-12).
Data as JSON: /api/errors/6ea006e3024d4bfd.
Report an issue: GitHub.
Appendix: source
Thrown at modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainer.java:62
public OceanBaseCEContainer(String dockerImageName) {
this(DockerImageName.parse(dockerImageName));
}
public OceanBaseCEContainer(DockerImageName dockerImageName) {
super(dockerImageName);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
addExposedPorts(SQL_PORT, RPC_PORT);
setWaitStrategy(Wait.forLogMessage(".*boot success!.*", 1));
}
@Override
protected void configure() {
addEnv("MODE", mode.name().toLowerCase());
if (!DEFAULT_TENANT_NAME.equals(tenantName)) {
if (mode == Mode.SLIM) {
logger().warn("The tenant name is not configurable on slim mode, so this option will be ignored.");
// reset the tenant name to ensure the constructed username is correct
tenantName = DEFAULT_TENANT_NAME;
} else {
addEnv("OB_TENANT_NAME", tenantName);
}
}
addEnv("OB_TENANT_PASSWORD", password);
}
@Override
protected void waitUntilContainerStarted() {
getWaitStrategy().waitUntilReady(this);
}
@Override
public String getDriverClassName() {
return OceanBaseJdbcUtils.getDriverClass();View on GitHub (pinned to 8e549514e3)