Support Questions
Find answers, ask questions, and share your expertise

import error (python) starting hue after upgrade to 5.13

Highlighted

import error (python) starting hue after upgrade to 5.13

Explorer

upgraded from cdh 5.6 to 5.13

and since then, hue will not start.

 

stderr from running a "Start" on "Hue" through the Manager- GUI

 

 

++ tr '\n' :
++ find /usr/share/cmf/lib/plugins -maxdepth 1 -name '*.jar'
+ ADD_TO_CP=/usr/share/cmf/lib/plugins/tt-instrumentation-5.13.0.jar:/usr/share/cmf/lib/plugins/event-publish-5.13.0-shaded.jar:
+ [[ -n '' ]]
+ eval 'OLD_VALUE=$HADOOP_EXTRA_CLASSPATH_STRING'
++ OLD_VALUE=
+ NEW_VALUE=/usr/share/cmf/lib/plugins/tt-instrumentation-5.13.0.jar:/usr/share/cmf/lib/plugins/event-publish-5.13.0-shaded.jar:
+ export HADOOP_EXTRA_CLASSPATH_STRING=/usr/share/cmf/lib/plugins/tt-instrumentation-5.13.0.jar:/usr/share/cmf/lib/plugins/event-publish-5.13.0-shaded.jar
+ HADOOP_EXTRA_CLASSPATH_STRING=/usr/share/cmf/lib/plugins/tt-instrumentation-5.13.0.jar:/usr/share/cmf/lib/plugins/event-publish-5.13.0-shaded.jar
+ HUE=/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/bin/hue
+ [[ runcpserver == runcpserver ]]
+ grep -q '^\s*ssl_certificate\s*=\s*.\+' hue.ini hue_safety_valve.ini hue_safety_valve_server.ini
+ '[' '!' -z '' ']'
+ run_syncdb_and_migrate_subcommands
+ /opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/bin/hue syncdb --noinput
+ '[' -z '' ']'
+ MERGE_FLAG=--merge
+ '[' 5 -ge 5 ']'
+ /opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/bin/hue migrate --merge
+ '[' dumpdata = runcpserver ']'
+ '[' syncdb = runcpserver ']'
+ '[' ldaptest = runcpserver ']'
+ exec /opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/bin/hue runcpserver
Traceback (most recent call last):
  File "/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/bin/hue", line 8, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2707, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 686, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 584, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute

 

it seems like it's a bad import in the hue script: 

/opt/cloudera/parcels/CDH-5.13.0-1.cdh5.13.0.p0.29/lib/hue/build/env/bin/hue

 

 

#!/usr/bin/env python2.7

import os; activate_this=ocdn(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, activate_this

# EASY-INSTALL-ENTRY-SCRIPT: 'desktop==3.9.0','console_scripts','hue'
__requires__ = 'desktop==3.9.0'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
    sys.exit(
        load_entry_point('desktop==3.9.0', 'console_scripts', 'hue')()
    )

should be changed to( changes on line 6 and 10)

 

 

#!/usr/bin/env python2.7

import os; activate_this=ocdn(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, activate_this

# EASY-INSTALL-ENTRY-SCRIPT: 'desktop==3.9.0','console_scripts','hue'
__requires__ = 'desktop==3.9.0'
import sys
import pkg_resources

if __name__ == '__main__':
    sys.exit(
    pkg_resources.EntryPoint.load('desktop==3.9.0', 'console_scripts', ‘hue’)()
    )

 

is there another way to solve this?

 

something like putting the old pkg_resource into the path of the new?

 

1 REPLY 1
Highlighted

Re: import error (python) starting hue after upgrade to 5.13

Explorer

UPDATE:

 

did some experimentations on my own,

and i deleted the pkg_resources, in /usr/lib/python2.7/dist-packages

this apparantly fixed the issue as hue will now run, and allow me to log in.

 

i am not sure if an update would also work...