Created 11-04-2016 12:37 PM
Hue Server won't start.. keeps complaining on python load of module pyscopg2.
+ /usr/lib/hue/build/env/bin/hue migrate --merge Traceback (most recent call last): File "/usr/lib/hue/build/env/bin/hue", line 13, in <module> load_entry_point('desktop==3.9.0', 'console_scripts', 'hue')() File "/usr/lib/hue/desktop/core/src/desktop/manage_entry.py", line 64, in entry raise e django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2 + '[' dumpdata = runcpserver ']' + '[' syncdb = runcpserver ']' + exec /usr/lib/hue/build/env/bin/hue runcpserver Traceback (most recent call last): File "/usr/lib/hue/build/env/bin/hue", line 13, in <module> load_entry_point('desktop==3.9.0', 'console_scripts', 'hue')() File "/usr/lib/hue/desktop/core/src/desktop/manage_entry.py", line 64, in entry raise e django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: No module named psycopg2
However, from command line
[root@cscvmrhel01 bin]# python
Python 2.7.5 (default, Oct 11 2015, 17:47:16)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import psycopg2
>>> import psycopg2
>>>
No errors reported.
Any Suggestions?
Created 11-08-2016 09:38 AM
Make sure the psycopg2 package is installed for the certified Python version Hue is using and that Hue's Python sys.path variable points to the right directory/directories. Pls post it here if you got anywhere with it.
Created 11-21-2016 07:28 AM
Another solution can be reinstalling the psycopg2 rpm package if already installed it before installing CDH. I read it somewhere this solved problems similar to Yours @RobertH.
Created 11-30-2016 12:07 AM
I had the same issue with Cloudera 5.9.0 on CentOS 7 and I was able to resolve the issue by copying the files from /usr/lib64/python2.7/site-packages/psycopg2* to /usr/lib/hue/build/env/lib/python2.7/site-packages/
Created 11-30-2016 12:34 AM
@Choolake thank you for your input. Please stay tuned for news on this matter.
Created 11-30-2016 01:52 AM
this fixed the problem for me also, but it does feel like an ugly hack for some bug.
Created on 12-01-2016 04:43 AM - edited 12-01-2016 04:46 AM
Hmm that's weird. I just brought up a 4 node cluster without a problem from archive.cloudera.com like this:
python-psycopg2-2.5.1-3.el7.x86_64 is installed by CM as well
I only experienced problems when installing C5.8+ on CentOS 5.x. What did you do differently regarding the C5.9.0+CentOS7.x install @Choolake?
Created 12-01-2016 07:42 PM
I used,
CentOS: 7.2
JAVA: 1.8.0_102
psycopg2: psycopg2-2.6.2-py2.7
and CM 5.9.0 from RPM with external postgresql-9.4
Created 12-02-2016 07:52 AM
Hi, @Choolake, you should not need to do anything special with psycopg2 on CentOS 7.
This should work for CDH 5.9 on CentOS 7 with JDK 1.8 ... and PostgreSQL 9.4 (which I put on a separate host):
#################################
## All hosts in the cluster
#################################
yum update -y
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u102-b14/jdk-8u102-linux-x64.rpm
rpm -ivh jdk-8u102-linux-x64.rpm
## Set vm.swappiness=10
vi /etc/sysctl.conf
cat /proc/sys/vm/swappiness
sudo sysctl -w vm.swappiness=10
#################################
## Primary host in cluster
#################################
yum update -y
wget https://archive.cloudera.com/cm5/redhat/7/x86_64/cm/cloudera-manager.repo -P /etc/yum.repos.d/
yum install -y cloudera-manager-daemons cloudera-manager-server
yum install -y cloudera-manager-server-db-2
service cloudera-scm-server-db start
service cloudera-scm-server start
#################################
## Database host (ideally, not in cluster)
#################################
yum -y update
rpm -ivh http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm
yum install postgresql94-server -y
/usr/pgsql-9.4/bin/postgresql94-setup initdb
## Configure per: http://www.cloudera.com/documentation/enterprise/latest/topics/hue_ins_connect_db.html#concept_lpg_r...
vi /var/lib/pgsql/9.4/data/pg_hba.conf
vi /var/lib/pgsql/9.4/data/postgresql.conf
systemctl enable postgresql-9.4.service
systemctl start postgresql-9.4.service
## Create database per: http://www.cloudera.com/documentation/enterprise/latest/topics/hue_ins_connect_db.html#concept_rq3_m...
sudo -u postgres psql
psql -h localhost -U hue -d hue
Finally, run the Cloudera Manager wizard in a browser and connect to the external database server (with port 5432) on the Database Setup page.
Created on 01-09-2017 05:12 PM - edited 01-09-2017 05:14 PM
This issue also happens for us on RHEL 7.2 using the following simple installation path for a POC:
wget https://archive.cloudera.com/cm5/installer/latest/cloudera-manager-installer.bin chmod u+x cloudera-manager-installer.bin sudo ./cloudera-manager-installer.bin --i-agree-to-all-licenses --noprompt --noreadme --nooptions
Hue fails to start with missing module psycopg2 error.
I created a symlink using following command and successfully started Hue:
sudo ln -s /usr/lib64/python2.7/site-packages/psycopg2 /opt/cloudera/parcels/CDH/lib/hue/build/env/lib/python2.7/site-packages/psycopg2