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/

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:, server: kong_admin, request: "PUT /consumers/ 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:, server: kong_admin, request: "PUT /consumers/ HTTP/1.1", host: "localhost:8001"

I am using Kong Enterprise 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