This article describes a Unity Build Automation (UBA) build failure caused by an internal YAML syntax error that occurred, triggered after backend and runner updates. The error appeared as a Psych::SyntaxError referencing an unexpected hexadecimal number while parsing a quoted scalar. The root cause was a backslash (\) used in the path of the pre-build script field, which became invalid under stricter YAML parsing. Updating the path to use forward slashes (/) resolved the issue and restored successful builds.
Symptoms:
- UBA builds suddenly start failing after previously working for weeks.
- Build logs show errors similar to:
did not find expected hexdecimal number while parsing a quoted scalar at line 26 column 22 (Psych::SyntaxError)- Failures persist even after triggering clean builds.
Causes:
- Recent backend and build runner updates introduced stricter YAML parsing via the Psych library.
- In YAML, when values are double-quoted, the backslash (
\) is treated as an escape character and must form a valid escape sequence. - The pre-build script field in the Advanced Settings contained a Windows-style path with backslashes (for example,
\ucb_scripts\pre_build.sh), which Psych interpreted as invalid escape sequences, causing aPsych::SyntaxError.
Resolution:
- Open your Configurations section in the Unity Dashboard and navigate to the affected build target (for example,
main). - Go to Advanced Settings.
- Locate the 'Pre-build script' (or similar) field.
- Replace any backslashes (
\) in the script path with forward slashes (/). For example:- Change:
\ucb_scripts\pre_build.sh - To:
./ucb_scripts/pre_build.sh(orucb_scripts/pre_build.sh, depending on your setup).
- Change:
- Save the configuration.
- Trigger a new clean build for the affected target.
- Confirm that the build completes successfully and the
Psych::SyntaxErrorno longer appears in the logs.
More Information:
For more information about pre and post-build scripts, please review the Run custom scripts during the build process documentation entry.