chairam
chairam

Reputation: 335

Google App Engine Python 2.7 SSL stopped working

The issue: the app worked for years, but it has this error since 2018-nov-9 The code uses SSL to send a notificationa via Apple APNS. It uses a taskqueue to send the notifications.

The error in Stackdrivers is: <class 'socket.error'>: [Errno 11] Resource temporarily unavailable Cloud Tasks is full of tasks that keep retrying.

What I tried: 1- At first I thought that the Apple APNS server may be out of order, so I tried the very same code with the same data on my local machine and it works, so the Apple server works.

2- Then I tried to change the library that I use to send the notifications with one of its fork: https://github.com/djacobs/PyAPNs In locale it works the same way of the other, in App engine it doesen't work, so a different fork makes no difference.

But the error in App engine was more clear:

File "/base/alloc/tmpfs/dynamic_runtimes/python27g/90ff42587f3b5ce/python27/python27_lib/versions/third_party/ssl-2.7.11/ssl.py", line 843, in do_handshake
    self._sslobj.do_handshake()
error: [Errno 11] Resource temporarily unavailable

3- I uploaded the project with a newer installation of the App Engine (ver 220) Everything works (web site, google cloud endpoints, android notifications...) except the notifications to Apple APNS via SSL

In my opinion the problem is connected to the SSL Please help me

Upvotes: 0

Views: 56

Answers (2)

chairam
chairam

Reputation: 335

I contacted the Google support. They found out that the problem was due to a misconfiguration in the socket library of the appengine. They solved the problem, my app got back to work. Everything is fine.

Upvotes: 1

GAEfan
GAEfan

Reputation: 11360

Make sure you are importing the latest version of ssl library in your app.yaml:

libraries:

- name: ssl   
  version: "2.7.11"

Upvotes: 0

Related Questions