I'm trying to connect to Essbase using Maxl DLL but I'm getting an error. I think this error has to do with ctype, but I'm quite not sure how to find the root cause and fix this. Any guidance will be appreciated.
Using Maxl DLL in C:\ORACLE\Middleware\EPMSystem11R1\common\EssbaseRTC-64\11.1.2.0\bin\essmaxlu.dll
Traceback (most recent call last):
File "<ipython-input-8-c96d45911659>", line 42, in <module>
eh = esss.connect("userID", "password", "123.123.123.123")
File "C:\Python3\Lib\Essbase.py", line 220, in connect
self.sts = self.maxl.MaxLSessionCreate(c_char_p(host.encode('utf-8')), c_char_p(user.encode('utf-8')), c_char_p(password.encode('utf-8')), byref(self.ssnInit), byref(self.sid))
OSError: exception: access violation reading 0x000000000000000C
Here's what I have:
def connect(self, user, password, host='localhost'):
self.sid = c_ushort(0)
self.ssnInit = maxl_ssninit_t()
self.sts = self.maxl.MaxLSessionCreate(c_char_p(host.encode('utf-8')), c_char_p(user.encode('utf-8')), c_char_p(password.encode('utf-8')), byref(self.ssnInit), byref(self.sid))
self.user = user
self.numFlds = 0
self.bMdxQuery = 0
Related
I am trying to connect to Impala Shell so I can create tables from Pandas DataFrames from Cloudera Datascience Workbench
based on this blog post:
https://netlify--tdhopper.netlify.app/blog/creating-impala-tables-from-pandas-dataframes/
I get SSL error. Can anyone help me to know what is missing?
import os
import ibis
hdfs_host = 'xxxxx.xxxxx.com'
hdfs_port = xxxxx
impala_host = 'xxxxxx.xxxxxx.com'
impala_port = xxxxxxx
hdfs = ibis.impala.hdfs_connect(host=hdfs_host, port=hdfs_port)
client = ibis.impala.connect(host=impala_host, port=impala_port, hdfs_client=hdfs, auth_mechanism='GSSAPI', use_ssl=True)
Error output
failed to initialize SSL
Traceback (most recent call last):
File "/home/cdsw/.local/lib/python3.9/site-packages/ibis/backends/impala/client.py", line 113, in _get_cursor
cursor = self.connection_pool.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/thrift/transport/TSSLSocket.py", line 281, in _do_open
return self._wrap_socket(plain_sock)
File "/usr/local/lib/python3.9/site-packages/thrift/transport/TSSLSocket.py", line 181, in _wrap_socket
self.ssl_context.load_verify_locations(self.ca_certs)
FileNotFoundError: [Errno 2] No such file or directory
....
TTransportException: failed to initialize SSL
from fbchat import Client
fc = Client('______#gmail.com', '______')
I used this simple code from fbchat documentation, but when I tried logging in, I always get this error
Attempt #1 failed, retrying
Traceback (most recent call last):
File "C:\anaconda3\lib\site-packages\fbchat\_client.py", line 205, in login
self._state = State.login(
File "C:\anaconda3\lib\site-packages\fbchat\_state.py", line 151, in login
return cls.from_session(session=session)
File "C:\anaconda3\lib\site-packages\fbchat\_state.py", line 190, in from_session
revision = int(r.text.split('"client_revision":', 1)[1].split(",", 1)[0])
IndexError: list index out of range
What should I do?
My python version is 3.8
in your pc go to the path:
C:\anaconda3\lib\site-packages\fbchat_state.py
line 190, change:
revision = int(r.text.split('"client_revision":', 1)[1].split(",", 1)[0])
to:
revision = 1
Then save it and run your code again, it should work.
I am trying to build a Networkscanner that scans my localnetwork.
Here is how I would do it:
Create an ARP Request.
Create an Ethernet Frame.
Place the ARP Request inside the Ethernet Frame.
Send the combined frame and receive responses.
Then parse the responses and print the results.
Here is my code so far:
#!/usr/bin/env python3
import scapy.all as scapy
IP = 'here i would enter my IP adress'
def scan(ip):
arp_packet = scapy.ARP(pdst=ip)
broadcast_packet = scapy.Ether(dst='ff:ff:ff:ff:ff:ff')
arp_broadcast_packet = broadcast_packet/arp_packet
scapy.srp(arp_broadcast_packet, timeout = 1, verbose = False)
scan(IP)
However I am getting the error message :
AttributeError: 'L2bpfSocket' object has no attribute 'ins'
Here is the complete message:
Traceback (most recent call last):
File "/Users/Uni/Dropbox/Mein Mac (Elias MacBook Pro)/Desktop/wifi2.py", line 12, in <module>
scan(IP)
File "/Users/Uni/Dropbox/Mein Mac (Elias MacBook Pro)/Desktop/wifi2.py", line 10, in scan
scapy.srp(arp_broadcast_packet, timeout = 1, verbose = False)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/scapy/sendrecv.py", line 552, in srp
s = conf.L2socket(promisc=promisc, iface=iface,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/scapy/arch/bpf/supersocket.py", line 242, in __init__
super(L2bpfListenSocket, self).__init__(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/scapy/arch/bpf/supersocket.py", line 62, in __init__
(self.ins, self.dev_bpf) = get_dev_bpf()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/scapy/arch/bpf/core.py", line 114, in get_dev_bpf
raise Scapy_Exception("No /dev/bpf handle is available !")
scapy.error.Scapy_Exception: No /dev/bpf handle is available !
Exception ignored in: <function _L2bpfSocket.__del__ at 0x7fc3220493a0>
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/scapy/arch/bpf/supersocket.py", line 139, in __del__
self.close()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/scapy/arch/bpf/supersocket.py", line 211, in close
if not self.closed and self.ins is not None:
AttributeError: 'L2bpfSocket' object has no attribute 'ins'
Elias-MBP:~ Uni$
I read that it could be do to the program trying to close a L2bpfSocket that couldn't be created, therefore not having a Attribute ins.
However I have no clue how to fix this, or why the L2bpfSocket couldn't be created in the first place.
Make sure you're running your script as root.
The second issue isn't important, the main one being that Scapy can't open a /dev/bpf handler.
I've got the problem using pywin32 library and trying to connect to OLEDB.
Traceback
Traceback (most recent call last):
File "<input>", line 35, in <module>
File "<input>", line 31, in ado
File "<COMObject ADODB.Recordset>", line 4, in Open
the XML parser for analysis: the response Time for the XML for analysis request timed out before it was completed.', None, 0, -2147467259), None)
I've tried to add Connect Timeout=1000 to my connectionstring to no avail.
Code
import win32com.client
import pyodbc
conn = win32com.client.Dispatch(r'ADODB.Connection')
DSN = CONNECTION_STRING
conn.Open(DSN)
rs = win32com.client.Dispatch(r'ADODB.Recordset')
strsql = u"""
select
...
...
...
"""
h = rs.Open(strsql, conn,0,1)
ts = rs.GetRows()
conn.Close()
return ts
I think that the problem is here:
h = rs.Open(strsql, conn,0,1)
I can't see which parameters should be passed to 'Open'. But I think it must have timeout parameter.
How can I change command timeout?
The problem is solved by adding:
conn.CommandTimeout=3000
At first I tried:
import pymongo
MONGOHQ_URL = "mongodb://username:password#kahana.mongohq.com:10025/dbname"
conn = pymongo.MongoClient(MONGOHQ_URL)
but apparently it failed and it throws following error:
Traceback (most recent call last):
File "bot.py", line 95, in <module>
conn = pymongo.Connection(MONGOHQ_URL)
File "/var/lib/openshift/53abb500028e/python/virtenv/lib/python2.7/site-packages/pymongo/connection.py", line 236, in __init__
max_pool_size, document_class, tz_aware, _connect, **kwargs)
File "/var/lib/openshift/53abb500028e/python/virtenv/lib/python2.7/site-packages/pymongo/mongo_client.py", line 369, in __init__
raise ConnectionFailure(str(e))
pymongo.errors.ConnectionFailure: [Errno 13] Permission denied
They have an example, but it's in Ruby and I have no idea. If I am not wrong, I guess the connection is happening in this script.
Can anyone makeout from this ruby code and help me so that I can use in my python script with pymongo? I have already set environment variable MONGO_URL