{"record":{"id":"f93776932b28d96a","repo":"testcontainers/testcontainers-java","slug":"extension-disabling-timed-out-after-timeout-getseconds","errorCode":null,"errorMessage":"Extension disabling timed out after '${timeout.getSeconds()}' seconds. Maybe you are using a HiveMQ Community Edition image, which does not support disabling of extensions","messagePattern":"Extension disabling timed out after '(.+?)' seconds\\. Maybe you are using a HiveMQ Community Edition image, which does not support disabling of extensions","errorType":"exception","errorClass":"TimeoutException","httpStatus":null,"severity":"error","filePath":"modules/hivemq/src/main/java/org/testcontainers/hivemq/HiveMQContainer.java","lineNumber":451,"sourceCode":"    public void disableExtension(\n        final @NotNull String extensionName,\n        final @NotNull String extensionDirectory,\n        final @NotNull Duration timeout\n    ) throws TimeoutException {\n        final String regEX = \"(.*)Extension \\\"\" + extensionName + \"\\\" version (.*) stopped successfully(.*)\";\n        try {\n            final String containerPath =\n                \"/opt/hivemq/extensions\" + PathUtil.prepareInnerPath(extensionDirectory) + \"DISABLED\";\n\n            final CountDownLatch latch = new CountDownLatch(1);\n            containerOutputLatches.put(regEX, latch);\n\n            execInContainer(\"touch\", containerPath);\n            LOGGER.info(\"Putting DISABLED file into container path '{}'\", containerPath);\n\n            final boolean await = latch.await(timeout.getSeconds(), TimeUnit.SECONDS);\n            if (!await) {\n                throw new TimeoutException(\n                    \"Extension disabling timed out after '\" +\n                    timeout.getSeconds() +\n                    \"' seconds. \" +\n                    \"Maybe you are using a HiveMQ Community Edition image, \" +\n                    \"which does not support disabling of extensions\"\n                );\n            }\n        } catch (final InterruptedException | IOException e) {\n            throw new RuntimeException(e);\n        } finally {\n            containerOutputLatches.remove(regEX);\n        }\n    }\n\n    /**\n     * Disables the extension with the given name and extension directory name.\n     * This method blocks until the HiveMQ log for successful disabling is consumed or it times out after 60 seconds.\n     * Note: Disabling Extensions is a HiveMQ Enterprise feature, it will not work when using the HiveMQ Community Edition.","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/hivemq/src/main/java/org/testcontainers/hivemq/HiveMQContainer.java#L433-L469","documentation":"disableExtension creates a DISABLED file in the extension's container directory and waits on a latch that is released when the HiveMQ control-center callback signals the extension was disabled. If the latch is not released within the given timeout, a TimeoutException is thrown, most commonly because the running image (HiveMQ Community Edition) does not support extension disabling via the control center.","triggerScenarios":"Calling container.disableExtension(extensionId, duration) where the HiveMQ broker never acknowledges the disable — e.g. a Community Edition image, an extension that crashed on startup, a wrong extension id, or a container not yet fully started.","commonSituations":"Using hivemq/hivemq-ce (Community Edition) images that lack the enterprise control-center API; extension id typo; disable called before the extension finished enabling; timeout too short on a slow CI machine.","solutions":["Use a HiveMQ Enterprise Edition image; Community Edition does not support disabling extensions.","Verify the extension id matches the id in hivemq-extension.xml.","Increase the timeout Duration (e.g. Duration.ofSeconds(30)) for slow environments.","Ensure the container and extension are fully started before calling disableExtension."],"exampleFix":"// before\ncontainer.disableExtension(\"my-extension\"); // CE image, always times out\n// after\n// use hivemq/hivemq4 enterprise image, then:\ncontainer.disableExtension(\"my-extension\", Duration.ofSeconds(30));","handlingStrategy":"try-catch","validationCode":"boolean enterprise = container.getDockerImageName().contains(\"hivemq4\") || System.getenv(\"HIVEMQ_LICENSE\") != null;\nif (!enterprise) throw new IllegalStateException(\"Extension disabling requires HiveMQ Enterprise Edition\");","typeGuard":null,"tryCatchPattern":"try {\n    container.disableExtension(extId, Duration.ofSeconds(30));\n} catch (TimeoutException e) {\n    throw new IllegalStateException(\"Extension disable not acknowledged — check image edition and extension id\", e);\n}","preventionTips":["Use Enterprise Edition images when exercising enable/disable.","Await container/extension startup before toggling extensions.","Use generous timeouts on CI."],"tags":["hivemq","timeout","unsupported-feature","extension"],"backgroundTag":"request-timeout","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"}