Skip to content

Odd forbidden error message when bound role is missing #10056

Closed

Description

@liggitt
$ oc policy add-role-to-user basic-user system:anonymous
$ oc delete clusterrole basic-user --cascade=false
clusterrole "basic-user" deleted
$ curl -k https://localhost:8443/api/v1/namespaces/default/pods
{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "role \"basic-user\" not found",
  "reason": "Forbidden",
  "details": {
    "kind": "pods"
  },
  "code": 403
}

I would expect the evaluation errors to be in the details as a cause, and the main message to still be User "system:anonymous" cannot list pods in namespace "default"

Activity

  1. assigned and unassigned on Jun 26, 2017
  2. abstractj commented on Jun 28, 2017

    @abstractj

    @liggitt @enj I managed to reproduce the issue. Although I would appreciate if you provide here the exact output that is expect. Or maybe a service with the correct message. For a newcomer like me, it's easy to get lost guessing what would be the correct output.

    Is this what you guys expect?

    {
      "kind": "Status",
      "apiVersion": "v1",
      "metadata": {},
      "status": "Failure",
      "message": "User \"system:anonymous\" cannot list pods in the namespace \"default\". (get pods)",
      "reason": "Forbidden",
      "details": {
        "kind": "pods"
      },
      "code": 403
    }
    
  3. assigned and unassigned on Jul 10, 2017
  4. added a commit that references this issue on Aug 17, 2017
    edf3ff5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions