Page 2 of 2

Re: Pushbullet Notifications Failing (Ubuntu, v1.1.1 [33a787

Posted: December 12th, 2016, 3:49 pm
by zacharylm
Worked for me!

Re: Pushbullet Notifications Failing (Ubuntu, v1.1.1 [33a787

Posted: December 12th, 2016, 4:04 pm
by jcfp
sander wrote:Good news: I got it working on my Ubuntu 14.04, both standalone and in SAB.
So the underlying problem is in urllib?

Re: Pushbullet Notifications Failing (Ubuntu, v1.1.1 [33a787

Posted: December 12th, 2016, 4:31 pm
by sander
jcfp wrote:
sander wrote:Good news: I got it working on my Ubuntu 14.04, both standalone and in SAB.
So the underlying problem is in urllib?
I believe in ssl.py ... there are monkey-patches to solve that.
And: all solved in python 2.7.9.


And on the other hand: "requests" seems to bring its own 'stack', which seems to be installed via pip, so outside python / ubuntu:

Code: Select all

/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/connection.py
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/request.py
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/response.py
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/retry.py
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/timeout.py
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/url.py
Oh, wait: http://packages.ubuntu.com/trusty/python-requests ... so also a ubuntu python package.

Re: Pushbullet Notifications Failing (Ubuntu, v1.1.1 [33a787

Posted: December 12th, 2016, 5:21 pm
by sander
Ouch: On a plain new Ubuntu 14.04 (in a docker container), even with "requests" I get "_ssl.c:510: EOF occurred in violation of protocol"

sudo docker run -it ubuntu:14.04 /bin/bash

apt-get update
apt-get upgrade
apt-get install python mlocate python-pip nano
pip install requests

Code: Select all

root@481d25f7ad4a:/# python -c "import requests ; res = requests.post('https://api.pushbullet.com/v2/pushes', data='', headers={}) " 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 88, in post
    return request('post', url, data=data, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/api.py", line 44, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 455, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 558, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 385, in send
    raise SSLError(e)
requests.exceptions.SSLError: [Errno 8] _ssl.c:510: EOF occurred in violation of protocol

So ... why does it work on my Ubuntu 14.04 on bare metal?

Re: Pushbullet Notifications Failing (Ubuntu, v1.1.1 [33a787

Posted: December 13th, 2016, 6:02 am
by jcfp
sander wrote:So ... why does it work on my Ubuntu 14.04 on bare metal?
In your latest traceback there's no mention of /usr/local, suggesting trusty's packaged python-request is in use rather than your pip-installed files. Maybe the python path handling is different in the docker install and/or for the root user?

Re: Pushbullet Notifications Failing (Ubuntu, v1.1.1 [33a787

Posted: December 13th, 2016, 7:01 am
by sander
jcfp wrote:
sander wrote:So ... why does it work on my Ubuntu 14.04 on bare metal?
In your latest traceback there's no mention of /usr/local, suggesting trusty's packaged python-request is in use rather than your pip-installed files. Maybe the python path handling is different in the docker install and/or for the root user?
Ah, good suggestion.

And I just discovered installing python-pip also installs python-requests:

Code: Select all

# apt-get install -y python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  python-requests
Recommended packages:
  python-dev-all
The following NEW packages will be installed:
  python-pip python-requests
... so that explains why the plain "requests" is also there, and not only the pip-requests. :-(