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

JSON to Protobuf breaks after processing an invalid message #1282

Closed
vordimous opened this issue Oct 7, 2024 · 0 comments · Fixed by #1292
Closed

JSON to Protobuf breaks after processing an invalid message #1282

vordimous opened this issue Oct 7, 2024 · 0 comments · Fixed by #1292
Assignees
Labels
bug Something isn't working devx Effects the Developer Experience

Comments

@vordimous
Copy link
Contributor

vordimous commented Oct 7, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

Use this example http.kafka.proto.json.zip. The setup and repro steps can also be found in the README.md

Setup

The setup.sh script:

./setup.sh

Bug scenarios

Each of the below scenarios are run from a fresh install of zilla and kafka

Sending invalid JSON breaks subsequent requests

  1. POST a valid request getting a 204 back
curl --location 'http://localhost:7114/requests' \
--header 'Content-Type: application/json' \
--data '{
    "message": "hello world",
    "count": 10
}' -v
  1. POST an invalid request getting a 400 back and logs MODEL_PROTOBUF_VALIDATION_FAILED A message payload failed validation. Cannot find field: invalid in message Request. to stdout
curl --location 'http://localhost:7114/requests' \
--header 'Content-Type: application/json' \
--data '{
    "message": "hello world",
    "count": 10,
    "invalid": "field"
}' -v
  1. POST a valid request getting a 400 back and logs MODEL_PROTOBUF_VALIDATION_FAILED A message payload failed validation. Field Request.message has already been set.. to stdout
curl --location 'http://localhost:7114/requests' \
--header 'Content-Type: application/json' \
--data '{
    "message": "hello world",
    "count": 10
}' -v

Sending an invalid message field

Sending an invalid message field causes subsequent requests to take ~10 min to get a 204 but the message doesn't show up onto kafka

  1. POST a valid request getting a 204 back
curl --location 'http://localhost:7114/requests' \
--header 'Content-Type: application/json' \
--data '{
    "message": "hello message",
    "count": 10
}' -v
  1. POST an invalid "messages" field request getting a 400 back and immediately post the correct payload after. Run both curl commands at the same time and sometimes the second one works and other times it will hang until it gets a 204 back after ~10min and the message is not on the Kafka topic
curl --location 'http://localhost:7114/requests' \
--header 'Content-Type: application/json' \
--data '{
    "messages": "hello messages",
    "count": 10
}' -v
curl --location 'http://localhost:7114/requests' \
--header 'Content-Type: application/json' \
--data '{
    "message": "hello messages",
    "count": 10
}' -v
@vordimous vordimous added bug Something isn't working devx Effects the Developer Experience labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working devx Effects the Developer Experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants