{"record":{"id":"37700ec2031c8a54","repo":"TeamNewPipe/NewPipe","slug":"cluster-at-without-timecode-element","errorCode":null,"errorMessage":"Cluster at {} without Timecode element","messagePattern":"Cluster at (.+?) without Timecode element","errorType":"exception","errorClass":"NoSuchElementException","httpStatus":null,"severity":"error","filePath":"app/src/main/java/org/schabi/newpipe/streams/WebMReader.java","lineNumber":391,"sourceCode":"        obj.relativeTimeCode = stream.readShort();\n        obj.flags = (byte) stream.read();\n        obj.dataSize = (int) ((ref.offset + ref.size) - stream.position());\n        obj.createdFromBlock = ref.type == ID_BLOCK;\n\n        // NOTE: lacing is not implemented, and will be mixed with the stream data\n        if (obj.dataSize < 0) {\n            throw new IOException(String.format(\n                    \"Unexpected SimpleBlock element size, missing %s bytes\", -obj.dataSize));\n        }\n        return obj;\n    }\n\n    private Cluster readCluster(final Element ref) throws IOException {\n        final Cluster obj = new Cluster(ref);\n\n        final Element elem = untilElement(ref, ID_TIMECODE);\n        if (elem == null) {\n            throw new NoSuchElementException(\"Cluster at \" + ref.offset\n                    + \" without Timecode element\");\n        }\n        obj.timecode = readNumber(elem);\n\n        return obj;\n    }\n\n    static class Element {\n        int type;\n        long offset;\n        long contentSize;\n        long size;\n    }\n\n    public static class Info {\n        public long timecodeScale;\n        public long duration;\n    }","sourceCodeStart":373,"sourceCodeEnd":409,"githubUrl":"https://github.com/TeamNewPipe/NewPipe/blob/9e8be091560a69f35d44bd252eb00bc7911c977b/app/src/main/java/org/schabi/newpipe/streams/WebMReader.java#L373-L409","documentation":"Thrown when readCluster() iterates the Cluster's child elements looking for the mandatory Timecode element (EBML ID_TIMECODE) and untilElement() returns null — meaning no Timecode child exists within the Cluster's declared bounds. In Matroska/WebM every Cluster must contain exactly one Timecode element giving the cluster's absolute timestamp; without it the block timecodes cannot be resolved to playback positions.","triggerScenarios":"readCluster() calls untilElement(ref, ID_TIMECODE); the loop exhausts the Cluster element's content range without matching ID_TIMECODE, returning null; the null-check at line 390 throws. Caused by a Cluster element whose only/all children are SimpleBlock or BlockGroup elements with no Timecode, or a corrupted element-size field that made the scanner skip over the Timecode bytes.","commonSituations":"Corrupt or hand-edited WebM file missing the Timecode child; truncated cluster where the Timecode bytes were cut off; a remuxer bug that dropped the Timecode element; misaligned parse from a previous element causing the reader to start mid-Cluster.","solutions":["Re-download or re-extract the source media — the Cluster is structurally invalid.","Validate file integrity (hash/CRC) before demuxing if the file was transferred or cached.","Catch NoSuchElementException at the demux boundary and report the file as corrupt to the user.","If writing/muxing WebM, ensure every Cluster contains exactly one Timecode element as the first child."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    Cluster cluster = readCluster(elem);\n} catch (NoSuchElementException e) {\n    if (e.getMessage() != null && e.getMessage().contains(\"without Timecode element\")) {\n        // corrupt cluster — skip or abort demux\n        throw new IOException(\"Corrupt WebM cluster: missing Timecode at \" + elem.offset, e);\n    }\n    throw e;\n}","preventionTips":["Validate WebM container integrity before demuxing (file completeness, magic bytes).","Treat NoSuchElementException from the demuxer as a fatal corrupt-file signal, not a recoverable parse skip."],"tags":["webm","matroska","media-demuxer","corrupt-file","streaming"],"backgroundTag":null,"analyzedSha":"9e8be091560a69f35d44bd252eb00bc7911c977b","analyzedAt":"2026-08-14T00:11:33.519Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}