Skip to content

Zilla Crashes on invalid request payload #1394

@ankitk-me

Description

@ankitk-me

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 [email protected]/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 [email protected]/io.aklivity.zilla.runtime.model.json.internal.types.String8FW$Builder.checkLength(String8FW.java:163)
        at [email protected]/io.aklivity.zilla.runtime.model.json.internal.types.String8FW$Builder.set(String8FW.java:148)
        at [email protected]/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".

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions