[jira] [Commented] (KYLIN-3223) Query for the list of hybrid cubes results in NPE

2018-02-09 Thread Vsevolod Ostapenko (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-3223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16358628#comment-16358628
 ] 

Vsevolod Ostapenko commented on KYLIN-3223:
---

[~yimingliu], I created a revised version of the fix to use updated ACL 
checking API provided by KYLIN-3239 (Refactor the ACL code about 
checkPermission and hasPermission).
Please review and provide feedback.

> Query for the list of hybrid cubes results in NPE
> -
>
> Key: KYLIN-3223
> URL: https://issues.apache.org/jira/browse/KYLIN-3223
> Project: Kylin
>  Issue Type: Bug
>  Components: REST Service
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Vsevolod Ostapenko
>Priority: Major
> Fix For: v2.3.0
>
> Attachments: 
> 0001-KYLIN-3223-Query-for-the-list-of-hybrid-cubes-result.patch, 
> KYLIN-3223.master.001.patch
>
>
> Calling REST API to get the list of hybrid cubes returns stack trace with NPE 
> exception.
> {quote}curl -u ADMIN:KYLIN -X GET -H 'Content-Type: application/json'  -d {}  
> [http://localhost:7070/kylin/api/hybrids]
>  {quote}
>  
> If a parameter project without a value is specified, call succeeds. E.g.
> {quote}curl -u ADMIN:KYLIN -X GET -H 'Content-Type: application/json'  -d {} 
> [http://localhost:7070/kylin/api/hybrids?project]
> {quote}
> Quick look at the HybridService.java suggests that there is a bug in the 
> code, where the very first line tries to check ACLs on the project using the 
> project name, which is NULL, when project parameter is not specified as part 
> of the URL.
>  If parameter is specified without a value, ACL check is not performed, so 
> it's another bug, as the list of projects is retrieved without read 
> permission checking.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3223) Query for the list of hybrid cubes results in NPE

2018-02-08 Thread Billy Liu (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-3223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16357856#comment-16357856
 ] 

Billy Liu commented on KYLIN-3223:
--

Agree. The access check is missing on this API. 
LGTM.
Patch merged at http://git-wip-us.apache.org/repos/asf/kylin/commit/0655dbc3. 
Thank you, [~seva_ostapenko]

> Query for the list of hybrid cubes results in NPE
> -
>
> Key: KYLIN-3223
> URL: https://issues.apache.org/jira/browse/KYLIN-3223
> Project: Kylin
>  Issue Type: Bug
>  Components: REST Service
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Vsevolod Ostapenko
>Priority: Major
> Fix For: v2.3.0
>
> Attachments: 
> 0001-KYLIN-3223-Query-for-the-list-of-hybrid-cubes-result.patch
>
>
> Calling REST API to get the list of hybrid cubes returns stack trace with NPE 
> exception.
> {quote}curl -u ADMIN:KYLIN -X GET -H 'Content-Type: application/json'  -d {}  
> [http://localhost:7070/kylin/api/hybrids]
>  {quote}
>  
> If a parameter project without a value is specified, call succeeds. E.g.
> {quote}curl -u ADMIN:KYLIN -X GET -H 'Content-Type: application/json'  -d {} 
> [http://localhost:7070/kylin/api/hybrids?project]
> {quote}
> Quick look at the HybridService.java suggests that there is a bug in the 
> code, where the very first line tries to check ACLs on the project using the 
> project name, which is NULL, when project parameter is not specified as part 
> of the URL.
>  If parameter is specified without a value, ACL check is not performed, so 
> it's another bug, as the list of projects is retrieved without read 
> permission checking.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3223) Query for the list of hybrid cubes results in NPE

2018-02-08 Thread Vsevolod Ostapenko (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-3223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16357639#comment-16357639
 ] 

Vsevolod Ostapenko commented on KYLIN-3223:
---

[~yimingliu], I attached the proposed patch for NPE and missing read access 
check on projects, when project either not specified or empty.
Please review or have someone to look at the changes and provide feedback.

> Query for the list of hybrid cubes results in NPE
> -
>
> Key: KYLIN-3223
> URL: https://issues.apache.org/jira/browse/KYLIN-3223
> Project: Kylin
>  Issue Type: Bug
>  Components: REST Service
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: nichunen
>Priority: Major
> Attachments: 
> 0001-KYLIN-3223-Query-for-the-list-of-hybrid-cubes-result.patch
>
>
> Calling REST API to get the list of hybrid cubes returns stack trace with NPE 
> exception.
> {quote}curl -u ADMIN:KYLIN -X GET -H 'Content-Type: application/json'  -d {}  
> [http://localhost:7070/kylin/api/hybrids]
>  {quote}
>  
> If a parameter project without a value is specified, call succeeds. E.g.
> {quote}curl -u ADMIN:KYLIN -X GET -H 'Content-Type: application/json'  -d {} 
> [http://localhost:7070/kylin/api/hybrids?project]
> {quote}
> Quick look at the HybridService.java suggests that there is a bug in the 
> code, where the very first line tries to check ACLs on the project using the 
> project name, which is NULL, when project parameter is not specified as part 
> of the URL.
>  If parameter is specified without a value, ACL check is not performed, so 
> it's another bug, as the list of projects is retrieved without read 
> permission checking.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3223) Query for the list of hybrid cubes results in NPE

2018-02-01 Thread Billy Liu (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-3223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16349773#comment-16349773
 ] 

Billy Liu commented on KYLIN-3223:
--

Thanks [~seva_ostapenko], I think you have identified the root cause. Do you 
want to submit a PR?

> Query for the list of hybrid cubes results in NPE
> -
>
> Key: KYLIN-3223
> URL: https://issues.apache.org/jira/browse/KYLIN-3223
> Project: Kylin
>  Issue Type: Bug
>  Components: REST Service
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Zhixiong Chen
>Priority: Major
>
> Calling REST API to get the list of hybrid cubes returns stack trace with NPE 
> exception.
> {quote}curl -u ADMIN:KYLIN -X GET -H 'Content-Type: application/json'  -d {} 
> [http://localhost:7070/kylin/api/hybrids]
> {"code":"999","data":null,"msg":null,"stacktrace":"java.lang.NullPointerException\n\tat
>  
> java.util.concurrent.ConcurrentSkipListMap.doGet(ConcurrentSkipListMap.java:778)\n\tat
>  
> java.util.concurrent.ConcurrentSkipListMap.get(ConcurrentSkipListMap.java:1546)\n\tat
>  
> org.apache.kylin.metadata.cachesync.SingleValueCache.get(SingleValueCache.java:85)\n\tat
>  
> org.apache.kylin.metadata.project.ProjectManager.getProject(ProjectManager.java:172)\n\tat
>  
> org.apache.kylin.rest.util.AclEvaluate.getProjectInstance(AclEvaluate.java:39)\n\tat
>  
> org.apache.kylin.rest.util.AclEvaluate.checkProjectReadPermission(AclEvaluate.java:61)\n\tat
>  
> org.apache.kylin.rest.service.HybridService.listHybrids(HybridService.java:115)\n\tat
>  
> org.apache.kylin.rest.controller.HybridController.list(HybridController.java:76)\n\tat
>  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat
>  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat
>  java.lang.reflect.Method.invoke(Method.java:497)\n\tat 
> org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)\n\tat
>  
> org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)\n\tat
>  
> org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)\n\tat
>  
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)\n\tat
>  
> org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)\n\tat
>  
> org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)\n\tat
>  
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)\n\tat
>  
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)\n\tat
>  
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)\n\tat
>  
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)\n\tat
>  javax.servlet.http.HttpServlet.service(HttpServlet.java:624)\n\tat 
> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)\n\tat
>  javax.servlet.http.HttpServlet.service(HttpServlet.java:731)\n\tat 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)\n\tat
>  
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat
>  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)\n\tat 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)\n\tat
>  
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)\n\tat
>  
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)\n\tat
>  
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)\n\tat
>  
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)\n\tat
>  
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\n\tat
>  
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)\n\tat
>  
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)\n\tat
>  
> org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.j