sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation) invalid input syntax for type bytea
CONTEXT: PL/pgSQL function minion_cache_grains_sign() line 3 at assignment
INSERT 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 \n
mycustomkey: '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 | less
salt '*' grains.items | less
Note: 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