I am trying to connect to my Exasol SaaS database, I tried via these tools(TALEND, DBVISUALIZER, POWERBI) and via python but I cannot connect and I keep getting the same error.
I saw another post on Exasol community https://community.exasol.com/t5/discussion-forum/exaconnectionfailederror/m-p/8049#M1855 of this type of error but it doesn't explain exactly what was done to fix the error. I tried via the ODBC Data Source administrator(64-bit) too but still the same error. Maybe its an connection issue with my pc self but I'm not sure or maybe I am just inserting wrong values I don't know.
Oh the values I inserted are the recommended ones from what Exasol docs states and I have removed anything about proxy or vpn.
I put my errors under. I tried via different devices and I get the same error I really don't know what I can do any more, so any help will be greatly appreciated.
Note: I am using the Exasol SaaS database and I am currently on the trial mode so I am not sure if this is limiting me.
**Errors: **
Error message odbc exasol: [EXASOL][EXASolution driver]connection attempt timed out.
Error message Talend : Connection failure. You must change the Database Settings.
java.lang.RuntimeException: com.exasol.jdbc.ConnectFailed: connect timed out ->
Caused by: com.exasol.jdbc.ConnectFailed: connect timed out
Error message pyexasol : socket.timeout: timed out
Error message dbvisualizer : java.net.SocketTimeoutException: Connect timed out com.exasol.jdbc.ConnectFailed: java.net.SocketTimeoutException: Connect timed out
Error message Power BI desktop : Details: "ODBC: ERROR [HYT00][EXASOL][EXASolution driver]Connection attempt timed out."
My applications versions:
DbVisualizer Free 14.0.1 (build: 3540)
Talend Open Studio Data integration(8.0.1.2021119_1610)
java version -> jdk-16.0.02
Power BI -> Version: 2.110.1085.0 64-bit (October 2022)
ODBC : exasolodbc x64 7.1.14
JDBC : exasoljdbc 7.1.14
Python: python 3.8.10 -> pyexasol : 0.25.1
The error means that the client is not able to reach the host for some reason. Try the following:
Make sure the database is still online (they auto-shutdown after 2 hours if there is no activity by default)
Check that the IP Address of the host you are connecting with is added to the allow list in the SaaS UI. (see the docs)
Check if your host is able to reach the host and port specified in the SaaS UI (for example using telnet on port 8563). Maybe some firewall is preventing access to the database?
So I did more digging. actually I have no idea what the issue was.
Talend:
I made a connection via JDBC in Talend with the help of exasol-support. The DBType Exasol in talend doesn't work for some reason, its not known if it's talend side or Exasol side, maybe this will be updated in the future. Just remember in the jdbc url type this: "jdbc:exa:yourconnectionstring", don't forget the "exa".
PowerBI:
I tried the connection string with fingerprint method that worked for me. Just put the fingerprint with the connection string and it should connect.
https://exasol.my.site.com/s/article/PowerBI-Encryption-Fingerprint-Issue-in-Exasol-7-1?language=en_US
DBvisualizer:
I had a wrong in connection string.
Python:
I had a wrong in connection string.
Hopefully this helps someone.
Related
I am trying to connect to the database via Python ?
I use oracle with the sqldevolper and have no problems there, but now when connecting between oracle and python the problem appears.
When I try to connect, I get the following error :
cx_Oracle.DatabaseError: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
I tried the script with spyder:
import cx_Oracle
con = cx_Oracle.connect(
user="abc",
password ="pass",
dsn="....")
ORA-12514 means you are connecting to a listener, but the service name you specified in your connection string, isn't known by the listener. As you omitted the definition of the connect string (from SQL Developer and Python), hard to say if there is a typo or what caused it...
On the server you can check with "lsnrctl status" on the known services... maybe that gives you a hint, what might be wrong.
I am very new to Elasticsearch and want to analyze data in python.
I installed Elasticsearch pip and tried to import data but failed with error messages
es = Elasticsearch([{'hosts':'10.251.0.135', 'port':'5601'}])
es.info()
> ConnectionError: ConnectionError(<urllib3.connection.HTTPConnection object at 0x000001AD21943460>: Failed to establish a new connection: [WinError 10061] caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x000001AD21943460>: Failed to establish a new connection: [WinError 10061]
or
es = Elasticsearch("http://10.251.0.134:5601/")
es.info()
> TransportError: TransportError(302, '')
I looked out some solutions but they kinda assume that I have Elasticsearch in my local machine, which in my case isn't much helpful.
I don't think I am not authorized to access the data as I can access to data through web-hosting Kibana app. Hope to know what would be the problem.
Thanks to leandrojmp, I manage to find the answer.
My situation was:
At work, needed to retrieve Elasticsearch server data to python.
I was the only analyst and others see data through kibana(5601).
No Elasticsearch or Kibana installed on my local machine, so the advice like change configuration doesn't seems to match.
The error was as stated on the question
How I manage to figure out:
I went to port 9200 on the browser, which is direct access to Elasticsearch DB and find out that I only have access to port 5601, not 9200.
Asked Server manager to disable the firewall, and everything works find :)
I'm pretty new to python. I'm trying to connect to an informix server using python and ibm_db.connect(). However I can't seem to succeed and the error messages don't help.
Using java and jdbc I can connect successfully with the following connection url:
jdbc:informix-sqli://10.20.30.40:1234/mydb:INFORMIXSERVER=foo_bar;USER=user;PASSWORD=pass;
My attempt at using ibm_db is:
ibm_db.connect('HOSTNAME=10.20.30.40;PORT=1234;DATABASE=mydb;PROTOCOL=ONSOCTCP;UID=user;PASSWORD=pass;', '', '')
But it gives an error (Exception: [IBM][CLI Driver] SQL0902C A system error occurred. Subsequent SQL statements cannot be processed. IBM software support reason code: "". SQLSTATE=58005)
I would like if possible an equivalent string I can put in as the first argument to
ibm_db.connect('', '', '')
So I can connect with python.
Please check https://code.google.com/p/ibm-db/issues/detail?id=116&can=1&q=ONSOCTCP, This might be helpful for you. If you still facing issue then you can post your query to https://groups.google.com/forum/#!forum/ibm_db for quick response.
Protocol onsoctcp is not supported by ibm_db.
Please check https://www.ibm.com/support/knowledgecenter/SSGU8G_11.50.0/com.ibm.admin.doc/ids_admin_0207.htm, This can help you to configure a DDRA (tcpip) access to your database.
I have faced the same issue with ibm_db and now I use jayDeBeApi to connect to Informix through python. it requires java JDBC driver and application is work like a charm.
https://pypi.org/project/JayDeBeApi/#:~:text=The%20JayDeBeApi%20module%20allows%20you,of%20the%20Java%20JDBC%20driver.
Your JDBC connection string points to a SQLI Informix listener, but the 'ibm_db' python module uses DRDA (IBM Data Server Driver) to connect to the Informix engine.
Informix allows both SQLI and DRDA clients (and others like MongoDB). SQLI is the 'native' Informix protocol and supports all the Informix server features and data types. DRDA is what other IBM databases use (like DB2). It does have some limitations in terms of what types you can use.
You have two options:
Configure the Informix server to listen for DRDA connections in a another port (basically, create an DBALIASES using 'drsoctcp') as described here:
https://www.ibm.com/support/knowledgecenter/SSGU8G_11.50.0/com.ibm.admin.doc/ids_admin_0207.htm
Or leave the server as it is, and use a different Python module, one that uses SQLI like 'IfxPy'
https://github.com/OpenInformix/IfxPy
I am using ncclient to connect to the netconf. However when ever i try to connect through python
"ncclient.transport.errors.SessionCloseError: Unexpected session close" error is thrown. the code snippet that i am using is given below
manager.connect('<servername>',22,username='<username>')
Any help on this is much appriciated. I am able to connect to the remote server by using public key, hence i didnt provide passwordk in connect
And in the netconf server logs i am able to see access-denied error. (I got the same prob even when i tried with username and pwd)
You haven't given a lot of information.
Which version of ncclient are you using?
Which version of Python are you using?
Which NETCONF implementation are you trying to connect to? Is this to an actual switch or router, or something like a Linux server running libnetconf or yuma?
Based on the info here, I could imagine a couple of things being wrong:
paramiko isn't using the right key to establish SSH transport.
You're attempting to establish a NETCONF session with an SSH server rather than a NETCONF server.
In your script, create some logs with something like manager.logging.basicConfig(filename='ncclient.log', level=manager.logging.DEBUG) and then re-run your script - do you get anything more informative?
This is an old question, but I hope I can point you in the right direction at least.
its possible that your machines don't know each other (like when you connect via normal ssh and get the "unknown key, really connect (y/n)?" error. In that case, by default the session will not connect. To change this behavior use the "unknown_host_cb" parameter:
def allowUnknownHosts(host,fingerprint):
return True
self.manager = manager.connect(host=host, port=port, username=user,password=password, unknown_host_cb=allowUnknownHosts)
After accessing my web app using:
- Python 2.7
- the Bottle micro framework v. 0.10.6
- Apache 2.2.22
- mod_wsgi
- on Ubuntu Server 12.04 64bit; I'm receiving this error after several hours:
OperationalError: (2006, 'MySQL server has gone away')
I'm using MySQL - the native one included in Python. It usually happens when I don't access the server. I've tried closing all the connections, which I do, using this:
cursor.close()
db.close()
where db is the standard MySQLdb.Connection() call.
The my.cnf file looks something like this:
key_buffer = 16M
max_allowed_packet = 128M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
It is the default configuration file except max_allowed_packet is 128M instead of 16M.
The queries to the database are quite simple, at most they retrieve approximately 100 records.
Can anyone help me fix this? One idea I did have was use try/except but I'm not sure if that would actually work.
Thanks in advance,
Jamie
Update: try/except calls didn't work.
This is MySQL error, not Python's.
The list of possible causes and possible solutions is here: MySQL 5.5 Reference Manual: C.5.2.9. MySQL server has gone away.
Possible causes include:
You tried to run a query after closing the connection to the server. This indicates a logic error in the application that should be corrected.
A client application running on a different host does not have the necessary privileges to connect to the MySQL server from that host.
You have encountered a timeout on the server side and the automatic reconnection in the client is disabled (the reconnect flag in the MYSQL structure is equal to 0).
You can also get these errors if you send a query to the server that is incorrect or too large. If mysqld receives a packet that is too large or out of order, it assumes that something has gone wrong with the client and closes the connection. If you need big queries (for example, if you are working with big BLOB columns), you can increase the query limit by setting the server's max_allowed_packet variable, which has a default value of 1MB. You may also need to increase the maximum packet size on the client end. More information on setting the packet size is given in Section C.5.2.10, “Packet too large”.
You also get a lost connection if you are sending a packet 16MB or larger if your client is older than 4.0.8 and your server is 4.0.8 and above, or the other way around.
and so on...
In other words, there are plenty of possible causes. Go through that list and check every possible cause.
Make sure you are not trying to commit to a closed MySqldb object
An answer to a (very closely related) question has been posted here: https://stackoverflow.com/a/982873/209532
It relates directly to the MySQLdb driver (MySQL-python (unmaintained) and mysqlclient (maintained fork)), but the approach is the the same for other driver the does not support automatic reconnect.
For me this was fixed using
MySQLdb.connect("127.0.0.1","root","","db" )
instead of
MySQLdb.connect("localhost","root","","db" )
and then
df.to_sql('df',sql_cnxn,flavor='mysql',if_exists='replace', chunksize=100)