システムPython3.7を使用してmacOSのかなり大きなフォルダでgsutil -m cp -r gs://example/ ./
を実行すると(#961の問題を防ぐため)、次のエラーが多数発生します。
Exception in thread Thread-4:
Traceback (most recent call last):
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/multiprocessing/managers.py", line 788, in _callmethod
conn = self._tls.connection
AttributeError: 'ForkAwareLocal' object has no attribute 'connection'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/platform/gsutil/gslib/command.py", line 2348, in run
cls = copy.copy(class_map[caller_id])
File "<string>", line 2, in __getitem__
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/multiprocessing/managers.py", line 792, in _callmethod
self._connect()
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/multiprocessing/managers.py", line 779, in _connect
conn = self._Client(self._token.address, authkey=self._authkey)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/multiprocessing/connection.py", line 492, in Client
c = SocketClient(address)
File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/multiprocessing/connection.py", line 619, in SocketClient
s.connect(address)
ConnectionRefusedError: [Errno 61] Connection refused
その結果、ダウンロードの最初のバッチを開始した後、コマンドがハングしているように見えます。
OSX 10.15.6、gcloud {308.0.0、297.0.1}、gsutil {4.53、4.51}、python3.7.8でもまったく同じ問題が発生します。
OSX 10.15.7、gcloud 303.0.0、gsutil 4.52、python3.6.5でも同じです
gcloud 317.0.0、python3.7.7でも同じ
これを報告してくれてありがとう! このバグも再現でき、マルチプロセッシングを無効にすると役立つことがわかりました。 これを行うには、boto構成ファイルのGSUtilセクションでparallel_process_count=1
を設定するか、コマンドに次のフラグを追加します: -o "GSUtil:parallel_process_count=1"
。 これによりマルチプロセッシングが無効になりますが、マルチスレッドを有効にする必要があるため、転送を並列化することができます。
この問題は、PR#1107によって脆弱性が残ったMacOSでのマルチプロセッシングに関するより一般的な問題に関連していると思います(https://github.com/GoogleCloudPlatform/gsutil/pull/1107#issuecomment-698555319)。 マルチプロセッシングを無効にしてもこの問題が引き続き発生する場合は、お知らせください。
回避策を提供していただきありがとうございます、それは私のために働きます。
ただし、このツールは冗談です。 297
は、なんらかのパッチを適用しなくてもすぐに使用できるため、単一のバージョンではありません。
-o " GSUtil:parallel_process_count = 1 "の回避策は、Big Sur(macOS 11.2)で機能しますが、これがMacプラットフォームで問題として存続することは私にとって苛立たしいことです。
私にはうまくいきません、私はCommandException: Destination URL must name a directory, bucket, or bucket
subdirectory for the multiple source form of the cp command.
を受け取りますあなたのジョーク製品を修正してください
最も参考になるコメント
-o " GSUtil:parallel_process_count = 1 "の回避策は、Big Sur(macOS 11.2)で機能しますが、これがMacプラットフォームで問題として存続することは私にとって苛立たしいことです。