{"record":{"id":"6ea006e3024d4bfd","repo":"testcontainers/testcontainers-java","slug":"the-tenant-name-is-not-configurable-on-slim-mode-so-this","errorCode":null,"errorMessage":"The tenant name is not configurable on slim mode, so this option will be ignored.","messagePattern":"The tenant name is not configurable on slim mode, so this option will be ignored\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainer.java","lineNumber":62,"sourceCode":"    public OceanBaseCEContainer(String dockerImageName) {\n        this(DockerImageName.parse(dockerImageName));\n    }\n\n    public OceanBaseCEContainer(DockerImageName dockerImageName) {\n        super(dockerImageName);\n        dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);\n\n        addExposedPorts(SQL_PORT, RPC_PORT);\n        setWaitStrategy(Wait.forLogMessage(\".*boot success!.*\", 1));\n    }\n\n    @Override\n    protected void configure() {\n        addEnv(\"MODE\", mode.name().toLowerCase());\n\n        if (!DEFAULT_TENANT_NAME.equals(tenantName)) {\n            if (mode == Mode.SLIM) {\n                logger().warn(\"The tenant name is not configurable on slim mode, so this option will be ignored.\");\n                // reset the tenant name to ensure the constructed username is correct\n                tenantName = DEFAULT_TENANT_NAME;\n            } else {\n                addEnv(\"OB_TENANT_NAME\", tenantName);\n            }\n        }\n\n        addEnv(\"OB_TENANT_PASSWORD\", password);\n    }\n\n    @Override\n    protected void waitUntilContainerStarted() {\n        getWaitStrategy().waitUntilReady(this);\n    }\n\n    @Override\n    public String getDriverClassName() {\n        return OceanBaseJdbcUtils.getDriverClass();","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/oceanbase/src/main/java/org/testcontainers/oceanbase/OceanBaseCEContainer.java#L44-L80","documentation":"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.","triggerScenarios":"Calling withTenantName(\"myTenant\") (non-default tenant) while withMode(Mode.SLIM) is set on OceanBaseCEContainer.","commonSituations":"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.","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."],"exampleFix":"// before\nnew OceanBaseCEContainer(\"oceanbase/oceanbase-ce:latest\")\n    .withMode(Mode.SLIM).withTenantName(\"customTenant\");\n// after\nnew OceanBaseCEContainer(\"oceanbase/oceanbase-ce:latest\")\n    .withMode(Mode.NORMAL).withTenantName(\"customTenant\");","handlingStrategy":"validation","validationCode":"if (mode == Mode.SLIM && !OceanBaseCEContainer.DEFAULT_TENANT_NAME.equals(tenantName)) {\n    throw new IllegalArgumentException(\"Custom tenant name is not supported in SLIM mode\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["oceanbase","configuration","slim-mode"],"backgroundTag":"conflicting-config-options","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}