Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission Denied #127

Closed
iDevo opened this issue Apr 7, 2017 · 5 comments
Closed

Permission Denied #127

iDevo opened this issue Apr 7, 2017 · 5 comments

Comments

@iDevo
Copy link

iDevo commented Apr 7, 2017

Hi there!
I started setting up PyFCM, with the given lines of code in the readme:

    push_service = FCMNotification(api_key="AAAAbMf....")
    registration_id = "emNeRG...."
    message_title = "Uber update"
    message_body = "Hi john, your customized news for today is ready"
    result = push_service.notify_single_device(registration_id=registration_id, message_title=message_title, message_body=message_body)
    print result

The problem is, that this produces a 500 Server Error with the following exception:

File "/Users/GamerXX/Documents/Party/lib/pyfcm/fcm.py", line 86, in notify_single_device
self.send_request([payload])
File "/Users/GamerXX/Documents/Party/lib/pyfcm/baseapi.py", line 174, in send_request
response = requests.post(self.FCM_END_POINT, headers=self.request_headers(), data=payload)
File "/Users/GamerXX/Documents/Party/lib/requests/api.py", line 110, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Users/GamerXX/Documents/Party/lib/requests/api.py", line 56, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/GamerXX/Documents/Party/lib/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/Users/GamerXX/Documents/Party/lib/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/Users/GamerXX/Documents/Party/lib/requests/adapters.py", line 473, in send
raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(13, 'Permission denied'))

I've also downgraded to version 1.2 because I red in another post, that this version might run smoother but that wasn't the trick.

When I'm using Postman to post the exact same content to FCM manually, the request is successful.

Does anyone might have an idea?
Thanks!

@olucurious
Copy link
Owner

@iDevo that's more likely to be an issue with the requests library, I'll suggest you should try to upgrade the requests library

@iDevo
Copy link
Author

iDevo commented Apr 7, 2017

@olucurious thanks for your quick answer! I tried upgrading the requests library but it tells me, that it is already up to date:

pip install requests --upgrade
Requirement already up-to-date: requests in /Library/Python/2.7/site-packages

@olucurious
Copy link
Owner

@iDevo are you using GAE? The issue has been referenced here: https://github.com/kennethreitz/requests/issues/3018

@olucurious
Copy link
Owner

You should try:
pip uninstall requests (2.5.1)
pip install requests==2.3

@iDevo
Copy link
Author

iDevo commented Apr 7, 2017

Thank you so much @olucurious ! That downgrade did the trick!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants