web2py firebird db fails connect - python

I trying to connect a web2py app to a firebird database in another server.
This is the output message:
Ticket ID
127.0.0.1.2016-01-11.12-27-33.cdefb9f6-3cc5-46ce-85dc-a2a12220e7f6
Failure to connect, tried 5 times:
Traceback (most recent call last): File
"/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/packages/dal/pydal/base.py",
line 435, in init self._adapter = ADAPTERSself._dbname
File
"/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/packages/dal/pydal/adapters/base.py",
line 53, in call obj = super(AdapterMeta, cls).call(*args,
**kwargs) File "/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/packages/dal/pydal/adapters/firebird.py",
line 121, in init if do_connect: self.reconnect() File
"/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/packages/dal/pydal/connection.py",
line 105, in reconnect self.connection = f() File
"/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/packages/dal/pydal/adapters/firebird.py",
line 119, in connector return self.driver.connect(**driver_args) File
"/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/contrib/pypyodbc.py",
line 2434, in init self.connect(connectString, autocommit, ansi,
timeout, unicode_results, readonly) File
"/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/contrib/pypyodbc.py",
line 2483, in connect check_success(self, ret) File
"/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/contrib/pypyodbc.py",
line 988, in check_success ctrl_err(SQL_HANDLE_DBC, ODBC_obj.dbc_h,
ret, ODBC_obj.ansi) File
"/home/filhofilha/Documents/Deployment/Web2Py/web2py/gluon/contrib/pypyodbc.py",
line 964, in ctrl_err raise Error(state,err_text) Error: (u'IM012',
u'[IM012] [unixODBC][Driver Manager]DRIVER keyword syntax error')
My Code:
dbExternal = DAL('firebird://user:password#localhost/C:\\DB.FDB', migrate_enabled=False)
how can I fix it ?
Thanks

I was missing the python firebird driver. I installed it to correct my problem

Related

Problems with pythonanywhere [duplicate]

