Skip to content

Assertion Error occurs after fresh reboot, goes away after a few minutes #234

@charliesneath

Description

@charliesneath

[READ] Step 1: Are you in the right place?

  • For issues or feature requests related to the code in this repository
    file a Github issue.
    • If this is a feature request make sure the issue title starts with "FR:".
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Linux raspberrypi 4.14.71+ #1145 Fri Sep 21 15:06:38 BST 2018 armv6l GNU/Linux
  • Firebase SDK version:
Name: firebase-admin
Version: 2.14.0
Summary: Firebase Admin Python SDK
Home-page: https://firebase.google.com/docs/admin/setup/
Author: Firebase
Author-email: UNKNOWN
License: Apache License 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: cachecontrol, google-cloud-firestore, enum34, google-auth, requests, six, google-cloud-storage
Required-by: 
  • Firebase Product: database (auth, database, storage, etc)

[REQUIRED] Step 3: Describe the problem

I get an Assertion Error (pasted below) the first few times when running a script after rebooting my Raspberry Pi Zero W. After a few minutes, the error stops and I can interface with Firebase as expected. The error won't occur again until I reboot the Pi and run my script again.

This is problematic because the error prevents me from successfully running scripts when the Pi connects to wifi.

Steps to reproduce:

Reboot Pi and run script. Wait a few minutes and error doesn't occur.

Relevant Code:

Error output:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions