Consumers PUT in Admin API Fails

This used to work. I should be able to use a put request to add or update a consumer.

The first time I send the following, it creates the consumer as expected:

PUT http://localhost:8001/consumers/foo@bar.com

But the second time I call that, I get this:

2020/10/20 17:43:27 [notice] 127245#0: *14123836 [lua] init.lua:260: insert(): ERROR: duplicate key value violates unique constraint "rbac_role_entities_pkey"
Key (role_id, entity_id)=(e1b7187c-1188-46be-afff-066a2f50703d, 68719ff5-c6f1-43fb-b1de-0b6e497abb15) already exists., client: 100.4.161.242, server: kong_admin, request: "PUT /consumers/foo@bar.com HTTP/1.1", host: "localhost:8001"
2020/10/20 17:43:27 [error] 127245#0: *14123836 [kong] api_helpers.lua:311 failed to add entity permissions to current user, client: 100.4.161.242, server: kong_admin, request: "PUT /consumers/foo@bar.com HTTP/1.1", host: "localhost:8001"

I am using Kong Enterprise 2.1.3.1. According to the latest documentation, this should work.

This indeed was a bug that I believe has been fixed in a recent release.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