Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-12397

NullPointerException in SHOW ROLES when there are no roles

    XMLWordPrintableJSON

Details

    • ghx-label-9

    Description

      When there are no roles in Ranger, SHOW ROLES statement hits NullPointerException:

      Query: show roles
      ERROR: InternalException: Error executing SHOW ROLES. Ranger error message: null
      

      The cause is 'roles' here is null:

      Set<RangerRole> roles = plugin_.get().getRoles().getRangerRoles();
      roleNames = roles.stream().map(RangerRole::getName).collect(Collectors.toSet());
      

      https://github.com/apache/impala/blob/08501cef2df16991bbd99656c696b978f08aeebe/fe/src/main/java/org/apache/impala/authorization/ranger/RangerImpaladAuthorizationManager.java#L135-L136

      To reproduce this, start Impala cluster with Ranger authorization:

      bin/start-impala-cluster.py --impalad_args="--server-name=server1 --ranger_service_type=hive --ranger_app_id=impala --authorization_provider=ranger" --catalogd_args="--server-name=server1 --ranger_service_type=hive --ranger_app_id=impala --authorization_provider=ranger"
      

      At the begining, there are no roles in Ranger. Run "SHOW ROLES" in Impala to reproduce the error.

      Attachments

        Activity

          People

            jichen0919@126.com ji.chen
            stigahuang Quanlong Huang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: