{"record":{"id":"0e2dfc3817cc6fb8","repo":"testcontainers/testcontainers-java","slug":"unable-to-create-solr-core-stdout-result-getstdout-stderr","errorCode":null,"errorMessage":"Unable to create solr core:\nStdout: ${result.getStdout()}\nStderr:${result.getStderr()}","messagePattern":"Unable to create solr core:\nStdout: (.+?)\nStderr:(.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"modules/solr/src/main/java/org/testcontainers/containers/SolrContainer.java","lineNumber":144,"sourceCode":"    }\n\n    @Override\n    public Set<Integer> getLivenessCheckPortNumbers() {\n        return new HashSet<>(getSolrPort());\n    }\n\n    @Override\n    protected void waitUntilContainerStarted() {\n        getWaitStrategy().waitUntilReady(this);\n    }\n\n    @Override\n    @SneakyThrows\n    protected void containerIsStarted(InspectContainerResponse containerInfo) {\n        if (!configuration.isZookeeper()) {\n            ExecResult result = execInContainer(\"solr\", \"create\", \"-c\", configuration.getCollectionName());\n            if (result.getExitCode() != 0) {\n                throw new IllegalStateException(\n                    \"Unable to create solr core:\\nStdout: \" + result.getStdout() + \"\\nStderr:\" + result.getStderr()\n                );\n            }\n            return;\n        }\n\n        if (StringUtils.isNotEmpty(configuration.getConfigurationName())) {\n            SolrClientUtils.uploadConfiguration(\n                getHost(),\n                getSolrPort(),\n                configuration.getConfigurationName(),\n                configuration.getSolrConfiguration(),\n                configuration.getSolrSchema()\n            );\n        }\n\n        SolrClientUtils.createCollection(\n            getHost(),","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/modules/solr/src/main/java/org/testcontainers/containers/SolrContainer.java#L126-L162","documentation":"After a non-ZooKeeper (standalone) Solr container starts, SolrContainer runs `solr create -c <collection>` inside the container to create the core. If that command exits non-zero, the stdout/stderr of the failure is wrapped in this IllegalStateException.","triggerScenarios":"containerIsStarted executes `solr create -c <name>` and the exit code is != 0 — e.g. the core name is invalid, a core with that name already exists, or Solr hasn't finished booting.","commonSituations":"Custom configuration uploaded without the schema file, malformed solrconfig.xml, collection names with illegal characters, or slow disk causing Solr to reject early create requests.","solutions":["Read the Stdout/Stderr in the message: it names the real cause (bad config, duplicate core, etc.).","Verify the configuration/schema URLs point to valid, complete files.","Use a valid collection name (alphanumeric and underscores only).","Use ZooKeeper mode if you need cluster-aware core/collection creation."],"exampleFix":"// before\ncontainer.withCollection(\"my collection\");\n// after\ncontainer.withCollection(\"my_collection\");","handlingStrategy":"try-catch","validationCode":"if (container.getCollectionName() == null || container.getCollectionName().isEmpty()) throw new IllegalArgumentException(\"collection name required\");","typeGuard":null,"tryCatchPattern":"try { container.start(); } catch (IllegalStateException e) { if (e.getMessage().startsWith(\"Unable to create solr core\")) { /* inspect stdout/stderr, check configset + collection name */ } throw e; }","preventionTips":["Use simple alphanumeric collection names.","Validate solrconfig.xml/schema.xml locally before mounting them.","Read the embedded Stdout/Stderr before guessing at fixes."],"tags":["solr","testcontainers","core-creation"],"backgroundTag":"command-failed","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"}