I'm trying to connect to an oracle database via the cx_Oracle python library but am getting the error message "ORA-12571: TNS:packet writer failure".
My connection logic currently looks like this:
import cx_Oracle as cOr
cOr.connect("USER_NAME/USER_PASSWORD#HOST_NAME:PORT/SERVICE_NAME")
My program is running on the WSL2 environment on a windows10 machine, so somehow I think this is where the trouble originates from. The python version I'm using is 3.6.9, cx-Oracle is 8.2.1 and this instant client necessary for the cx-Oracle is in version 21_1.
I found for example this article here https://support.microfocus.com/kb/doc.php?id=7018259 on this topic. Yet all the checks they mention there succeed for me, so it shouldn't be, that the target is simply not reachable from my system.
Also just using the Oracle SQL developer from the Windows part of the machine with the same data is working just fine.
I'm a bit out of ideas of what to do on this topic and hope for somebody to maybe give me a good hint. If there is any additional information you need from me I'll gladly provide it.
Related
I am new to Python. Can someone tell me what software should I install (Pycharm??) so that I can write program to connect to Teradata. Any sample code in python to get a specific table extraction will be useful too for me.
After several weeks looking for some information here and google, I've decided to post it here to see if anyone with the same problem can raise me a hand.
I have a java application developed in Eclipse Ganymede using tomcat to connect with my local database. The problem is that I want to send a simple message ("Hello World") to a Kafka Topic published on a public server. I've imported the libraries and developed the Kafka function but something happens when I run in debug mode. I have no issues or visible errors when compiling, but when I run the application and push the button to raise this function it stops in KafkaProducer function because there is NoClassDefFoundError kafka.producer..... It seems like it is not finding the library properly, but I have seen that it is in the build path properly imported.
I am not sure if the problem is with Kafka and the compatibility with Eclipse or Java SDK (3.6), it could be?. Anyone knows the minimum required version of Java for Kafka?
Also, I have found that with Kafka is really used Scala but I want to know if I can use this Eclipse IDE version for not change this.
Another solution that I found is to use a Python script called from the Java application, but I have no way to call it from there since I follow several tutorials but then nothing works, but I have to continue on this because it seems an easier option. I have developed the .py script and works with the Kafka server, now I have to found the solution to exchange variables from Java and Python. If anyone knows any good tutorial for this, please, let me know.
After this resume of my days and after hitting my head with the walls, maybe someone has found this error previously and can help me to find the solution, I really appreciate it and sorry for the long history.
Please include the Kafka client library within the WAR file of the Java application which you are deploying to Tomcat
Please use org.apache.kafka.clients.producer.KafkaProducer rather than kafka.producer.Producer (which is the old client API) and make sure you have the Kafka client library on the classpath. The client library is entirely in Java. It's the old API that's written in scala, as is the server-side code. You don't need to import the server library in your code or add it to the classpath if you use the new client API.
At the end the problem was related with the library that was not well added. I had to add it in the build.xml file, importing here the library. Maybe this is useful for the people who use an old Eclipse version.
So now it finds the library but I have to update Java version, other matter. So it is solved
Yesterday this code was working fine both in local and production servers:
import cloudstorage
def filelist(Handler):
gs_bucket_name="/bucketname"
list=cloudstorage.listbucket(gs_bucket_name)
logging.warning(list)
self.write(list)
for e in list:
self.write(e)
self.write("<br>")
From yesterday to today I've upgraded GAE Launcher and changed the billing options (I was using a free trial and now a paid account) (not sure if it has anything to do, but just to give extra information)
But today the code stopped working in local (works fine in production)
This is the beginning of the error log
WARNING 2015-02-20 09:50:21,721 admin.py:106] <cloudstorage.cloudstorage_api._Bucket object at 0x10ac31e90>
ERROR 2015-02-20 09:50:21,729 api_server.py:221] Exception while handling service_name: "app_identity_service"
method: "GetAccessToken"
request: "\n7https://www.googleapis.com/auth/devstorage.full_control"
request_id: "WoMrXkOyfe"
The warning shows a bucket object, but as soon as I try to iterate in the list I get the exception on the identity service.
What is hapening? Seems that I need to authorize local devserver gcs mockup, but I'm not sure how.
Remember this is only happening in devserver, not in production.
Thanks for your help
This is a problem with the latest release (1.9.18). For now, until it gets fixed, you can downgrade to 1.9.17 by downloading the installer from here and just running it: https://storage.googleapis.com/appengine-sdks/featured/GoogleAppEngineLauncher-1.9.17.dmg
As per the answer below, the 1.9.18 has been patched with a fix for this. If you still want to install the 1.9.17 version, please follow this link: https://storage.googleapis.com/appengine-sdks/deprecated/1917/GoogleAppEngineLauncher-1.9.17.dmg
It's a known bug in the dev_appserver, where the SDK does not cope with the credentials already persisted in earlier versions. For me (on Ubuntu 15.10 with SDK 1.9.33) it helped to simply remove a file:
rm ~/.config/gcloud/application_default_credentials.json
as suggested in the bug issue filed by Jari Wiklund.
Update: As of March 5th, 2105 this was fixed in the public release of 1.9.18, which may be a simpler way to get the fix.
Note: while the fix was in Python, issue can surface in Java, PHP and Go also because they use the Python local dev server code.
I do believe that the cause of the problem is a bug in the local dev server (GoogleAppEngineLauncher), recently released.
I'm experiencing something similar in the PHP runtime: GloudStorage fails locally
I am writing a piece of code that uses the Box.com Python SDK. The SDK uses the requests module to communicate with Box.com as per the API documentation. For my purposes, I need to make several GET and POST requests in a row, some of which could be used to transfer files. The issue that I'm running into is this:
On Linux (Ubuntu 13.10), each request takes a relatively long time (5 to 15 seconds) to get through, though transfer speeds for file transfers are as expected in the context of my network connection.
On Windows 8.1, running the exact same code, the requests go through really fast (sub-second fast).
On both platforms I am using the same version of iPython (1.1.0) and of the requests module (1.2.3) under Python 2.7. This is particularly problematic for me because the code I'm working on will eventually be implemented on Linux machines.
Is this problem someone has encountered before? I would love to hear from anyone with some ideas on what the issue might be. I have yet to try it on a different Linux installation to see if it is a problem with the specific setup.
Thanks.
EDIT 1
So, I decided to check this using virtual machines. Using the same Debian virtual machine under Windows all the responses were fast, but under Ubuntu they were slow. I then made a Ubuntu 12.04 live USB and ran the code on that, and the responses were fast there as well.
So, it's not Python or Linux in general, it's my particular installation and I have no idea how to diagnose the problem :(
Use a tool such as wireshark (which needs to be run with sudo on most distributions) to log the individual network packets when your code makes the API requests, to determine what is taking so long.
My guess is the following possibilities are most likely:
For some reason your Ubuntu installation is picking up the wrong DNS server list, and DNS lookups are timing out.
IPv6 issue (which may appear to be a DNS issue, too). Disable IPv6.
I have a small application written in python using TwistedWeb. It is a chat server.
Everything is configured right now as for localhost.
All I want is to run this python script on a server(shared server provided by Fatcow.com).
I mean that the script will be working all the time and some clients will connect/disconnect to it. Fatcow gives me python 2.5 without any custom libraries. Is there a way and a tutorial how to make it work with TwistedWeb?
Thanks in advice.
the easy_install/pip modes of installation are very likely to fail because of broken dependencies. You will have to download the tar and build it yourself. See the attached link for more info on installing the same on CENTOS.
http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#CanIinstallTwistedusingeasy_installorpip
I have contacted Fatcow.com support. They do not support SSH connections and do not support Python 2.7 with Twisted library, especially python socket application as server. So it is dead end.
Question resolved.