Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
Labels (1)
avatar

- Suppose if we have a webserver configured in front of the ambari server something like following "/etc/httpd/conf/httpd.conf"

<VirtualHost erie1.example.com:80>
    ServerAdmin erie1.example.com
    ProxyPass / http://erie1.example.com:8080/  
</VirtualHost>

Means any request coming to "http://erie1.example.com" will be passed to "http://erie1.example.com:8080/" now with this setup we will see that ambari is working fine and accessible.

However when we try to access the PigView then we will see that the PigView is not able to load the scripts:

Also we will see that in the debugger tool that the script URL is not accessible (404 http response)

http://erie1.example.com/api/v1/views/PIG/versions/1.0.0/instances/Pig_A/resources/file/%2Fuser%2Fad...

Above is the URL using which PigView tries to read the script that is stored in the HDFS. Even when we open this URL in the browser we get the same 404 error. However we see that the file is present in the HDFS with proper read write permission.

[root@erie1 /]# su - hdfs
[hdfs@erie1 ~]$ hdfs dfs -ls /user/admin/pig/scripts/smalldatatest-2016-11-25_09-26.pig
-rw-r--r--   3 admin hadoop         84 2016-11-25 13:17 /user/admin/pig/scripts/smalldatatest-2016-11-25_09-26.pig

.

- However if we replace the "%2F" with "/" in the above URL the we should be able to open this URL in the browser.

http://erie1.example.com/api/v1/views/PIG/versions/1.0.0/instances/Pig_A/resources/file//user/admin/...

- Check your webserver setting to find out if it allows "AllowEncodedSlashes" or not? For example refer to: http://httpd.apache.org/docs/current/mod/core.html#allowencodedslashes

The AllowEncodedSlashes directive allows URLs which contain encoded path separators (%2F for / and additionally %5C for \ on accordant systems) to be used in the path info.

- With the default value, "Off", such URLs are refused with a 404 (Not found) error.

- With the value "On", such URLs are accepted, and encoded slashes are decoded like all other encoded characters.

- With the value "NoDecode", such URLs are accepted, but encoded slashes are not decoded but left in their encoded state.

NoDecode option available in 2.3.12 and later.

612 Views
Version history
Last update:
‎11-29-2016 07:57 PM
Updated by:
Former Member
Contributors