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

SRClient fails and terminates application on error from schema registry #72

Closed
martinhynar opened this issue Mar 2, 2022 · 4 comments
Closed

Comments

@martinhynar
Copy link

martinhynar commented Mar 2, 2022

I just upgraded to srclient v0.5.0 and my application stated to panic on call GetLatestSchema call when schema does not exist.

In access log to schema registry, I see that the return code is 404. The call itself ends with panic and application is terminated.

The application code is quite straight

schema, err = srClient.GetLatestSchema(topic)
if err != nil {
  // logic that installs schema in schema registry
}

However, the error handling is not reached as the application fails with this:

panic: runtime error: makeslice: cap out of range
goroutine 7 [running]:
github.com/riferrei/srclient.createError(0xc000438090, 0xc0021d4000, 0xc000438090)
/go/pkg/mod/github.com/riferrei/[email protected]/schemaRegistryClient.go:746 +0x73
github.com/riferrei/srclient.(*SchemaRegistryClient).httpRequest(0xc0002ee000, 0xed1c3d, 0x3, 0xc00034a180, 0x33, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/pkg/mod/github.com/riferrei/[email protected]/schemaRegistryClient.go:637 +0x385
github.com/riferrei/srclient.(*SchemaRegistryClient).getVersion(0xc0002ee000, 0xc000354a00, 0x19, 0xed2b18, 0x6, 0xc0021a4230, 0x0, 0x0)
/go/pkg/mod/github.com/riferrei/[email protected]/schemaRegistryClient.go:570 +0x155
github.com/riferrei/srclient.(*SchemaRegistryClient).GetLatestSchema(...)
/go/pkg/mod/github.com/riferrei/[email protected]/schemaRegistryClient.go:243

Same application code works correctly with v0.4.0

@AtakanColak
Copy link
Collaborator

Released v0.5.1

Thank you.

@riferrei
Copy link
Owner

riferrei commented Mar 2, 2022

Thank you for your continuously fantastic support @AtakanColak 🙂

@AtakanColak
Copy link
Collaborator

@riferrei No worries but I'd like to express that I'm not using Confluent Schema Registry anymore, and couldn't figure out how to set it on a local docker environment. Hence I don't really have a way of testing the code anymore.

@martinhynar
Copy link
Author

I have few scripts that set Confluent stack, you can use/inspire - https://github.com/martinhynar/dockery-dock/tree/master/kafka-stack

I don't use docker-compose file with all services in one place, as I frequently use only subset and it comes handier for me to just fire script.

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

No branches or pull requests

3 participants