jpark

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/impala_shell.py", line 34, in <module>
    from impala_client import (ImpalaClient, DisconnectedException, QueryStateException,
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/impala_client.py", 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/__init__.py", 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/saslwrapper.py", 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/_saslwrapper.py", 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/_saslwrapper.py", line 4, in __bootstrap__
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/pkg_resources.py", line 874, in resource_filename
    self, resource_name
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/pkg_resources.py", 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/pkg_resources.py", line 1375, in _extract_resource
    self.egg_name, self._parts(zip_path)
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/pkg_resources.py", line 954, in get_cache_path
    self.extraction_error()
  File "/opt/mapr/impala/impala-2.5.0/shell/lib/pkg_resources.py", 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
cache:

 

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

 

The Python egg cache directory is currently set to:

 

  /home/.python-eggs

 

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]
[mapr@maprdemo]$

 

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:

 

from

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

to

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

Outcomes