xyou365 / AutoRclone

AutoRclone: rclone copy/move/sync (automatically) with thousands of service accounts
https://www.gfan.loan/?p=235
1.36k stars 520 forks source link

AttributeError: 'Http' object has no attribute 'close' #61

Closed Enf0 closed 3 years ago

Enf0 commented 3 years ago

When trying to generate service accounts, I get the following error:

# python3 gen_sa_accounts.py --quick-setup 1
Traceback (most recent call last):
  File "gen_sa_accounts.py", line 311, in <module>
    resp = serviceaccountfactory(
  File "gen_sa_accounts.py", line 178, in serviceaccountfactory
    cloud = build('cloudresourcemanager', 'v1', credentials=creds)
  File "/usr/local/lib/python3.8/dist-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/googleapiclient/discovery.py", line 300, in build
    discovery_http.close()
AttributeError: 'Http' object has no attribute 'close'

Any idea why? Thanks.

gyutw commented 3 years ago

Same for me:

Traceback (most recent call last):
  File "gen_sa_accounts.py", line 311, in <module>
    resp = serviceaccountfactory(
  File "gen_sa_accounts.py", line 178, in serviceaccountfactory
    cloud = build('cloudresourcemanager', 'v1', credentials=creds)
  File "/usr/local/lib/python3.8/dist-packages/googleapiclient/_helpers.py", line 134, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/googleapiclient/discovery.py", line 300, in build
    discovery_http.close()
AttributeError: 'Http' object has no attribute 'close'
Enf0 commented 3 years ago

Seems to be a bug in the lastest version (1.12.2) of googleapis/google-api-python-client according to this and this issue.

I solved it by manually installing 1.12.1 instead: pip3 install google-api-python-client==1.12.1

yohplala commented 3 years ago

Guys, did you update your httplib2 to the last version as well? I have not tested on my side the last google api python client, but I am aware the last version makes use of close() method of http object from httplib2. I don't know when this method was added, but maybe it was not existing with the version of httplib2 you are using. Bests

calvin-dani commented 3 years ago

AttributeError: 'Resource' object has no attribute 'close'.

The problem does persist

xiaoxinshiwo commented 11 months ago

AttributeError: 'Resource' object has no attribute 'close'.

The problem does persist

yes, me too