Common causes
1. A value that starts with @
Mentions, npm scopes and decorators often start with @. Wrap the value in quotes; an @ in the middle of a value, as in an email address, is fine.
notify: @oncall-team
package: @acme/uinotify: "@oncall-team"
package: "@acme/ui"2. A shell command in backticks
Backticks are reserved in YAML. Quote the whole command, or use a block scalar for longer scripts.
command: `date +%F`command: '`date +%F`'3. A value that starts with %
A leading % looks like a directive such as %YAML 1.2. URL-encoded strings and format strings need quotes.
separator: %20
log_format: %h %l %useparator: "%20"
log_format: "%h %l %u"4. A tab used as indentation
In PyYAML and Go the same message appears for a tab at the start of a line, shown as '\t'. Replace it with spaces; see tabs in YAML.
deploy:
notify: oncalldeploy:
notify: oncallFrequently asked questions
Which characters cannot start a plain YAML value?
The indicators - ? : , [ ] { } # & * ! | > ’ " % @ and the backtick all have special meaning at the start of a value. A few, such as - ? and :, are allowed when followed by a non-space character, but quoting is the simple rule.
Why does Go not say which character it found?
Go’s yaml packages print the generic libyaml message without the character. Use the line number, or paste the file into PasteKit, which names the character and its column.
Will quoting change the value?
No. “@oncall-team” and an unquoted @oncall-team (if it were allowed) are the same string. Quotes only tell the parser where the string starts and ends.