I made a Discord Bot using Python 3.6. It runs and behaves perfectly when run on my computer, yet when I run it on PythonAnywhere, I get this message. I installed Discord.py and all necessary modules. Please help. I am not that very good with complex programming talk, and not at all good with web talk, so please answer as simply as you can. Does this issue only happen with PythonAnywhere or all remote hosting sites?
01:42 ~ $ python3.6 MyCoolBot.py
Traceback (most recent call last):
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 601, in _create_direc
t_connection
local_addr=self._local_addr)
File "/usr/lib/python3.6/asyncio/base_events.py", line 778, in create_connection
raise exceptions[0]
File "/usr/lib/python3.6/asyncio/base_events.py", line 765, in create_connection
yield from self.sock_connect(sock, address)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 450, in sock_connect
return (yield from fut)
File "/usr/lib/python3.6/asyncio/selector_events.py", line 480, in _sock_connect_cb
raise OSError(err, 'Connect call failed %s' % (address,))
ConnectionRefusedError: [Errno 111] Connect call failed ('104.16.58.5', 443)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 304, in connect
yield from self._create_connection(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 578, in _create_conne
ction
transport, proto = yield from self._create_direct_connection(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 624, in _create_direc
t_connection
(req.host, req.port, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 111] Can not connect to discordapp.com:443 [Connect call failed ('104.16.
58.5', 443)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "MyCoolBot.py", line 39, in <module>
client.run('MY_BOT_TOKEN')
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 519, in run
self.loop.run_until_complete(self.start(*args, **kwargs))
File "/usr/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
return future.result()
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 490, in start
yield from self.login(*args, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 416, in login
yield from getattr(self, '_login_' + str(n))(*args, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/client.py", line 346, in _login_1
data = yield from self.http.static_login(token, bot=is_bot)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/http.py", line 258, in static_login
data = yield from self.request(Route('GET', '/users/#me'))
File "/home/CompuGenius/.local/lib/python3.6/site-packages/discord/http.py", line 137, in request
r = yield from self.session.request(method, url, **kwargs)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/client.py", line 555, in __iter__
resp = yield from self._coro
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/client.py", line 198, in _request
conn = yield from self._connector.connect(req)
File "/home/CompuGenius/.local/lib/python3.6/site-packages/aiohttp/connector.py", line 314, in connect
.format(key, exc.strerror)) from exc
aiohttp.errors.ClientOSError: [Errno 111] Cannot connect to host discordapp.com:443 ssl:True [Can not connect to discordapp.com:443 [Connect call failed ('104.16.58.5', 443)]]
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7f4b25d81be0>
This is because PythonAnywhere requires a proxy in such a way that the aiohttp websockets don't support. There's a thread on their forums about it here: https://www.pythonanywhere.com/forums/topic/7384/ (See #Patrick Haugh's comment above)

Pymysql Unknow Encoding "latin1"

I have experience running pymysql because it always return
the following error
Traceback (most recent call last):
File "synch.py", line 69, in <module>
db = pymysql.connect(host='localhost',user='root',password='mypassword',db='mytable',charset='utf8')
File "/home/pi/.local/lib/python2.7/site-packages/pymysql/__init__.py", line 94, in Connect
return Connection(*args, **kwargs)
File "/home/pi/.local/lib/python2.7/site-packages/pymysql/connections.py", line 327, in __init__
self.connect()
File "/home/pi/.local/lib/python2.7/site-packages/pymysql/connections.py", line 587, in connect
self._get_server_information()
File "/home/pi/.local/lib/python2.7/site-packages/pymysql/connections.py", line 976, in _get_server_information
self.server_version = data[i:server_end].decode('latin1')
LookupError: unknown encoding: latin1

Error connecting to PyPy3 multiprocessing remote manager

I am trying to run the remote manager example code from the multiprocessing documentation in pypy3 but I get an error connecting the client.
Traceback (most recent call last):
File "C:/temp/testpypy/mp_client.py", line 7, in <module>
m.connect()
File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\managers.py", line 455, in connect
conn = Client(self._address, authkey=self._authkey)
File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 493, in Client
answer_challenge(c, authkey)
File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 732, in answer_challenge
message = connection.recv_bytes(256) # reject large message
File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 407, in _recv_bytes
buf = self._recv(4)
File "C:\Python\pypy3-v6.0.0-win32\lib-python\3\multiprocessing\connection.py", line 386, in _recv
buf.write(chunk)
TypeError: 'str' does not support the buffer interface
if I try to connect to it from a CPython interpreter (which is my ultimate goal) I get the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\managers.py", line 455, in connect
conn = Client(self._address, authkey=self._authkey)
File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\connection.py", line 493, in Client
answer_challenge(c, authkey)
File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\connection.py", line 737, in answer_challenge
response = connection.recv_bytes(256) # reject large message
File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\connection.py", line 218, in recv_bytes
self._bad_message_length()
File "c:\Python\3.5.4.2\WinPython\python-3.5.4.amd64\lib\multiprocessing\connection.py", line 151, in _bad_message_length
raise OSError("bad message length")
OSError: bad message length
Turns out to be a bug in PyPy3.
Here is the fixed ticket:
https://bitbucket.org/pypy/pypy/issues/2841/remote-multprocessing-issue#comment-45861347

Severe error in Openerp 6.1

I have this problem with openerp 6.1, is it possible to repair it? I can't login to the system. This is the error. Thanks for your collaborations
>Client Traceback (most recent call last):
File "/opt/openerp/servercp/openerp/addons/web/common/http.py", line 180, in dispatch
response["result"] = method(controller, self, **self.params)
File "/opt/openerp/servercp/openerp/addons/web/controllers/main.py", line 353, in get_list
dbs = proxy.list()
File "/opt/openerp/servercp/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
result = self.connector.send(self.service_name, method, *args)
File "/opt/openerp/servercp/openerp/addons/web/common/http.py", line 611, in send
raise fault
Server Traceback (most recent call last):
File "/opt/openerp/servercp/openerp/addons/web/common/http.py", line 592, in send
result = openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/opt/openerp/servercp/openerp/netsvc.py", line 360, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/opt/openerp/servercp/openerp/service/web_services.py", line 117, in dispatch
return fn(*params)
File "/opt/openerp/servercp/openerp/service/web_services.py", line 310, in exp_list
cr = db.cursor()
File "/opt/openerp/servercp/openerp/sql_db.py", line 465, in cursor
return Cursor(self._pool, self.dbname, serialized=serialized)
File "/opt/openerp/servercp/openerp/sql_db.py", line 173, in __init__
self._cnx = pool.borrow(dsn(dbname))
File "/opt/openerp/servercp/openerp/sql_db.py", line 366, in _locked
return fun(self, *args, **kwargs)
File "/opt/openerp/servercp/openerp/sql_db.py", line 421, in borrow
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
File "/usr/local/lib/python2.7/dist-packages/psycopg2/__init__.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: could not fork new process for connection: Cannot allocate memory
could not fork new process for connection: Cannot allocate memory
could not fork new process for connection: Cannot allocate memory
This seems like a postgresql error, it usually happens when the system runs out of memory. If you do not have root access to the machine, you'll need to contact the system administrator

gevent timeout error on socket.io connection

I have a setup containing varnish nginx and 2 pyramid backends one of them running socket.io app. All the stack works correctly on my local development computer, but i can't get to work the websocket part on the production computer. The traceback of the error that trows the socketio app when a client socket.io tries to connect:
[2012-11-20 14:32:00] "GET /socket.io/1/websocket/790777701707 HTTP/1.1" 101 - -
Traceback (most recent call last):
File "/var/pyramid/maxserver/eggs/gevent-0.13.8-py2.7-linux-i686.egg/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/var/pyramid/maxserver/eggs/gevent_socketio-0.3.5_rc2-py2.7.egg/socketio/transports.py", line 226, in send_into_ws
websocket.send(message)
File "/var/pyramid/maxserver/eggs/gevent_websocket-0.3.6-py2.7.egg/geventwebsocket/websocket.py", line 350, in send
return self.send_frame(message, self.OPCODE_TEXT)
File "/var/pyramid/maxserver/eggs/gevent_websocket-0.3.6-py2.7.egg/geventwebsocket/websocket.py", line 340, in send_frame
self._write(combined)
File "/var/pyramid/maxserver/eggs/gevent-0.13.8-py2.7-linux-i686.egg/gevent/socket.py", line 515, in sendall
data_sent += self.send(_get_memory(data, data_sent), flags, timeout=timeleft)
File "/var/pyramid/maxserver/eggs/gevent-0.13.8-py2.7-linux-i686.egg/gevent/socket.py", line 483, in send
return sock.send(data, flags)
error: [Errno 32] Broken pipe
<Greenlet at 0xa449c0c: send_into_ws> failed with error
Traceback (most recent call last):
File "/var/pyramid/maxserver/eggs/gevent-0.13.8-py2.7-linux-i686.egg/gevent/greenlet.py", line 390, in run
result = self._run(*self.args, **self.kwargs)
File "/var/pyramid/maxserver/eggs/gevent_socketio-0.3.5_rc2-py2.7.egg/socketio/transports.py", line 230, in read_from_ws
message = websocket.receive()
File "/var/pyramid/maxserver/eggs/gevent_websocket-0.3.6-py2.7.egg/geventwebsocket/websocket.py", line 296, in receive
result = self._receive()
File "/var/pyramid/maxserver/eggs/gevent_websocket-0.3.6-py2.7.egg/geventwebsocket/websocket.py", line 244, in _receive
frame = self.receive_frame()
File "/var/pyramid/maxserver/eggs/gevent_websocket-0.3.6-py2.7.egg/geventwebsocket/websocket.py", line 177, in receive_frame
data0 = read(2)
File "/var/pyramid/maxserver/eggs/gevent_websocket-0.3.6-py2.7.egg/geventwebsocket/python_fixes.py", line 22, in readinto
return self._sock.recv_into(b)
File "/var/pyramid/maxserver/eggs/gevent-0.13.8-py2.7-linux-i686.egg/gevent/socket.py", line 472, in recv_into
wait_read(sock.fileno(), timeout=self.timeout, event=self._read_event)
File "/var/pyramid/maxserver/eggs/gevent-0.13.8-py2.7-linux-i686.egg/gevent/socket.py", line 169, in wait_read
switch_result = get_hub().switch()
File "/var/pyramid/maxserver/eggs/gevent-0.13.8-py2.7-linux-i686.egg/gevent/hub.py", line 164, in switch
return greenlet.switch(self)
timeout: timed out
<Greenlet at 0xa46157c: read_from_ws> failed with timeout
I've checked all python packages versions and there are identical in both computers. Also upgraded production computer to libevent 1.4.14b to match local computer.
I don't know which way to go to debug this. Help appreciated!

Categories