重新启动后在Raspberry Pi Zero W上运行脚本时,得到以下AssertionError
。几分钟后,该错误停止发生,并且我可以按预期的方式与Firebase数据库进行接口连接。
但是,这仍然是有问题的,因为它阻止了我在设备连接到wifi后立即成功运行脚本。
我也将此问题发布在firebase-admin-python存储库中。
Traceback (most recent call last):
File "/home/pi/weatherbox/48_hour_forecast.py", line 136, in <module>
render_forecast(args.location)
File "/home/pi/weatherbox/48_hour_forecast.py", line 88, in render_forecast
forecast_data_48_hours.append(darksky.get_time_machine_forecast(location, timestamp_today))
File "/home/pi/weatherbox/darksky.py", line 83, in get_time_machine_forecast
coordinates = get_lat_long(location_search)
File "/home/pi/weatherbox/darksky.py", line 16, in get_lat_long
saved_location = saved_location_ref.get()
File "/usr/local/lib/python2.7/dist-packages/firebase_admin/db.py", line 219, in get
return self._client.body('get', self._add_suffix(), params=params)
File "/usr/local/lib/python2.7/dist-packages/firebase_admin/_http_client.py", line 93, in body
resp = self.request(method, url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/firebase_admin/db.py", line 882, in request
return super(_Client, self).request(method, url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/firebase_admin/_http_client.py", line 84, in request
resp = self._session.request(method, self._base_url + url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/google/auth/transport/requests.py", line 198, in request
self._auth_request, method, url, request_headers)
File "/usr/local/lib/python2.7/dist-packages/google/auth/credentials.py", line 122, in before_request
self.refresh(request)
File "/usr/local/lib/python2.7/dist-packages/google/oauth2/service_account.py", line 320, in refresh
assertion = self._make_authorization_grant_assertion()
File "/usr/local/lib/python2.7/dist-packages/google/oauth2/service_account.py", line 314, in _make_authorization_grant_assertion
token = jwt.encode(self._signer, payload)
File "/usr/local/lib/python2.7/dist-packages/google/auth/jwt.py", line 94, in encode
signature = signer.sign(signing_input)
File "/usr/local/lib/python2.7/dist-packages/google/auth/crypt/_cryptography_rsa.py", line 126, in sign
message, _PADDING, _SHA256)
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/rsa.py", line 463, in sign
algorithm, self, data
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/rsa.py", line 241, in _rsa_sig_sign
assert errors[0].lib == backend._lib.ERR_LIB_RSA
AssertionError
答案 0 :(得分:0)
此错误特定于Firebase使用的Python加密权威(PyCA)cryptography
软件包。
有关此问题的更多详细信息:https://github.com/pyca/cryptography/issues/4635
可能的解决方法:https://github.com/firebase/firebase-admin-python/issues/234