Kong / Kong/deck

Incorrect error in case of invalid foreign entity name reference with plugin

Open
#1,976 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
503
Forks
137
Avg merge
3d 5h
Merged PRs (30d)
20

Description

While running sync/diff, if a plugin references a foreign entity that doesn’t exist, the request goes through without being caught by decK. As a result, the call reaches the gateway, which then returns below error.
```
Error: 1 errors occurred:
while processing event: Create plugin rate-limiting for service example-service and consumer shivay failed: HTTP status 400 (message: "schema violation (consumer.id: expected a valid UUID)")

```
This error can be misleading, because the root cause is that the referenced entity is missing, but decK does not validate or catch this earlier in the flow.

Ideally, in such cases, decK should fail early and return a clear error indicating that the referenced entity was not found, instead of letting the request reach the gateway and surface a misleading error.

Steps to reproduce :

I am running below file, but the consumer is not defined not in the state file neither globally.

```
_format_version: "3.0"
services:
- name: example-service
port: 3200
protocol: http
host: localhost
plugins:
- config:
limit_by: consumer
minute: 6
policy: local
consumer: alice
enabled: true
name: rate-limiting
protocols:
- http
```
Error:
```
Error: 1 errors occurred:
while processing event: Create plugin rate-limiting for service example-service and consumer shivay failed: HTTP status 400 (message: "schema violation (consumer.id: expected a valid UUID)")
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the sync or diff with the supplied declarative state file, where the plugin references the undefined consumer alice. Trace how decK handles foreign entity references before sending the request to the gateway; done means it fails early with a clear not-found error instead of the misleading UUID validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.