Permission denied while running impala-shell through oozie

Blog Post created by jpark Employee on Dec 7, 2016

You could get a permission denied error while running impala-shell through oozie as follows:


[mapr@maprdemo]$ cat stderr
Traceback (most recent call last):
  File "/opt/mapr/impala/impala-2.5.0/shell/", line 34, in <module>
    from impala_client import (ImpalaClient, DisconnectedException, QueryStateException,
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/", line 16, in <module>
    import sasl
  File "/opt/mapr/impala/impala-2.5.0/shell/ext-py/sasl-0.1.1-py2.6-linux-x86_64.egg/sasl/", line 1, in <module>
  File "/opt/mapr/impala/impala-2.5.0/shell/ext-py/sasl-0.1.1-py2.6-linux-x86_64.egg/sasl/", line 7, in <module>
  File "/opt/mapr/impala/impala-2.5.0/shell/ext-py/sasl-0.1.1-py2.6-linux-x86_64.egg/", line 7, in <module>
  File "/opt/mapr/impala/impala-2.5.0/shell/ext-py/sasl-0.1.1-py2.6-linux-x86_64.egg/", line 4, in __bootstrap__
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/", line 874, in resource_filename
    self, resource_name
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/", line 1349, in get_resource_filename
    self._extract_resource(manager, self._eager_to_zip(name))
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/", line 1375, in _extract_resource
    self.egg_name, self._parts(zip_path)
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/", line 954, in get_cache_path
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/", line 920, in extraction_error
    raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache


The following error occurred while trying to extract file(s) to the Python egg


  [Errno 13] Permission denied: '/home/.python-eggs'


The Python egg cache directory is currently set to:




Perhaps your account does not have write access to this directory?  You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.


Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.ShellMain], exit code [1]


The cause of this error is that the PYTHON_EGG_CACHE environment variable is not specified.

You can fix this error by modifying /opt/mapr/impala/impala-*/shell/impala-shell script as follows:





export PYTHON_EGG_CACHE=/tmp/impala-shell-python-egg-cache-${USER}