Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Apache knox throwing authorization issues.

Apache knox throwing authorization issues.

New Contributor

I am using default gateway, ldap server and default conf/topology/sandbox.xml file which comes with the Apache knox. Tried using GETFILESTATUS api but getting authorization issues. Not sure what actually is causing authorization issues. Attached below are snippet from gateway.log and gateway-audit.log file

Error:

javax.servlet.ServletException: org.apache.shiro.subject.ExecutionException: java.security.PrivilegedActionException: javax.servlet.ServletException: java.util.EmptyStackException

Rest command

curl -ku guest:guest-password 'https://localhost:8443/gateway/sandbox/webhdfs/v1/?op=GETFILESTATUS'

gateway.log

2017-09-12 03:17:53,631 INFO  hadoop.gateway (GatewayServer.java:start(395)) - Monitoring topologies in directory: /usr/local/final/knox-0.9.0/bin/../conf/topologies
2017-09-12 03:17:53,634 INFO  hadoop.gateway (GatewayServer.java:startGateway(294)) - Started gateway on port 8,443.
2017-09-12 03:19:23,678 INFO  hadoop.gateway (GatewayServer.java:handleCreateDeployment(635)) - Deploying topology sandbox to /usr/local/final/knox-0.9.0/bin/../data/deployments/sandbox.topo.15e74193290
2017-09-12 03:19:23,678 INFO  hadoop.gateway (GatewayServer.java:internalDeactivateTopology(554)) - Deactivating topology sandbox
2017-09-12 03:19:24,692 INFO  hadoop.gateway (DefaultGatewayServices.java:initializeContribution(178)) - Creating credential store for the cluster: sandbox
2017-09-12 03:19:25,840 INFO  hadoop.gateway (GatewayServer.java:internalActivateTopology(524)) - Activating topology sandbox
2017-09-12 03:19:25,840 INFO  hadoop.gateway (GatewayServer.java:internalActivateArchive(534)) - Activating topology sandbox archive %2F
2017-09-12 03:20:20,941 INFO  hadoop.gateway (GatewayServer.java:handleCreateDeployment(635)) - Deploying topology sandbox to /usr/local/final/knox-0.9.0/bin/../data/deployments/sandbox.topo.15e741a0968
2017-09-12 03:20:20,941 INFO  hadoop.gateway (GatewayServer.java:internalDeactivateTopology(554)) - Deactivating topology sandbox
2017-09-12 03:20:21,074 INFO  hadoop.gateway (DefaultGatewayServices.java:initializeContribution(182)) - Credential store found for the cluster: sandbox - no need to create one.2017-09-12 03:20:21,807 INFO  hadoop.gateway (GatewayServer.java:internalActivateTopology(524)) - Activating topology sandbox
2017-09-12 03:20:21,807 INFO  hadoop.gateway (GatewayServer.java:internalActivateArchive(534)) - Activating topology sandbox archive %2F
2017-09-12 03:22:12,253 INFO  hadoop.gateway (KnoxLdapRealm.java:getUserDn(646)) - Computed userDn: uid=guest,ou=people,dc=hadoop,dc=apache,dc=org using dnTemplate for principal: guest
2017-09-12 03:22:14,591 ERROR hadoop.gateway (AbstractGatewayFilter.java:doFilter(69)) - Failed to execute filter: java.util.EmptyStackException
2017-09-12 03:22:14,592 ERROR hadoop.gateway (AbstractGatewayFilter.java:doFilter(66)) - Failed to execute filter: javax.servlet.ServletException: java.util.EmptyStackException
2017-09-12 03:22:14,592 ERROR hadoop.gateway (AbstractGatewayFilter.java:doFilter(66)) - Failed to execute filter: javax.servlet.ServletException: org.apache.shiro.subject.ExecutionException: java.security.PrivilegedActionException: javax.servlet.ServletException    : java.util.EmptyStackException
2017-09-12 03:22:14,593 ERROR hadoop.gateway (AbstractGatewayFilter.java:doFilter(66)) - Failed to execute filter: javax.servlet.ServletException: org.apache.shiro.subject.ExecutionException: java.security.PrivilegedActionException: javax.servlet.ServletException    : java.util.EmptyStackException
2017-09-12 03:22:14,600 ERROR hadoop.gateway (GatewayFilter.java:doFilter(145)) - Gateway processing failed: javax.servlet.ServletException: org.apache.shiro.subject.ExecutionException: java.security.PrivilegedActionException: javax.servlet.ServletException: java    .util.EmptyStackException
javax.servlet.ServletException: org.apache.shiro.subject.ExecutionException: java.security.PrivilegedActionException: javax.servlet.ServletException: java.util.EmptyStackException


gateway-audit.log

 17/09/12 03:22:12 ||8d8bc239-dd1f-4395-b00b-ff95166187d5|audit|WEBHDFS|guest|||authentication|uri|/gateway/sandbox/webhdfs/v1/?op=GETFILESTATUS|success|
 17/09/12 03:22:12 ||8d8bc239-dd1f-4395-b00b-ff95166187d5|audit|WEBHDFS|guest|||authentication|uri|/gateway/sandbox/webhdfs/v1/?op=GETFILESTATUS|success|Groups: []
17/09/12 03:22:12 ||8d8bc239-dd1f-4395-b00b-ff95166187d5|audit|WEBHDFS|guest|||dispatch|uri|http://localhost:50070/webhdfs/v1/?op=GETFILESTATUS&user.name=guest|unavailable|Request method: GET
17/09/12 03:22:14 ||8d8bc239-dd1f-4395-b00b-ff95166187d5|audit|WEBHDFS|guest|||dispatch|uri|http://localhost:50070/webhdfs/v1/?op=GETFILESTATUS&user.name=guest|success|Response status: 200
17/09/12 03:22:14 ||8d8bc239-dd1f-4395-b00b-ff95166187d5|audit|WEBHDFS|guest|||access|uri|/gateway/sandbox/webhdfs/v1/?op=GETFILESTATUS|failure