弹性 beantalk 上的 Firebase Admin SDK 问题

问题描述

简单介绍一下,我使用 Amazon 的 elastic beanstalk 来部署我的 python (Falcon) 应用程序。我有两个弹性 beanstalk 环境(一个是主应用程序服务器,另一个是工作环境)。工作环境接收异步任务的 HTTP 请求,然后执行它们。大多数任务要么是推送通知(移动设备),要么是发送电子邮件。奇怪的是,我的任务因错误而失败,我无法确定原因(这对我的本地环境很好)。一些回溯如下所示:

self.send_message(message=message)
File "/var/app/current/application/services/push.py",line 114,in send_message
response = messaging.send_multicast(message)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/firebase_admin/messaging.py",line 167,in send_multicast
return _get_messaging_service(app).send_all(messages,dry_run)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/firebase_admin/messaging.py",line 390,in send_all
batch.execute()
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/googleapiclient/_helpers.py",line 134,in positional_wrapper
return wrapped(*args,**kwargs)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/googleapiclient/http.py",line 1540,in execute
self._execute(http,self._order,self._requests)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/googleapiclient/http.py",line 1470,in _execute
self._batch_uri,method="POST",body=body,headers=headers
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/google_auth_httplib2.py",line 201,in request
uri,method,headers=request_headers,**kwargs)
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/httplib2/__init__.py",line 1994,in request
cachekey,File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/httplib2/__init__.py",line 1651,in _request
conn,request_uri,body,headers
File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/httplib2/__init__.py",line 1589,in _conn_request
response = conn.getresponse()
File "/usr/lib64/python3.7/http/client.py",line 1369,in getresponse
response.begin()
File "/usr/lib64/python3.7/http/client.py",line 310,in begin
version,status,reason = self._read_status()
File "/usr/lib64/python3.7/http/client.py",line 271,in _read_status
line = str(self.fp.readline(_MAXLINE + 1),"iso-8859-1")
File "/usr/lib64/python3.7/socket.py",line 589,in readinto
return self._sock.recv_into(b)
File "/usr/lib64/python3.7/ssl.py",line 1071,in recv_into
return self.read(nbytes,buffer)
File "/usr/lib64/python3.7/ssl.py",line 929,in read
return self._sslobj.read(len,buffer)
socket.timeout: The read operation timed out
File "/var/app/current/application/services/push.py",line 152,in execute_push
self.send_message(message=message)
File "/var/app/current/application/services/push.py",buffer)
ssl.SSLError: [SSL: UNKNowN_STATE] unkNown state (_ssl.c:2570)
File "/var/app/current/application/services/push.py",line 1618,in _conn_request
content = response.read()
File "/usr/lib64/python3.7/http/client.py",line 468,in read
return self._readall_chunked()
File "/usr/lib64/python3.7/http/client.py",line 575,in _readall_chunked
chunk_left = self._get_chunk_left()
File "/usr/lib64/python3.7/http/client.py",line 563,in _get_chunk_left
self._read_and_discard_trailer()
File "/usr/lib64/python3.7/http/client.py",line 536,in _read_and_discard_trailer
line = self.fp.readline(_MAXLINE + 1)
AttributeError: 'nonetype' object has no attribute 'readline'

其他一些例外如下:

ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2570)
ssl.SSLError: [SSL: DECRYPTION_Failed_OR_BAD_RECORD_MAC] decryption Failed or bad record mac (_ssl.c:2570)
ssl.SSLError: [SSL: BLOCK_CIPHER_PAD_IS_WRONG] block cipher pad is wrong (_ssl.c:2570)

代码如下:

 message = messaging.MulticastMessage(
            tokens=tokens,data=data,notification=messaging.Notification(
                title=title,body=body
            )
        )
response = messaging.send_multicast(message)

这对我来说很奇怪,因为任务失败并因此重试。但不知何故,我收到了多个通知。这意味着正在发送通知但任务正在失败。请帮助我了解可能是什么问题。和系统日期时间有关系吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...