gsutilgoogle-cloud-shell

gsutil does not work throwing openssl errors


Running any command with gsutil or issuing gsutil command self causes below error inside the cloud shell terminal.

I have tested it with latest Chrome and Firefox. I have also forcibly restarted the VM

Error:

mati@cloudshell:~ (core-stuff)$ gsutil version
Traceback (most recent call last):
  File "/usr/bin/../lib/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 16, in <module>
    import bootstrapping
  File "/usr/lib/google-cloud-sdk/bin/bootstrapping/bootstrapping.py", line 50, in <module>
    from googlecloudsdk.core.credentials import store as c_store
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/credentials/store.py", line 37, in <module>
    from googlecloudsdk.api_lib.auth import util as auth_util
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/api_lib/auth/util.py", line 37, in <module>
    from googlecloudsdk.core.credentials import google_auth_credentials as c_google_auth
  File "/usr/lib/google-cloud-sdk/lib/googlecloudsdk/core/credentials/google_auth_credentials.py", line 31, in <module>
    from oauth2client import client as oauth2client_client
  File "/usr/lib/google-cloud-sdk/lib/third_party/oauth2client/client.py", line 52, in <module>
    from oauth2client import crypt
  File "/usr/lib/google-cloud-sdk/lib/third_party/oauth2client/crypt.py", line 41, in <module>
    from oauth2client import _openssl_crypt
  File "/usr/lib/google-cloud-sdk/lib/third_party/oauth2client/_openssl_crypt.py", line 16, in <module>
    from OpenSSL import crypto
  File "/home/m_kepa_oecard/.local/lib/python3.9/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/home/m_kepa_oecard/.local/lib/python3.9/site-packages/OpenSSL/crypto.py", line 3268, in <module>
    _lib.OpenSSL_add_all_algorithms()
AttributeError: module 'lib' has no attribute 'OpenSSL_add_all_algorithms'

Solution

  • removing .local/lib folder did the job. Gsutil started to work again

    rm -rf ~/.local/lib 
    

    After issuing gsutil again

    mati@cloudshell:~ (core)$ gsutil version
    gsutil version: 5.17