Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hue service db connection test failing in CDP7.1.9

avatar
Explorer

Hi All,

I am facing the issue of adding the hue service in CDP 7.1.9, after using the correct DB credentials, the DB test is failing for the hue service only.

Facing the following issues, can anyone suggest any solution?

2024-01-17 11:15:08,066 INFO scm-web-5531:com.cloudera.enterprise.JavaMelodyFacade: Entering HTTP Operation: Method:POST, Path:/dbTestConn/testConnection
2024-01-17 11:15:08,067 INFO scm-web-5531:com.cloudera.cmf.service.ServiceHandlerRegistry: Executing host command HueTestDatabaseConnection with sensitive arguments. Host: DbHost{id=1546335515, hostId=41e041ff-13f3-47c0-b9a3-8b8e23e8cea7, hostName=NVMBDPRP005704CDPNN1}
2024-01-17 11:15:08,172 INFO scm-web-5531:com.cloudera.cmf.service.ServiceHandlerRegistry: Host command HueTestDatabaseConnection launched with id=1546351230
2024-01-17 11:15:08,180 INFO CommandPusher-1:com.cloudera.server.cmf.CommandPusherThread: Acquired lease lock on DbCommand:1546351230
2024-01-17 11:15:08,182 INFO scm-web-5531:com.cloudera.enterprise.JavaMelodyFacade: Exiting HTTP Operation: Method:POST, Path:/dbTestConn/testConnection, Status:200
2024-01-17 11:15:10,897 INFO scm-web-5594:com.cloudera.enterprise.JavaMelodyFacade: Entering HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult
2024-01-17 11:15:10,899 INFO scm-web-5594:com.cloudera.enterprise.JavaMelodyFacade: Exiting HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult, Status:200
2024-01-17 11:15:12,910 INFO scm-web-5585:com.cloudera.enterprise.JavaMelodyFacade: Entering HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult
2024-01-17 11:15:12,912 INFO scm-web-5585:com.cloudera.enterprise.JavaMelodyFacade: Exiting HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult, Status:200
2024-01-17 11:15:13,184 INFO CommandPusher-1:com.cloudera.server.cmf.CommandPusherThread: Acquired lease lock on DbCommand:1546351230
2024-01-17 11:15:14,919 INFO scm-web-5759:com.cloudera.enterprise.JavaMelodyFacade: Entering HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult
2024-01-17 11:15:14,921 INFO scm-web-5759:com.cloudera.enterprise.JavaMelodyFacade: Exiting HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult, Status:200
2024-01-17 11:15:16,932 INFO scm-web-5434:com.cloudera.enterprise.JavaMelodyFacade: Entering HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult
2024-01-17 11:15:16,933 INFO scm-web-5434:com.cloudera.enterprise.JavaMelodyFacade: Exiting HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult, Status:200
2024-01-17 11:15:18,186 INFO CommandPusher-1:com.cloudera.server.cmf.CommandPusherThread: Acquired lease lock on DbCommand:1546351230
2024-01-17 11:15:18,242 WARN avro-servlet-hb-processor-2:com.cloudera.server.cmf.AgentProtocolImpl: Received Process Heartbeat for unknown (or duplicate) process. Ignoring. This is expected to happen once after old process eviction or process deletion (as happens in restarts). id=1546351214 name=null host=41e041ff-13f3-47c0-b9a3-8b8e23e8cea7/NVMBDPRP005704CDPNN1
2024-01-17 11:15:18,477 INFO CommandPusher-1:com.cloudera.server.cmf.CommandPusherThread: Acquired lease lock on DbCommand:1546351230
2024-01-17 11:15:19,897 INFO scm-web-5567:com.cloudera.enterprise.JavaMelodyFacade: Entering HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult
2024-01-17 11:15:19,899 INFO scm-web-5567:com.cloudera.enterprise.JavaMelodyFacade: Exiting HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult, Status:200
2024-01-17 11:15:20,205 INFO CommandPusher-1:com.cloudera.server.cmf.CommandPusherThread: Acquired lease lock on DbCommand:1546351230
2024-01-17 11:15:20,206 INFO CommandPusher-1:com.cloudera.cmf.service.AbstractOneOffHostCommand: Unsuccessful 'HueTestDatabaseConnection'
2024-01-17 11:15:20,206 INFO CommandPusher-1:com.cloudera.cmf.service.AbstractDbConnectionTestCommand: Command exited with code: 1
2024-01-17 11:15:20,206 INFO CommandPusher-1:com.cloudera.cmf.service.AbstractDbConnectionTestCommand: ++ PATH=/opt/cloudera/cm-agent/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/bin
++ break
++ echo /usr/bin/python3.8
+ pybin=/usr/bin/python3.8
+ '[' -z x ']'
+ [[ /usr/bin/python3.8 == \/\o\p\t\/\r\h\/\r\h\-\p\y\t\h\o\n\3\8* ]]
++ run_python /usr/bin/python3.8 3.8
++ python_version=3.8
++ /usr/bin/python3.8 --version
++ '[' '!' 0 -eq 0 ']'
+++ /usr/bin/python3.8 --version
+++ grep Python
+++ cut '-d ' -f2
+++ cut -d. -f1,2
++ version_output=3.8
++ [[ 3.8 == \3\.\8 ]]
++ echo 3.8
+ [[ 3.8 == \3\.\8 ]]
+ python38_exists=1
+ '[' exit_yes == exit_yes ']'
+ '[' 1 -eq 0 ']'
+ echo 1
+ '[' -n 7 ']'
+ '[' 7 -ge 7 ']'
+ '[' 0 -eq 0 ']'
++ detect_distro
++ local RHEL_FILE=/etc/redhat-release
++ RHEL_VERSION=
++ [[ -f /etc/redhat-release ]]
++ [[ -z '' ]]
+++ grep -Eo 'Red Hat Enterprise Linux release [0-9.]+' /etc/redhat-release
++ local 'release_line=Red Hat Enterprise Linux release 8.8'
++ [[ 0 -eq 0 ]]
+++ echo 'Red Hat Enterprise Linux release 8.8'
+++ awk '{print $6}'
++ local version_string=8.8
++ RHEL_VERSION=8
++ RHEL_VERSION=redhat8
++ echo redhat8
+ RHEL_VERSION=redhat8
+ [[ ! -z redhat8 ]]
+ [[ redhat8 == \r\e\d\h\a\t\9 ]]
+ add_postgres_to_python38path
+ grep -q '^\s*engine\s*=\s*postgres\+' hue.ini
+ '[' 7 -ge 7 ']'
+ '[' -z x ']'
+ echo 'LD_LIBRARY_PATH is taken from safety valve, :/opt/cloudera/cm-agent/lib'
+ '[' -z x ']'
+ echo 'PYTHONPATH is taken from safety valve, /opt/cloudera/cm-agent/lib/python3.8/site-packages:/opt/cloudera/cm-agent/thirdparty'
+++ which python3.8
++ /opt/cloudera/cm-agent/bin/python3.8 -c 'import psycopg2 ; print (psycopg2.__version__.rsplit()[0])'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'psycopg2'
+ PSYCOPG2_VERSION=
+ version_gt 2.5.4
++ echo 2.5.4
++ tr ' ' '\n'
++ sort -rV
++ head -n 1
+ test 2.5.4 == 2.5.4 -a 2.5.4 '!=' ''
+ echo 'ERROR: Unable to find psycopg2 2.5.4 or higher version. You may need to manually install it. See https://docs.cloudera.com/r/cdh718-hue-psycopg2'
+ exit 1

 

2024-01-17 11:15:20,207 ERROR CommandPusher-1:com.cloudera.cmf.model.DbCommand: Command 1546351230(HueTestDatabaseConnection) has completed. finalstate:FINISHED, success:false, msg:Unexpected error. Unable to verify database connection.
2024-01-17 11:15:20,207 INFO CommandPusher-1:com.cloudera.cmf.command.components.CommandStorage: Invoked delete temp files for command:DbCommand{id=1546351230, name=HueTestDatabaseConnection, host=NVMBDPRP005704CDPNN1} at dir:/var/lib/cloudera-scm-server/temp/commands/1546351230
2024-01-17 11:15:22,898 INFO scm-web-5434:com.cloudera.enterprise.JavaMelodyFacade: Entering HTTP Operation: Method:POST, Path:/dbTestConn/checkConnectionResult

 

 

 

1 REPLY 1

avatar
Master Collaborator

Hello @CK_c 

From the shared stack trace  I see psycopg2 is not installed

Can you install psycopg2 using below command
# pip3.8 install psycopg2==2.9.3