Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5704

Improve error message on client side when queries fail with "Failed to create schema tree." when Impersonation is enabled and logins are anonymous

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.12.0
    • None

    Description

      Reported by agirish

      When username is not specified then Drill set's the session user as anonymous if impersonation is enabled. During query execution Drill tries to build schema tree and as part of that it validates if the user has access to the workspace or not by using FileClient Api liststatus which verifies the user from the OS user. Since impersonation is only enabled here without authentication and we don't specify any user in connection string, Drill will use default user which is "anonymous" and pass that to check workspace permission which will fail as node doesn't have any valid user with that name.

      Caused by: java.io.IOException: Error getting user info for current user, anonymous
             ......
             ......
              at org.apache.drill.exec.store.dfs.DrillFileSystem.listStatus(DrillFileSystem.java:523) ~[drill-java-exec-1.9.0-SNAPSHOT.jar:1.9.0-SNAPSHOT]
              at org.apache.drill.exec.store.dfs.WorkspaceSchemaFactory.accessible(WorkspaceSchemaFactory.java:157) ~[drill-java-exec-1.9.0-SNAPSHOT.jar:1.9.0-SNAPSHOT]
              at org.apache.drill.exec.store.dfs.FileSystemSchemaFactory$FileSystemSchema.<init>(FileSystemSchemaFactory.java:78) ~[drill-java-exec-1.9.0-SNAPSHOT.jar:1.9.0-SNAPSHOT]
              at org.apache.drill.exec.store.dfs.FileSystemSchemaFactory.registerSchemas(FileSystemSchemaFactory.java:65) ~[drill-java-exec-1.9.0-SNAPSHOT.jar:1.9.0-SNAPSHOT]
              at org.apache.drill.exec.store.dfs.FileSystemPlugin.registerSchemas(FileSystemPlugin.java:150) ~[drill-java-exec-1.9.0-SNAPSHOT.jar:1.9.0-SNAPSHOT]
              at org.apache.drill.exec.store.StoragePluginRegistryImpl$DrillSchemaFactory.registerSchemas(StoragePluginRegistryImpl.java:365) ~[drill-java-exec-1.9.0-SNAPSHOT.jar:1.9.0-SNAPSHOT]
              at org.apache.drill.exec.store.SchemaTreeProvider.createRootSchema(SchemaTreeProvider.java:72) [drill-java-exec-1.9.0-SNAPSHOT.jar:1.9.0-SNAPSHOT]
              ... 10 common frames omitted
      
      1. $DRILL_HOME/bin/sqlline -u "jdbc:drill:zk=localhost:5181"
        sqlline> select * from sys.drillbits;
        User Error Occurred
        org.apache.drill.common.exceptions.UserException: RESOURCE ERROR: Failed to create schema tree.

      Attachments

        Issue Links

          Activity

            People

              shamirwasia Sorabh Hamirwasia
              shamirwasia Sorabh Hamirwasia
              Parth Chandra Parth Chandra
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: