amir20/dozzle · error

invalid format: unclosed quotes

Error message

invalid format: unclosed quotes

What it means

At end of input ParseLogFmt is still inside an unterminated quoted value (inQuotes true when the scan finishes). The value's opening '"' was never closed, so the pair cannot be committed and the whole line fails to parse.

Solutions

  1. Close the quote in the source log line, e.g. msg="hello world".
  2. If quotes are unintended, remove them so the value is parsed as a plain token.
  3. If upstream may emit unclosed quotes, catch this error and fall back to treating the line as a plain text log entry.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/container/logfmt.go:64 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of amir20/dozzle@d9463cbe21 (2026-09-07). Data as JSON: /api/errors/a96aba863b476436. Report an issue: GitHub.

Appendix: source

Thrown at internal/container/logfmt.go:64

				}
			} else {
				if char == '"' {
					inQuotes = true
					start = i + 1
				} else if char == ' ' {
					value = log[start:i]
					result.Set(key, value)
					isKey = true
					start = i + 1
				}
			}
		}
	}

	// Handle the last key-value pair if there is no trailing space
	if !isKey && start < len(log) {
		if inQuotes {
			return nil, errors.New("invalid format: unclosed quotes")
		}
		value = log[start:]
		result.Set(key, value)
	} else if isKey && start < len(log) {
		return nil, errors.New("invalid format: unexpected key without value")
	}

	if !isKey {
		if inQuotes {
			return nil, errors.New("invalid format: unclosed quotes")
		}
		value = log[start:]
		result.Set(key, value)
	}

	return result, nil
}

View on GitHub (pinned to d9463cbe21)