Turns out we were kickstart parsing errors, so parsing of the given command was not interrupted, but the error message was instead added to the output file. This garbage then caused shlex to throw an exception when parsing the file.
So I've set errorsAreFatal to True - with this errors end up in Journal, the boot option file has only correctly parsed options and Anaconda will abort the installation as usual when it re-parses the file on startup and gets the same error.
If the kickstart error prevents stage2 from startup, the error is in the system log and can be debugged.
Martin Kolman (1): Prevent kickstart parsing errors from ending up in boot options (#1060184)
dracut/parse-kickstart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)