Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix big_query.py google api import error #5482

Conversation

case-k-git
Copy link
Contributor

@case-k-git case-k-git commented Apr 24, 2021

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • New Query Runner (Data Source)
  • New Alert Destination
  • Other

Description

when executed bigquery job i have got this errror in redash worker

[2021-04-24 13:12:27,421][PID:123][WARNING][googleapiclient.discovery_cache] file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/__init__.py", line 36, in autodetect
    from google.appengine.api import memcache
ModuleNotFoundError: No module named 'google.appengine'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py", line 33, in <module>
    from oauth2client.contrib.locked_file import LockedFile
ModuleNotFoundError: No module named 'oauth2client.contrib.locked_file'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py", line 37, in <module>
    from oauth2client.locked_file import LockedFile
ModuleNotFoundError: No module named 'oauth2client.locked_file'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/__init__.py", line 41, in autodetect
    from . import file_cache
  File "/usr/local/lib/python3.7/site-packages/googleapiclient/discovery_cache/file_cache.py", line 41, in <module>
    'file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth')
ImportError: file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth

i have found the issue and add cache_discovery=False options to avoid this error notice. pleas check it

docker logs -f redash_worker_1

googleapis/google-api-python-client#325

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

Copy link
Contributor

@susodapop susodapop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Strange that we've haven't seen bugs around this in the past. Our oauthclient has been pinned above v4.0.0 for more than two years.

@arikfr arikfr merged commit e62de4e into getredash:master May 14, 2021
lotreal added a commit to lotreal/redash that referenced this pull request Jun 22, 2021
* master:
  remove redundant fields from slack alert destination (getredash#5514)
  README.md: Add TiDB to the Supported Data Sources (getredash#5477)
  Refine Dockerfile caching (getredash#5484)
  fix big_query.py google api import error (getredash#5482)
  Use the correct rq connection in `get_queues_status` (getredash#5491)
  Fixing failure report rendering (getredash#5492)
  SFS-001: Adding support for the optional host connection property (getredash#5490)
  Expire sessions after 6 hours of inactivity (getredash#5159)
  use ptpython instead of standard python shell (getredash#5483)
  Adds rate limit to /forgot. (getredash#5425)
  Athena: skip tables with no StorageDescriptor (getredash#5447)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants