Reply
New Contributor
Posts: 2
Registered: ‎05-07-2019

Hue JDBC to MSSQL Error 2

Hi

 

I'm getting an error on a JDBC connection on CDH 6.1

 

[07/May/2019 18:10:36 -0300] decorators ERROR Error running autocomplete
Traceback (most recent call last):
File "/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hue/desktop/libs/notebook/src/notebook/decorators.py", line 97, in decorator
return func(*args, **kwargs)
File "/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hue/desktop/libs/notebook/src/notebook/api.py", line 567, in autocomplete
autocomplete_data = get_api(request, snippet).autocomplete(snippet, database, table, column, nested)
File "/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hue/desktop/libs/notebook/src/notebook/connectors/base.py", line 360, in get_api
return JdbcApi(request.user, interpreter=interpreter)
File "/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hue/desktop/libs/notebook/src/notebook/connectors/jdbc.py", line 68, in __init__
self.db = API_CACHE[self.cache_key] = Jdbc(self.options['driver'], self.options['url'], username, self.options['password'], impersonation_property=impersonation_property, impersonation_user=user.username)
File "/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hue/desktop/libs/librdbms/src/librdbms/jdbc.py", line 68, in __init__
self.gateway = JavaGateway.launch_gateway(classpath=classpath)
File "/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hue/build/env/lib/python2.7/site-packages/py4j-0.9-py2.7.egg/py4j/java_gateway.py", line 1537, in launch_gateway
daemonize_redirect=daemonize_redirect)
File "/opt/cloudera/parcels/CDH-6.1.0-1.cdh6.1.0.p0.770702/lib/hue/build/env/lib/python2.7/site-packages/py4j-0.9-py2.7.egg/py4j/java_gateway.py", line 178, in launch_gateway
close_fds=True)
File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

 

I've try to find the missing file but got no luck at all

Posts: 1,138
Topics: 1
Kudos: 293
Solutions: 139
Registered: ‎04-22-2014

Re: Hue JDBC to MSSQL Error 2

Hi @diegon ,

 

Since the failure happens when attempting to start a java process via the python gateway (setting up a pipe I believe), can you verify that you have Java installed on the host where Hue is running? It is hard to tell which file does not exist, but making sure "java" is installed and can be accessed by the "hue" user, might be a good first thing to check.

 

I am assessing this based on the code in "java_gateway.py":

 

    # Launch the server in a subprocess.
154    classpath = os.pathsep.join((jarpath, classpath))
155    command = ["java", "-classpath", classpath] + javaopts + \
156              ["py4j.GatewayServer"]
157    if die_on_exit:
158        command.append("--die-on-broken-pipe")
159    command.append(str(port))
160    logger.debug("Launching gateway with command {0}".format(command))
161
162    # stderr redirection
163    if redirect_stderr is None:
164        stderr = open(os.devnull, "w")
165    elif isinstance(redirect_stderr, Queue) or\
166            isinstance(redirect_stderr, deque):
167        stderr = PIPE
168    else:
169        stderr = redirect_stderr
170        # we don't need this anymore
171        redirect_stderr = None
172
173    # stdout redirection
174    if redirect_stdout is None:
175        redirect_stdout = open(os.devnull, "w")
176
177    proc = Popen(command, stdout=PIPE, stdin=PIPE, stderr=stderr,
178                 close_fds=True)
New Contributor
Posts: 2
Registered: ‎05-07-2019

Re: Hue JDBC to MSSQL Error 2

[ Edited ]

Hi @bgooley,

 

Thanks for you reply.

 

Well, this is odd. This Hue installation is part of a CDH 6.1 cluster, and withitn this server we got several java processes running.

 

I've checked what you suggested and you were right, the java-openjdk packages were not installed on this particular server, but there are 2 copies of the bundle jdk from cloudera.

 

I've installed those packages and now the JDBC interface it's working as expected at least the connection, now there are some error messages about the tables but I'm not sure if it's from the MS server side, I'll check that tomorrow

 

May be it is an installation issue ?

 

Best Regards,

Diego