I am using Google Appengine with python 2.7 standard environment and try to push data on Firebase Realtime database using firebase-admin.But I got following error when push or get data,is it authentication issue,how to resolve this issue?
('Connection broken: IncompleteRead(62 bytes read)', IncompleteRead(62 bytes read))
Traceback (most recent call last):
File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1511, in __call__
rv = self.handle_exception(request, response, e)
File "/base/data/home/runtimes/python27_experiment/python27_lib/versions/third_party/webapp2-2.3/webapp2.py", line 1505, in __call__
Related
I'm trying to deploy code to a server to which I don't have root access. So the solution I was thinking was to deploy using pyinstaller and staticx.
My code runs in python 3.7, in a nutshell, does something like:
import requests
response = requests.get('http://example.com/api/action')
# Do something with the response
When I run it in my environment, even after "building" with pyinstaller and staticx, it works flawlessly.
However, when I try to deploy it (the server is running Red Hat Enterprise Linux Server release 7.4, which does not have python 3), I get:
Traceback (most recent call last):
File "site-packages/urllib3/connection.py", line 160, in _new_conn
File "site-packages/urllib3/util/connection.py", line 57, in create_connection
File "socket.py", line 748, in getaddrinfo
socket.gaierror: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/urllib3/connectionpool.py", line 603, in urlopen
File "site-packages/urllib3/connectionpool.py", line 355, in _make_request
File "http/client.py", line 1229, in request
File "http/client.py", line 1275, in _send_request
File "http/client.py", line 1224, in endheaders
File "http/client.py", line 1016, in _send_output
File "http/client.py", line 956, in send
File "site-packages/urllib3/connection.py", line 183, in connect
File "site-packages/urllib3/connection.py", line 169, in _new_conn
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f912ca96f28>: Failed to establish a new connection: [Errno -2] Name or service not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "site-packages/requests/adapters.py", line 449, in send
File "site-packages/urllib3/connectionpool.py", line 641, in urlopen
File "site-packages/urllib3/util/retry.py", line 399, in increment
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='someserver.com', port=80): Max retries exceeded with url: /api/action (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f912ca96f28>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Everything works if I use IP addresses instead of domains. Unfortunately, it's not a possibility because I have to hit an proxy that uses hosts. Also IP addresses may change in the future.
The server resolves names perfectly fine if I use nslookup or ping.
Any ideas why this could be happening? Any alternatives on how I could deploy my code in a way that it works in the remote server may also be a valid answer. Note however:
I have no root access and requesting the installation of python3, any libs or any other package such as docker, etc would most likely be rejected by my customer
The server can resolve external names, such as google.com but does not have access to the outer internet (the code is ment to work on internal servers, with internal DNS such as someserver.mycustomer.example)
I have created a python script connecting to a Phoenix HBase to analyze some data. I want to set this script up on crontab on a ubuntu server that I have running.
The script is perfectly able to run on my Windows 10 machine. But when I try to use the phoenixdb connector on Ubuntu I get an error on RunTime.
>>> import phoenixdb
>>> url = '<some-url>'
>>> conn = phoenixdb.connect(url, autocommit=True)
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.5/site-packages/phoenixdb/avatica.py", line 156, in connect
self.connection.connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 711, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 702, in create_connection
sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ubuntu/.local/lib/python3.5/site-packages/phoenixdb/__init__.py", line 63, in connect
client.connect()
File "/home/ubuntu/.local/lib/python3.5/site-packages/phoenixdb/avatica.py", line 158, in connect
raise errors.InterfaceError('Unable to connect to the specified service', e)
phoenixdb.errors.InterfaceError: ('Unable to connect to the specified service', TimeoutError(110, 'Connection timed out'), None, None)
I was hoping someone here knows a way to fix this problem?
I am running Python 3.6 on Windows and Python 3.5.2 on Ubuntu, but I doubt that that is the problem.
EDIT:
I have now started a Windows 2012 Server and have tried setting my script up here as well, and it seems not to be a problem solely for Ubuntu. I am getting the exact same error on Windows.
>>> import phoenixdb
>>> url = '<some-url>'
>>> conn = phoenixdb.connect(url, autocommit=True)
Traceback (most recent call last):
File "C:\Users\Administrator\Anaconda3\lib\site-packages\phoenixdb\avatica.py", line 156, in connect
self.connection.connect()
File "C:\Users\Administrator\Anaconda3\lib\http\client.py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "C:\Users\Administrator\Anaconda3\lib\socket.py", line 722, in create_connection raise err
File "C:\Users\Administrator\Anaconda3\lib\socket.py", line 713, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Administrator\Anaconda3\lib\site-packages\phoenixdb\__init__.py", line 63, in connect
client.connect()
File "C:\Users\Administrator\Anaconda3\lib\site-packages\phoenixdb\avatica.py", line 158, in connect
raise errors.InterfaceError('Unable to connect to the specified service', e)
phoenixdb.errors.InterfaceError: ('Unable to connect to the specified service',
TimeoutError(10060, 'A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond', None, 10060, None), None, None)
I recently did format the PC that I developed the script on. The was using this phoenixdb connector, and I did not experience a similar problem on that.
I did also try to install Python 3.6 on the Windows machine (similar to the same python version that I installed on my normal PC - the one I developed the script on).
I'm really lost for finding a solution..
I finally found the problem. It had nothing to do with the machines I set up my script on. It had to do with security settings on the AWS Machines that both the Ubuntu and Windows Servers were.
I ran Python program in Cygwin to connect to AWS, but failed consistently as being timed out. But my connection to AWS using aws cli in Cygwin always works. Also if I run the same python code in Windows, it also works. I have checked all the connection credentials which are the same for all.
Here is the error msg:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/ec2/connection.py", line 585, in get_all_instances
max_results=max_results)
File "/usr/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/ec2/connection.py", line 681, in get_all_reservations
[('item', Reservation)], verb='POST')
File "/usr/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/connection.py", line 1170, in get_list
response = self.make_request(action, params, path, verb)
File "/usr/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/connection.py", line 1116, in make_request
return self._mexe(http_request)
File "/usr/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/connection.py", line 1030, in _mexe
raise ex
socket.error: [Errno 116] Connection timed out
I have found out that the culprit lies in the proxy credentials.
I put HTTP_PROXY and HTTPS_PROXY as Windows Environment Variables. However, when run in Cygwin, boto uses 'http_proxy' to match without considering the case of the word
(see /boto/connection.py(669)handle_proxy()
line 669: if 'http_proxy' in os.environ and not self.proxy:).
When I changed the capital case HTTP_PROXY to lower case http_proxy, then it worked. Not sure why it isn't a problem if I run with Python in Windows.
the motor-blog's source code is here
https://github.com/ajdavis/motor-blog
when i visit the 127.0.0.1:8888
there is a problem
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/tornado-3.2.dev1-py2.7.egg/tornado/web.py", line 1134, in _execute
self._when_complete(self.prepare(), self._execute_method)
File "/Library/Python/2.7/site-packages/tornado-3.2.dev1-py2.7.egg/tornado/web.py", line 1693, in prepare
raise HTTPError(self._status_code)
HTTPError: HTTP 404: Not Found
my systerm is osx 10.8 ,python version is 2.7.5
I think you have to point your browser to 127.0.0.1:8888/blog like #Nisan.H says
I"m trying to get web2py running on an Ubuntu machine. All the docs seem to indicate that to run it on a *nix system, you download the source and do:
python web2py.py
I grabbed the source (stable source, not the trunk, version 1.99.4) and tried the above, but after entering a password for the server I get (in the terminal):
$ python web2py.py
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.99.4 (2011-12-14 14:46:14) stable
Database drivers available: google
Starting hardcron...
WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
please visit:
http://127.0.0.1:8000
starting browser...
failed to create drawable
DEBUG: connect attempt 0, connection error:
Traceback (most recent call last):
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
self._adapter = ADAPTERS[self._dbname](*args)
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
DEBUG: connect attempt 1, connection error:
Traceback (most recent call last):
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
self._adapter = ADAPTERS[self._dbname](*args)
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 2, connection error:
Traceback (most recent call last):
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
self._adapter = ADAPTERS[self._dbname](*args)
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 3, connection error:
Traceback (most recent call last):
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
self._adapter = ADAPTERS[self._dbname](*args)
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
DEBUG: connect attempt 4, connection error:
Traceback (most recent call last):
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 4736, in __init__
self._adapter = ADAPTERS[self._dbname](*args)
File "/home/aparkin/Downloads/web2py/gluon/dal.py", line 1634, in __init__
raise RuntimeError, "Unable to import driver"
RuntimeError: Unable to import driver
And then in the browser I get:
Internal error
Ticket issued: welcome/127.0.0.1.2012-.....[abbreviated]
Any suggestions? I'm running Python 2.7.1+. I've read elsewhere that you also need pyschopg2 installed for web2py to run, and I've confirmed that this is in fact installed as well (I did a sudo apt-get install python-psycopg2 and got "python-psycopg2 is already the newest version").
I just downloaded and web2py runs ok in ubuntu, python 2.7.2+
bruce#vaiubuntu:~/Downloads/web2py$ python web2py.py
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.99.4 (2011-12-14 14:46:14) stable
Database drivers available: SQLite3, pymysql, PostgreSQL
Starting hardcron...
Are you trying to run web2py on appengine environment?
Do you have SQLITE module working ok in your Python?
A possibility is permission issue, your user have permission to write to web2py/* folder?
It looks like a bug in web2py 1.99.4. I was having the same problem using Postgres and psycopg2, but in Windows.
I tried with 1.99.2 and it worked fine.
Actually, the bug seems to be related to the cryptic error message - 1.99.2 gave me the error message that the database doesn't exist, which was easily fixed. 1.99.4 does not mention the missing database. However, when I created the database and tried with 1.99.4, it worked fine.