{"record":{"id":"effae85d02d093cd","repo":"testcontainers/testcontainers-java","slug":"extension-enabling-timed-out-after-timeout-getseconds","errorCode":null,"errorMessage":"Extension enabling timed out after '${timeout.getSeconds()}' seconds. Maybe you are using a HiveMQ Community Edition image, which does not support disabling of extensions","messagePattern":"Extension enabling 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":542,"sourceCode":"    public void enableExtension(\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 (.*) started 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(\"rm\", \"-rf\", containerPath);\n            LOGGER.info(\"Removing DISABLED file in container path '{}'\", containerPath);\n\n            final boolean await = latch.await(timeout.getSeconds(), TimeUnit.SECONDS);\n            if (!await) {\n                throw new TimeoutException(\n                    \"Extension enabling 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     * Enables the extension with the given name and extension directory name.\n     * This method blocks until the HiveMQ log for successful enabling is consumed or it times out after 60 seconds.\n     * Note: Enabling Extensions is a HiveMQ Enterprise feature, it will not work when using the HiveMQ Community Edition.","sourceCodeStart":524,"sourceCodeEnd":560,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/hivemq/src/main/java/org/testcontainers/hivemq/HiveMQContainer.java#L524-L560","documentation":"enableExtension removes the DISABLED file in the extension's container directory and awaits a latch released by the HiveMQ control-center callback when the extension is enabled. If no acknowledgement arrives within the timeout, a TimeoutException is thrown. As with disabling, Community Edition images do not support this control-center mechanism (the message text reuses 'disabling' wording).","triggerScenarios":"Calling container.enableExtension(extensionId, duration) where the broker never reports the extension enabled — Community Edition image, wrong extension id, extension failing to start after the DISABLED file is removed, or a too-short timeout.","commonSituations":"CE image without enterprise control center; extension fails at startup after enable (bad descriptor/config), so the callback never fires; container stopping concurrently; slow CI exceeding the default timeout.","solutions":["Use a HiveMQ Enterprise Edition image that supports extension enable/disable.","Check container logs for extension startup errors after enabling.","Confirm the extension id is correct.","Increase the timeout Duration."],"exampleFix":"// before\ncontainer.enableExtension(\"my-extension\", Duration.ofSeconds(2)); // too short\n// after\ncontainer.enableExtension(\"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 enabling requires HiveMQ Enterprise Edition\");","typeGuard":null,"tryCatchPattern":"try {\n    container.enableExtension(extId, Duration.ofSeconds(30));\n} catch (TimeoutException e) {\n    throw new IllegalStateException(\"Extension enable not acknowledged — check container logs\", e);\n}","preventionTips":["Verify the extension starts cleanly (check container logs) after removing DISABLED.","Use Enterprise Edition images for control-center operations.","Double-check the extension id before calling."],"tags":["hivemq","timeout","extension","unsupported-feature"],"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"}