Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for encoding error enrolling new nodes #334

Merged
merged 1 commit into from Jan 11, 2023
Merged

Conversation

javuto
Copy link
Collaborator

@javuto javuto commented Jan 11, 2023

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:

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.

@javuto javuto added deployment Deployment related issues osctrl-tls osctrl-tls related changes osctrl-admin osctrl-admin related changes enrollment Enrollment related issue 🚧 bugfix Fix for an existing bug labels Jan 11, 2023
@javuto javuto merged commit b929e82 into main Jan 11, 2023
@javuto javuto deleted the encoding-error-bytea branch January 11, 2023 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧 bugfix Fix for an existing bug deployment Deployment related issues enrollment Enrollment related issue osctrl-admin osctrl-admin related changes osctrl-tls osctrl-tls related changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant