Sharmadha Sainath created KNOX-879: -------------------------------------- Summary: Error in knox query processing when original url contains a parameter with value containing "=" Key: KNOX-879 URL: https://issues.apache.org/jira/browse/KNOX-879 Project: Apache Knox Issue Type: Bug Components: KnoxCLI Reporter: Sharmadha Sainath
Issue seen while working Atlas with Knox SSO. Atlas is set up to use Knox SSO form login for authentication. DSL Search query : hive_table where name="table_1" is encoded by Atlas as {code} http://AtlasHost:21000/api/atlas/v2/search/dsl?limit=25&query=hive_table+where+name%3D%22table_1%22 {code} When the above query is fired , it is redirected to knox gateway as : {code} https:/KnoxGatewayHost:8443/gateway/knoxsso/knoxauth/login.html?originalUrl=http://AtlasHost:21000/api/atlas/v2/search/dsl?limit=25&query=hive_table+where+name%3D%22table_1%22 {code} On providing correct credentials and trying to sign in , knox threw 500 Internal server error with response : {code} Problem accessing /gateway/knoxsso/api/v1/websso. {code} Following exceptions are found in knox gateway logs : {code} 2017-02-10 11:19:36,649 INFO service.knoxsso (WebSSOResource.java:getCookieValue(317)) - Unable to find cookie with name: original-url 2017-02-10 11:19:36,653 ERROR service.knoxsso (WebSSOResource.java:addJWTHadoopCookie(294)) - Unable to add cookie to response. Illegal character in query at index 103: http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:21000/api/atlas/v2/search/dsl?limit=25&query="table_1": [Ljava.lang.StackTraceElement;@479999f5 {code} (Note : host name is masked with "x" chars matching with length of the actual Atlas host name so that "index 103" in gateway logs would make sense) Actual query was : hive_table where name="table_" which now became : "table_1" because of the equals character found twice in the query (near query once and near name once) {code} ?limit=25&query=hive_table where name="table_1" {code} The following query is processed well by Knox as there are no extra "equals" {code} http://AtlasHost:21000/api/atlas/v2/search/dsl?limit=25&query=hive_table {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)