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

Zilla Crashes on invalid request payload #1394

Closed
ankitk-me opened this issue Feb 4, 2025 · 0 comments · Fixed by #1395
Closed

Zilla Crashes on invalid request payload #1394

ankitk-me opened this issue Feb 4, 2025 · 0 comments · Fixed by #1395
Assignees
Labels
bug Something isn't working

Comments

@ankitk-me
Copy link
Contributor

Describe the bug
Zilla instance crashes when invalid event like { "test": "test" } is sent to schema validation enabled endpoint.

To Reproduce
Steps to reproduce the behavior:

  1. Go to openapi.proxy example
  2. Update Pet Schema with mentioned field:
Pet:
      type: object
      required:
        - eventType
        - eventTime
        - eventId
        - event
  1. Start the example using ./setup.sh
  2. Trigger mentioned request:
curl -i -X POST http://localhost:7114/pets \
        -H "Content-Type: application/json" \
        -d '{ "test": "test" }'
  1. Zilla crashes with mentioned exception:
org.agrona.concurrent.AgentTerminationException: java.lang.IllegalArgumentException: length=265 is beyond maximum length=254
        at io.aklivity.zilla.runtime.engine@0.9.124/io.aklivity.zilla.runtime.engine.internal.registry.EngineWorker.doWork(EngineWorker.java:858)
        at org.agrona.core/org.agrona.concurrent.AgentRunner.doWork(AgentRunner.java:304)
        at org.agrona.core/org.agrona.concurrent.AgentRunner.workLoop(AgentRunner.java:296)
        at org.agrona.core/org.agrona.concurrent.AgentRunner.run(AgentRunner.java:162)
        at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: java.lang.IllegalArgumentException: length=265 is beyond maximum length=254
        at io.aklivity.zilla.runtime.model.json@0.9.124/io.aklivity.zilla.runtime.model.json.internal.types.String8FW$Builder.checkLength(String8FW.java:163)
        at io.aklivity.zilla.runtime.model.json@0.9.124/io.aklivity.zilla.runtime.model.json.internal.types.String8FW$Builder.set(String8FW.java:148)
        at io.aklivity.zilla.runtime.model.json@0.9.124/io.aklivity.zilla.runtime.model.json.internal.types.event.JsonModelValidationFailedExFW$Builder.error(JsonModelValidationFailedExFW.java:117)
...
stopped

Expected behavior
Validation should work as expected & we should observe mentioned validation failure event in log for given request.

zilla-openapi-proxy:north_openapi_server [04/Feb/2025:15:03:10 +0000] MODEL_JSON_VALIDATION_FAILED A message payload failed validation. [1,18][] The object must have a property whose name is "eventType".
[1,18][] The object must have a property whose name is "eventTime".
[1,18][] The object must have a property whose name is "eventId".
[1,18][] The object must have a property whose name is "event".
@ankitk-me ankitk-me added the bug Something isn't working label Feb 4, 2025
@ankitk-me ankitk-me self-assigned this Feb 4, 2025
@ankitk-me ankitk-me changed the title Zilla Crashes on Invalid Event Zilla Crashes on Invalid Request Payload Feb 4, 2025
@ankitk-me ankitk-me changed the title Zilla Crashes on Invalid Request Payload Zilla Crashes on invalid request payload Feb 4, 2025
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.

1 participant