sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for type byteaCONTEXT: PL/pgSQL function minion_cache_grains_sign() line 3 at assignmentINSERT INTO minion_cache" statement with a large blob of values below.Failed to save updated minion cache from master saltmaster.example.com".You or one of your users has likely configured a grain that is able to be rendered as valid YAML, but cannot be saved as bytea (byte array) data in the PSQL DB.
\ character, such as in the newline escape sequence \nmycustomkey: 'mycustomentry: something
myenv: envvalue
anotherkey: theintendedvalue
'
Notice in the error above that the multiline string itself contains what is probably valid YAML. Nonetheless, the newline character is disallowed in Postgres bytea data type.
salt myminion1 grains.items | lesssalt '*' grains.items | lessNote: As an alternative, if the grain is not needed, it can be deleted entirely.
Here is the same example as above, but configured properly on the minion.
mycustomkey:
mycustomentry: something
myenv: envvalue
anotherkey: theintendedvalue
mycustomentry: something
myenv: envvalue
anotherkey: theintendedvalue