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

Duplicate consumers cause a JSON unmarshal error #5431

Closed
1 task done
mheap opened this issue Jan 12, 2024 · 1 comment
Closed
1 task done

Duplicate consumers cause a JSON unmarshal error #5431

mheap opened this issue Jan 12, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mheap
Copy link
Member

mheap commented Jan 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The response cannot be unmarshalled

2024-01-12T12:11:22Z	error	Failed parsing resource errors	{"url": "https://192.168.194.4:8444", "update_strategy": "InMemory", "error": "could not unmarshal config error: json: cannot unmarshal object into Go struct field ConfigError.flattened_errors of type []sendconfig.FlatEntityError"}
2024-01-12T12:11:22Z	error	dataplane-synchronizer	Could not update kong admin	{"error": "performing update for https://192.168.194.4:8444 failed: failed posting new config to /config: got status code 400"}

Expected Behavior

I see the actual error message in the logs + an event is raised

Steps To Reproduce

Deploy `kong/ingress` with defaults


echo "apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
  name: alice1
  annotations:
    kubernetes.io/ingress.class: kong
username: alice
---
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
  name: alice2
  annotations:
    kubernetes.io/ingress.class: kong
username: alice" | kubectl apply -f -

See the logs:

kubectl logs -n kong kong-controller-....


### Kong Ingress Controller version

```shell
kong/kubernetes-ingress-controller@sha256:64a6927d9e00336dccd70fc670f8c46b41d737d52bf4c65f66be33ed1deae44a (KIC 3.0)

Kubernetes version

No response

Anything else?

No response

@pmalek
Copy link
Member

pmalek commented Mar 28, 2024

With changes from #5763 (which will ship with KIC 3.2 and will be included in nightlies starting 29-03-2024) the log that we get from the attached manifest look like this:

2024-03-28T15:17:12+01:00	error	dataplane-synchronizer	Could not update kong admin	{"error": "performing update for https://10.244.0.11:8444 failed: failed posting new config to /config: got status code 400"}
2024-03-28T15:17:15+01:00	error	recording a Warning event for object	{"name": "alice2", "namespace": "default", "kind": "KongConsumer", "apiVersion": "configuration.konghq.com/v1", "reason": "KongConfigurationApplyFailed", "message": "invalid consumer:: uniqueness violation: 'consumers' entity with username set to 'alice' already declared", "error": "object failed to apply"}

When running with Kong kong/kong-gateway:3.6.

@mheap feel free to reopen this if you encounter this again.

@pmalek pmalek closed this as completed Mar 28, 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
Projects
None yet
Development

No branches or pull requests

3 participants