2

I'm trying to make my app engine server send APNS notifications, and for that I'm using template code I got from this project (which is said to work, so it's possible): https://github.com/GarettRogers/appengine-apns-gcm

For now, I want to make this work on my local development.

When getting to actually trying to open the socket, I get the error stack below.

My guess is that maybe app engine needs sudo permissions to do this (I'm using a mac). If so - does anyone know how I can make app engine run with sudo permissions?

If not - can anyone tell me what the problem is and how to fix it?

Thanks.

File "/Users/xxx/Downloads/XXX/ssl.py", line 392, in wrap_socket
ciphers=ciphers) 
File "/Users/xxx/Downloads/XXX/ssl.py", line 114, in __init__
if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM:
File "/Users/xxx/Desktop/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/dist27/socket.py", line 222, in meth
return getattr(self._sock,name)(*args)
INFO     2014-04-15 19:42:02,488 module.py:627] default: "POST /content/create_action HTTP/1.1" 500 228
File "/Users/xxx/Desktop/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/remote_socket/_remote_socket.py", line 1112, in getsockopt
raise _SystemExceptionFromAppError(e)
error: [Errno 13] Permission denied
6
  • Have you enabled billing ? Commented Apr 15, 2014 at 22:43
  • Yes. But again, I need this to run on my dev instance, since I don't want to debug on my prod. As written in the Google AppEngine docs, this should be possible… Commented Apr 16, 2014 at 9:55
  • I missed that, your trying on dev. So just run the dev server from the command line with sudo. Commented Apr 16, 2014 at 10:53
  • Did that - didn't work. Maybe it's something with the connection itself or a flag I need to set? Commented Apr 16, 2014 at 11:09
  • Same problem happening to me with the sample program using flask... Tried to run with admin permissions on windows but got the exact same error when trying to bind the server socket... Commented Apr 24, 2014 at 9:33

2 Answers 2

1

Apply this: "ImportError: No module named _ssl" with dev_appserver.py from Google App Engine

The question/answer explains it all, I won't go into detail, It's a long standing SDK deficiency, this manual method patches it, you need to apply it each time you update the SDK

Sign up to request clarification or add additional context in comments.

Comments

1

I solved this via

pip install requests-toolbelt -t lib

then add

from requests_toolbelt.adapters import appengine
appengine.monkeypatch()

source: Can Python Requests library be used on Google App Engine?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.