stride3d/stride · error · SyntaxErrorException
While scanning a quoted scalar, find unexpected end of…
Error message
While scanning a quoted scalar, find unexpected end of stream.
What it means
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.
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.
Example fix
// before (missing closing quote) name: 'unclosed value // after name: 'unclosed value'
Defensive patterns
Strategy: try-catch
Validate before calling
static bool NotTruncated(string yaml, string expectedEndMarker = null) =>
yaml.Length > 0 && (expectedEndMarker == null || yaml.TrimEnd().EndsWith(expectedEndMarker)); Try / catch
try
{
var obj = deserializer.Deserialize<T>(input);
}
catch (YamlException ex)
{
if (ex.Message.Contains("end of stream"))
throw new FormatException($"YAML appears truncated: quote opened at {ex.Start.Line}:{ex.Start.Column} never closed", ex);
throw;
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- While parsing a quoted scalar, find unknown escape…
- While scanning a quoted scalar, find unexpected document…
- Did not find expected
- Did not find expected <stream-start>.
- Expected ' ', got ' ' (at line , character ).
AI-assisted analysis of stride3d/stride@96fad776d2 (2026-09-14).
Data as JSON: /api/errors/5dcb96f5d0ce00d8.
Report an issue: GitHub.
Appendix: source
Thrown at sources/core/Stride.Core.Yaml/Scanner.cs:1593
// Consume the content of the quoted scalar.
scanScalarValue.Clear();
scanScalarWhitespaces.Clear();
scanScalarLeadingBreak.Clear();
scanScalarTrailingBreaks.Clear();
for (;;)
{
// Check that there are no document indicators at the beginning of the line.
if (IsDocumentIndicator())
{
throw new SyntaxErrorException(start, mark, "While scanning a quoted scalar, find unexpected document indicator.");
}
// Check for EOF.
if (analyzer.IsZero())
{
throw new SyntaxErrorException(start, mark, "While scanning a quoted scalar, find unexpected end of stream.");
}
// Consume non-blank characters.
bool hasLeadingBlanks = false;
while (!analyzer.IsBlankOrBreakOrZero())
{
// Check for an escaped single quote.
if (isSingleQuoted && analyzer.Check('\'', 0) && analyzer.Check('\'', 1))
{
scanScalarValue.Append('\'');
Skip();
Skip();
}
// Check for the right quote.View on GitHub (pinned to 96fad776d2)