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

Problem with Avro and schema registry #148

Closed
ripla opened this issue Aug 5, 2022 · 3 comments · Fixed by #151
Closed

Problem with Avro and schema registry #148

ripla opened this issue Aug 5, 2022 · 3 comments · Fixed by #151
Labels
🐛 Bug Something isn't working

Comments

@ripla
Copy link

ripla commented Aug 5, 2022

We've been starting to test our Kafka based system with xk6-kafka. At first we just used 1 VU and everything worked perfectly. But as we moved to increase to 10, 100 or 1000 VUs we started seeing schema-related errors from the schema registry. I can repro the problem with a small-ish test case.

docker compose up -d
curl -s -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" --data-binary "@./myschema.json" http://localhost:8085/subjects/mytopic-value/versions
docker run --network="mynetwork" --rm -i mostafamoradian/xk6-kafka:latest run - <burstMessages.js

Even with just 10 VU's, we get the same error at some point. The schema registry logs shows no errors.

time="2022-08-05T10:44:10Z" level=warning msg="Failed to create or get schema, manually encoding the data" error="Failed to get schema from schema registry, OriginalError: %!w(*url.Error=&{Get http://schemaregistry:8085/subjects/mytopic-value/versions/latest 0xc0009694a0})"

and

time="2022-08-05T11:58:32Z" level=error msg="Failed to create codec for encoding Avro, OriginalError: %!w(*errors.errorString=&{cannot unmarshal schema JSON: unexpected end of JSON input})" error="Failed to create codec for encoding Avro, OriginalError: %!w(*errors.errorString=&{cannot unmarshal schema JSON: unexpected end of JSON input})"

Originally we had the schemas in the script, but it didn't matter. The error just has POST instead of GET.

Any ideas what to try next, or is a bug the tool?

@ripla
Copy link
Author

ripla commented Aug 5, 2022

@oscar067
Copy link

oscar067 commented Aug 5, 2022

Hi,

try the branch from this pull request: #147.

I had similar errors and that patch fix them #146

@mostafa
Copy link
Owner

mostafa commented Aug 11, 2022

Hey @ripla,

Although I have no intention of load-testing the schema registry, it happens while accessing it. I exported the Schema Registry class in #149, which makes it easier to call it in the init context. Based on the contribution by @oscar067, I created #151, which will help with this.

@mostafa mostafa added the 🐛 Bug Something isn't working label Aug 11, 2022
@mostafa mostafa linked a pull request Aug 11, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants