{"record":{"id":"870ee2cb16e0cc81","repo":"gradle/gradle","slug":"could-not-parse-s-s","errorCode":null,"errorMessage":"Could not parse %s %s","messagePattern":"Could not parse (.+?) (.+?)","errorType":"exception","errorClass":"MetaDataParseException","httpStatus":null,"severity":"error","filePath":"platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/AbstractModuleDescriptorParser.java","lineNumber":54,"sourceCode":"    }\n\n    @Override\n    public ParseResult<T> parseMetaData(DescriptorParseContext ivySettings, File descriptorFile) throws MetaDataParseException {\n        return parseMetaData(ivySettings, descriptorFile, false);\n    }\n\n    @Override\n    public ParseResult<T> parseMetaData(DescriptorParseContext ivySettings, LocallyAvailableExternalResource resource) throws MetaDataParseException {\n        return parseDescriptor(ivySettings, resource, false);\n    }\n\n    protected ParseResult<T> parseDescriptor(DescriptorParseContext ivySettings, LocallyAvailableExternalResource resource, boolean validate) throws MetaDataParseException {\n        try {\n            return doParseDescriptor(ivySettings, resource, validate);\n        } catch (MetaDataParseException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new MetaDataParseException(getTypeName(), resource, e);\n        }\n    }\n\n    protected abstract String getTypeName();\n\n    protected abstract ParseResult<T> doParseDescriptor(DescriptorParseContext ivySettings, LocallyAvailableExternalResource resource, boolean validate) throws Exception;\n}\n","sourceCodeStart":36,"sourceCodeEnd":62,"githubUrl":"https://github.com/gradle/gradle/blob/534f27719b66953f95cc907aae7f2c1b12f5482d/platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/AbstractModuleDescriptorParser.java#L36-L62","documentation":"AbstractModuleDescriptorParser.parseDescriptor wraps any non-MetaDataParseException thrown by a concrete parser (ivy.xml, POM-derived, or module-metadata parsers) into MetaDataParseException, formatted as 'Could not parse <typeName> <resource>' with the descriptor kind and the resource location, chaining the underlying exception. It marks the point where a downloaded/cached descriptor file turned out to be unparseable.","triggerScenarios":"A repository serves a 404/403 HTML page cached under the ivy.xml or pom name; truncated or half-written XML from an interrupted download; an ivy.xml using entities/features the parser rejects; module metadata with an unsupported format version.","commonSituations":"Misconfigured repository URLs (proxy error pages, Nexus/Artifactory auth pages) served instead of descriptors; flaky networks leaving corrupt cached files; SNAPSHOT metadata rewritten mid-download; third-party modules with hand-crafted ivy.xml.","solutions":["Open the resource path printed in the message - it usually shows an HTML error page or broken XML, telling you the real problem (auth, proxy, 404)","Refresh the poisoned cache: ./gradlew --refresh-dependencies or delete the module's directory under ~/.gradle/caches/modules-2","If the artifact itself is broken, pin an unaffected version, or exclude the dependency and replace it (resolutionStrategy.dependencySubstitution)","Fix the repository URL or credentials so the repository returns real metadata"],"exampleFix":"# before\nrepositories { maven { url 'https://repo.example.com/libs' } } # returns 403 HTML page\n./gradlew build   # Could not parse ivy module descriptor ...\n# after\nrepositories { maven { url 'https://repo.example.com/libs'; credentials { ... } } }\n./gradlew build --refresh-dependencies","handlingStrategy":"try-catch","validationCode":"// Sanity-check a repository before relying on its metadata\nrepositories {\n    maven {\n        url 'https://repo.example.com/libs'\n        content { includeGroupByRegex 'org\\\\.example\\\\..*' }\n    }\n}\n// content filtering prevents grabbing HTML error pages from the wrong repo","typeGuard":null,"tryCatchPattern":"try {\n    configurations.compileClasspath.resolve()\n} catch (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParseException e) {\n    def loc = e.message.substring(e.message.indexOf('file:') >= 0 ? e.message.indexOf('file:') : 0)\n    throw new GradleException(\"Unparseable descriptor at ${loc} - open it to check for an HTML error page or broken XML\", e)\n}","preventionTips":["Configure repository credentials and correct URLs so error pages are not served as descriptors","Run --refresh-dependencies after network failures to evict truncated cached files","Use content filters (includeGroup/IncludeGroupByRegex) to keep each dependency on its intended repository","When a third-party descriptor is genuinely broken, pin a good version or substitute the module"],"tags":["gradle","metadata","xml","repository","parse-error","cache"],"backgroundTag":"module-metadata-parse-failure","analyzedSha":"534f27719b66953f95cc907aae7f2c1b12f5482d","analyzedAt":"2026-08-22T08:09:12.375Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}