<#334 Fix for encoding error enrolling new nodes> ...
# osctrl
g
#334 Fix for encoding error enrolling new nodes Pull request opened by javuto Fix for an unexpected issue storing the raw enrollment bytes coming from osquery. GORM uses the type
bytea
for PostgreSQL and in golang that is translated to
json.RawMessage
which is an alias of
[]byte
. In some cases the content was triggering an encoding error that would prevent nodes to be enrolled:
Copy code
handlers.go:284: error creating node Create failed to encode args[20]: unable to encode json.RawMessage{...} into binary format for bytea (OID 17): cannot find encode plan
Using just an
string
, (
TEXT
in pg) solves the issue. jmpsec/osctrl