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

Event Handler failure after 17.x #50554

Open
programmerq opened this issue Dec 23, 2024 · 1 comment
Open

Event Handler failure after 17.x #50554

programmerq opened this issue Dec 23, 2024 · 1 comment
Assignees

Comments

@programmerq
Copy link
Contributor

After upgrading to Teleport 17.0.5, the event handler started throwing this error in a loop:

ERRO Unexpected error in watch loop. Reconnecting in 5s... error:[
ERROR REPORT:
Original Error: *interceptors.RemoteError rpc error: code = Unknown desc = json: cannot unmarshal object into Go struct field checkpointKey.iterator of type string
Stack Trace:
    github.com/gravitational/teleport/apiav0.0.0/client/client.go:2526 github.com/gravitational/teleport/api/client.(*Client).SearchUnstructuredEvents
    github.com/gravitational/teleport/integrations/event-handler/legacy_events_watcher.go:269 main.(*LegacyEventsWatcher).getEventsInWindow
    github.com/gravitational/teleport/integrations/event-handler/legacy_events_watcher.go:193 main.(*LegacyEventsWatcher).getEvents
    github.com/gravitational/teleport/integrations/event-handler/legacy_events_watcher.go:139 main.(*LegacyEventsWatcher). fetch
    github.com/gravitational/teleport/integrations/event-handler/legacy_events_watcher.go:320 main.(*LegacyEventsWatcher).ExportEvents.funcl
    runtime/asm_amd64.s:1700 runtime.goexit
User Message: rpc error: code = Unknown desc = json: cannot unmarshal object into Go struct field checkpointKey.iterator of type string] event-handler/events_job.go:97

Both the cluster and the event handler were running 17.0.5.

I attempted to reproduce the issue unsuccessfully. Creating this issue to track this or similar stack traces. Will fill further details if a set of steps to reproduce are found.

@fspmarshall
Copy link
Contributor

From initial investigation, it looks like this error likely originates from here. The iterator field typically contains a map[string]any that has been json-encoded into a string. The resulting string should then be properly quoted automatically when the outer checkpointKey is marshaled.

At a glance, this error seems to be indicating that the object in the iterator field has somehow become "unquoted" s.t. the outer logic now fails to unmarshal it as a string, but from some initial poking around I can't find any possible culprits for that.

If we see more folks hitting this, getting them to dump the contents of the event-handler's cursor file as it's stored on disk might give us more to go on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants