{"record":{"id":"5dcb96f5d0ce00d8","repo":"stride3d/stride","slug":"while-scanning-a-quoted-scalar-find-unexpected-end-of-stream","errorCode":null,"errorMessage":"While scanning a quoted scalar, find unexpected end of stream.","messagePattern":"While scanning a quoted scalar, find unexpected end of stream\\.","errorType":"exception","errorClass":"SyntaxErrorException","httpStatus":null,"severity":"error","filePath":"sources/core/Stride.Core.Yaml/Scanner.cs","lineNumber":1593,"sourceCode":"            // Consume the content of the quoted scalar.\n            scanScalarValue.Clear();\n            scanScalarWhitespaces.Clear();\n            scanScalarLeadingBreak.Clear();\n            scanScalarTrailingBreaks.Clear();\n            for (;;)\n            {\n                // Check that there are no document indicators at the beginning of the line.\n\n                if (IsDocumentIndicator())\n                {\n                    throw new SyntaxErrorException(start, mark, \"While scanning a quoted scalar, find unexpected document indicator.\");\n                }\n\n                // Check for EOF.\n\n                if (analyzer.IsZero())\n                {\n                    throw new SyntaxErrorException(start, mark, \"While scanning a quoted scalar, find unexpected end of stream.\");\n                }\n\n                // Consume non-blank characters.\n\n                bool hasLeadingBlanks = false;\n\n                while (!analyzer.IsBlankOrBreakOrZero())\n                {\n                    // Check for an escaped single quote.\n\n                    if (isSingleQuoted && analyzer.Check('\\'', 0) && analyzer.Check('\\'', 1))\n                    {\n                        scanScalarValue.Append('\\'');\n                        Skip();\n                        Skip();\n                    }\n\n                    // Check for the right quote.","sourceCodeStart":1575,"sourceCodeEnd":1611,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/core/Stride.Core.Yaml/Scanner.cs#L1575-L1611","documentation":"A quoted scalar must be terminated by its matching closing quote before the input ends. If ScanBlockScalar's quoted-scalar loop reaches EOF (the character analyzer reports zero/end of stream) without seeing the closing quote, this SyntaxErrorException is thrown.","triggerScenarios":"A single- or double-quoted value missing its closing quote at end of file, e.g. \"name: 'value\" with nothing after, or a file truncated mid-string. Thrown while tokenizing quoted scalars that run to end of input.","commonSituations":"Files truncated by failed uploads/downloads or disk-full writes, editors or string templates that dropped a trailing quote, and manual edits that removed a closing quote.","solutions":["Add the missing closing quote of the same kind (' or \") at the end of the scalar value.","Check the file was not truncated — compare byte/line counts against the source and re-download if needed.","Look at the line/column in the exception Mark: the scalar started there; inspect from that point to EOF for the missing quote.","Enable editor bracket/quote auto-closing and re-check modified strings after edits.","Parse YAML in CI before deploy so truncated configs fail fast with a clear message."],"exampleFix":"// before (missing closing quote)\nname: 'unclosed value\n\n// after\nname: 'unclosed value'","handlingStrategy":"try-catch","validationCode":"static bool NotTruncated(string yaml, string expectedEndMarker = null) =>\n    yaml.Length > 0 && (expectedEndMarker == null || yaml.TrimEnd().EndsWith(expectedEndMarker));","typeGuard":null,"tryCatchPattern":"try\n{\n    var obj = deserializer.Deserialize<T>(input);\n}\ncatch (YamlException ex)\n{\n    if (ex.Message.Contains(\"end of stream\"))\n        throw new FormatException($\"YAML appears truncated: quote opened at {ex.Start.Line}:{ex.Start.Column} never closed\", ex);\n    throw;\n}","preventionTips":["Verify file size/checksum after download or transfer before parsing","Keep editor auto-closing quotes enabled and re-review edits to strings","Fail fast in CI by parsing all YAML assets at build time","When a file may be truncated, wrap loading and check ex.Start for the quote origin"],"tags":["yaml","parser","quotes","eof"],"backgroundTag":"yaml-parse-error","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}