-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
file_cache is unavailable when using oauth2client >= 4.0.0 #299
Comments
You can silence this the same way you can silence any other log using the standard library logging infrastructure:
|
Of course you can! I apologize, I blame the lack of coffee for my ignorance. |
No worries. :) |
Are we sure that this is that simple? I have a project that I'm getting reports of seizing/crashing/weirdness with and I'm seeing these all over the log (no other issues):
These are ImportErrors, not just mere log verbosity. Thoughts? |
It's worth mentioning that my version reference to google-api-python-client hasn't changed in over 2.5 years. I can't fathom why I haven't seen this error before and why it appears to be an issue now. But, it does appear to be an exception which must be disrupting something whether it's specifically related to my user's issue or something silent from the logs is responsible for that. |
@dsoprea if you silence the logs as above, do you still see the stacktrace? |
@jonparrott I've asked. Thanks. |
I apologize to comment on closed issue, but is there any performance penalty when the file_cache is not used with oauth2client 4.0.0? I.e. should I keep the oauth2client 3.0.0 or may I safely upgrade and ignore the warning? Thanks. |
It seems to be the better way to silence this error, if one does not care about the cache, is to simply specify cache_discovery=False when performing discovery.build() -- this avoids the broken code path. |
"file_cache is unavailable when using oauth2client >= 4.0.0" errors as hinted in googleapis/google-api-python-client#299 (comment)
maxrp solution worked (python3.6) for most logging message: but I also needed to set the logging level of the googleapiclient.discovery using jonparrott proposition: |
jonparrott's answer almost worked for me.... you just have to fix the typo: import logging |
* kfctl: existing_arrikto: initial e2e test Signed-off-by: Yannis Zarkadas <[email protected]> * fix deployment name and review comment Signed-off-by: Yannis Zarkadas <[email protected]> * fix bad syntax with extend Signed-off-by: Yannis Zarkadas <[email protected]> * increase timeout for service ip discovery Signed-off-by: Yannis Zarkadas <[email protected]> * update deployments to reflect latest manifests Signed-off-by: Yannis Zarkadas <[email protected]> * skip knative for existing_arrikto Signed-off-by: Yannis Zarkadas <[email protected]> * bump machine size and increase timeout Signed-off-by: Yannis Zarkadas <[email protected]> * python script: fix error in delete step Related: googleapis/google-api-python-client#299 Signed-off-by: Yannis Zarkadas <[email protected]> * be more conservative in adding new test Signed-off-by: Yannis Zarkadas <[email protected]> * revert checklist Signed-off-by: Yannis Zarkadas <[email protected]>
* kfctl: existing_arrikto: initial e2e test Signed-off-by: Yannis Zarkadas <[email protected]> * fix deployment name and review comment Signed-off-by: Yannis Zarkadas <[email protected]> * fix bad syntax with extend Signed-off-by: Yannis Zarkadas <[email protected]> * increase timeout for service ip discovery Signed-off-by: Yannis Zarkadas <[email protected]> * update deployments to reflect latest manifests Signed-off-by: Yannis Zarkadas <[email protected]> * skip knative for existing_arrikto Signed-off-by: Yannis Zarkadas <[email protected]> * bump machine size and increase timeout Signed-off-by: Yannis Zarkadas <[email protected]> * python script: fix error in delete step Related: googleapis/google-api-python-client#299 Signed-off-by: Yannis Zarkadas <[email protected]> * be more conservative in adding new test Signed-off-by: Yannis Zarkadas <[email protected]> * revert checklist Signed-off-by: Yannis Zarkadas <[email protected]>
to suppress errors in logs: file_cache is unavailable when using oauth2client >= 4.0.0 googleapis/google-api-python-client#299 googleapis/google-api-python-client#325
Cache discovery seems broken atm, disable it to suppress python import errors. See googleapis/google-api-python-client#299
file_cache is only supported with oauth2client<4.0.0 |
init: file_cache is only supported with oauth2client<4.0.0 Still getting error. |
Still... still getting this error |
Same.. please fix. Tuning down error log messages is a workaround rather than a fix. |
For anyone landing on this issue in 2023, maxrp's solution from 2016 still works, setting from googleapiclient.discovery import build
client = build('drive', 'v3', cache_discovery=False) |
* This disables the following warning produced by `googleapiclient` WARNING:googleapiclient.discovery_cache:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth * googleapis/google-api-python-client#299
* Remove locked `google-auth` version * This helps resolve the ResolutionImpossible error while installing packages from requirements.txt on Python 3.11 * Change runtime to `python311` * Remove `libraries` entry from `app.yaml` * Update `Jinja2` package for compatibility * Enable legacy bundled services on Python3 runtime * https://cloud.google.com/appengine/docs/standard/python3/services/access * Drop `lib` dir * Point `gae-sessions` to `python3-compat` branch * Remove no longer supported fields from `app.yaml` * https://cloud.google.com/appengine/docs/standard/python3/migrate-to-python3/config-files * Remove `threadsafe` entry from `app.yaml` * All apps are presumed to be threadsafe in Python3 runtime * https://cloud.google.com/appengine/docs/standard/python3/migrate-to-python3/config-files * Replace `handlers: script` value w/ `auto` * https://cloud.google.com/appengine/docs/standard/python3/migrate-to-python3/config-files#python-3 * Remove `env_variables` section from `app.yaml` * The `DJANGO_SETTINGS_MODULE` env variable had to be set to the name of the Django settings module, typically 'settings', before packages got imported back on the legacy Python2 runtime * https://cloud.google.com/appengine/docs/legacy/standard/python/tools/using-libraries-python-27#django * Remove ignored `appengine_config.py` * https://cloud.google.com/appengine/migration-center/standard/migrate-to-second-gen/python-differences#configuration * Replaced w/ a call to `wrap_wsgi_app` * The new `wrap_wsgi_middleware` decorator is created to configure `SessionMiddleware` * Replace `CURRENT_VERSION_ID` w/ `GAE_VERSION` * `GAE_VERSION` holds the current version label of the service * https://cloud.google.com/appengine/docs/standard/python3/runtime#environment_variables * Determine environment using `GAE_ENV` variable * Update `ae_helpers` * Disable "file_cache is unavailable" warning * This disables the following warning produced by `googleapiclient` WARNING:googleapiclient.discovery_cache:file_cache is unavailable when using oauth2client >= 4.0.0 or google-auth * googleapis/google-api-python-client#299 * Add `.gcloudignore`
This is related to #294
After upgrading google-api-python-client and oauth2client I get:
I know that it was added to add oauth2client support (which I appreciate) and from what I can see doesn't actually abort any action - but would it be possible to remove the WARNING as well - or is it meant as a future todo?
It's not a huge issue, but possibly confusing to others - not to mention my eyes stopping at it every time I view any logs or monitoring.
The text was updated successfully, but these errors were encountered: