abundant-furniture-62668
11/20/2022, 7:53 PMbotocore.exceptions.NoCredentialsError: Unable to locate credentials . This happens only if I run with --max-workers >1 but with --max-workers 1 all seems to work fine but that is not desirable for my use case. Can someone please help on this front?abundant-furniture-62668
11/20/2022, 8:58 PMabundant-furniture-62668
11/20/2022, 9:00 PM2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] Error with S3 operation: Traceback (most recent call last):
2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/metaflow/datatools/s3op.py", line 224, in worker
2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] s3.upload_file(url.local, url.bucket, url.path, ExtraArgs=extra)
2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/boto3/s3/inject.py", line 129, in upload_file
2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] return transfer.upload_file(
2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/boto3/s3/transfer.py", line 279, in upload_file
2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] future.result()
2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/futures.py", line 106, in result
2022-11-20 20:52:42.182 [42847/generate_upload_arr/6402925 (pid 22958)] return self._coordinator.result()
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/futures.py", line 265, in result
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] raise self._exception
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/tasks.py", line 126, in __call__
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] return self._execute_main(kwargs)
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/tasks.py", line 150, in _execute_main
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] return_value = self._main(**kwargs)
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/upload.py", line 694, in _main
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] client.put_object(Bucket=bucket, Key=key, Body=body, **extra_args)
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/client.py", line 357, in _api_call
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] return self._make_api_call(operation_name, kwargs)
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/client.py", line 662, in _make_api_call
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] http, parsed_response = self._make_request(
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/client.py", line 682, in _make_request
2022-11-20 20:52:42.183 [42847/generate_upload_arr/6402925 (pid 22958)] return self._endpoint.make_request(operation_model, request_dict)
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/endpoint.py", line 102, in make_request
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] return self._send_request(request_dict, operation_model)
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/endpoint.py", line 132, in _send_request
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] request = self.create_request(request_dict, operation_model)
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/endpoint.py", line 115, in create_request
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] self._event_emitter.emit(event_name, request=request,
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/hooks.py", line 356, in emit
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] return self._emitter.emit(aliased_event_name, **kwargs)
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/hooks.py", line 228, in emit
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] return self._emit(event_name, kwargs)
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/hooks.py", line 211, in _emit
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] response = handler(**kwargs)
2022-11-20 20:52:42.184 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/signers.py", line 90, in handler
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] return self.sign(operation_name, request)
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/signers.py", line 162, in sign
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] auth.add_auth(request)
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/auth.py", line 373, in add_auth
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] raise NoCredentialsError()
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] botocore.exceptions.NoCredentialsError: Unable to locate credentials
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] Traceback (most recent call last):
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/metaflow/datatools/s3op.py", line 224, in worker
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] s3.upload_file(url.local, url.bucket, url.path, ExtraArgs=extra)
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/boto3/s3/inject.py", line 129, in upload_file
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] return transfer.upload_file(
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/boto3/s3/transfer.py", line 279, in upload_file
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] future.result()
2022-11-20 20:52:42.185 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/futures.py", line 106, in result
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] return self._coordinator.result()
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/futures.py", line 265, in result
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] raise self._exception
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/tasks.py", line 126, in __call__
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] return self._execute_main(kwargs)
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/tasks.py", line 150, in _execute_main
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] return_value = self._main(**kwargs)
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/s3transfer/upload.py", line 694, in _main
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] client.put_object(Bucket=bucket, Key=key, Body=body, **extra_args)
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/client.py", line 357, in _api_call
2022-11-20 20:52:42.186 [42847/generate_upload_arr/6402925 (pid 22958)] return self._make_api_call(operation_name, kwargs)
2022-11-20 20:52:48.301 [42847/generate_upload_arr/6402927 (pid 22407)] nest_0_flight_30105
2022-11-20 20:53:39.730 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/client.py", line 662, in _make_api_call
2022-11-20 20:53:39.730 [42847/generate_upload_arr/6402925 (pid 22958)] http, parsed_response = self._make_request(
2022-11-20 20:53:39.730 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/client.py", line 682, in _make_request
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] return self._endpoint.make_request(operation_model, request_dict)
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/endpoint.py", line 102, in make_request
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] return self._send_request(request_dict, operation_model)
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/endpoint.py", line 132, in _send_request
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] request = self.create_request(request_dict, operation_model)
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/endpoint.py", line 115, in create_request
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] self._event_emitter.emit(event_name, request=request,
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/hooks.py", line 356, in emit
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] return self._emitter.emit(aliased_event_name, **kwargs)
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/hooks.py", line 228, in emit
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] return self._emit(event_name, kwargs)
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/hooks.py", line 211, in _emit
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] response = handler(**kwargs)
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/signers.py", line 90, in handler
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] return self.sign(operation_name, request)
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/signers.py", line 162, in sign
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] auth.add_auth(request)
2022-11-20 20:53:39.731 [42847/generate_upload_arr/6402925 (pid 22958)] File "/opt/conda/lib/python3.8/site-packages/botocore/auth.py", line 373, in add_auth
2022-11-20 20:53:39.732 [42847/generate_upload_arr/6402925 (pid 22958)] raise NoCredentialsError()
2022-11-20 20:53:39.732 [42847/generate_upload_arr/6402925 (pid 22958)] botocore.exceptions.NoCredentialsError: Unable to locate credentials
2022-11-20 20:53:39.732 [42847/generate_upload_arr/6402925 (pid 22958)] s3op failed:
2022-11-20 20:53:39.732 [42847/generate_upload_arr/6402925 (pid 22958)] Unknown error
2022-11-20 20:53:39.732 [42847/generate_upload_arr/6402925 (pid 22958)] Worker process failed (exit code 8)abundant-furniture-62668
11/20/2022, 9:02 PMmetaflow 2.5.3straight-shampoo-11124
11/21/2022, 5:12 PMstraight-shampoo-11124
11/21/2022, 5:12 PMabundant-furniture-62668
11/21/2022, 5:14 PMstraight-shampoo-11124
11/21/2022, 5:22 PMabundant-furniture-62668
11/21/2022, 5:25 PMg5-48xlarge-1abundant-furniture-62668
11/21/2022, 5:30 PMabundant-furniture-62668
11/21/2022, 5:52 PMit seems that your credentials provider doesn't like too many concurrent requests for some reasonshouldn't it have produced some
large request rate error or something, instead of NoCredentialsFound ?abundant-furniture-62668
11/21/2022, 7:18 PMabundant-furniture-62668
11/21/2022, 7:19 PMstraight-shampoo-11124
11/21/2022, 7:37 PM--max-workers 2 or is it sporadic?straight-shampoo-11124
11/21/2022, 7:38 PMabundant-furniture-62668
11/21/2022, 7:40 PMIs it so that it fails immediately withIt fails bit sporadically. It works well for a while but then it crashes with above error stackor is it sporadic?--max-workers 2
abundant-furniture-62668
11/21/2022, 7:42 PMI presume you don't have any special AWS configuration but you are just relying on instance metadata for credentials?Yes, I can configure rolling credentials but they would expire before the flow finishes.
straight-shampoo-11124
11/21/2022, 7:45 PMabundant-furniture-62668
11/21/2022, 7:46 PMstraight-shampoo-11124
11/21/2022, 7:46 PMg5-48xlarge-1 too or some other types?straight-shampoo-11124
11/21/2022, 7:47 PMabundant-furniture-62668
11/21/2022, 7:50 PMwere theyNope, I tried that on a single GPU machine with 48GB RAM.too or some other types?g5-48xlarge-1
abundant-furniture-62668
11/21/2022, 7:57 PMwhat you are trying to do seems totally typical and standard, so I am trying to figure out what's special about your situation that makes it faiI am totally puzzled here too. We have flows that takes about 24 hours and they are constantly upload and fetch data using S3 api. Not sure what's happening here. The only big difference here is that we are looking to upload a much higher number of files at a time.
abundant-furniture-62668
11/21/2022, 7:57 PMstraight-shampoo-11124
11/21/2022, 8:20 PMForeachFlow listed here and see if you get errors with --max-workers=2 ?abundant-furniture-62668
11/21/2022, 8:26 PMs3 API call in the stepstraight-shampoo-11124
11/21/2022, 8:49 PM--max-workers=2 flawlessly?abundant-furniture-62668
11/21/2022, 8:52 PMstraight-shampoo-11124
11/21/2022, 8:56 PMstraight-shampoo-11124
11/21/2022, 8:56 PMmetaflow.S3 explicitly or just many self. artifacts?abundant-furniture-62668
11/21/2022, 8:59 PMstraight-shampoo-11124
11/21/2022, 11:24 PMstraight-shampoo-11124
11/21/2022, 11:24 PMbotocore.exceptions.NoCredentialsError: Unable to locate credentials during your explorations?dry-beach-38304
11/21/2022, 11:27 PMdry-beach-38304
11/21/2022, 11:37 PMabundant-furniture-62668
11/21/2022, 11:37 PM1.24.87dry-beach-38304
11/21/2022, 11:43 PMAWS_METADATA_SERVICE_NUM_ATTEMPTS to increase the number of times boto will try to get the credentials. I was just googling around and found this: https://github.com/boto/botocore/issues/2117 but as @victorious-lawyer-58417 points out, this is usually a problem for small instances so it is a bit weird that it is hitting you here.dry-beach-38304
11/21/2022, 11:45 PMabundant-furniture-62668
11/21/2022, 11:50 PMstraight-shampoo-11124
11/22/2022, 12:07 AMS3.put_files or S3.put_many call that uploads 1000s of files?abundant-furniture-62668
11/22/2022, 12:08 AMs3.put_filesvictorious-lawyer-58417
11/22/2022, 12:11 AMs3.put_files is inside some foreach task, so many put_files get executed in parallel if you do --max-workers=2 or higher, right?abundant-furniture-62668
11/22/2022, 12:12 AMvictorious-lawyer-58417
11/22/2022, 12:12 AMdry-beach-38304
11/22/2022, 12:14 AMvictorious-lawyer-58417
11/22/2022, 12:15 AMvictorious-lawyer-58417
11/22/2022, 12:15 AMdry-beach-38304
11/22/2022, 12:16 AMdry-beach-38304
11/22/2022, 12:17 AMstraight-shampoo-11124
11/22/2022, 12:18 AM--max-workers=X and K is the number of parallel s3op workers which is enough to overwhelm instance metadatadry-beach-38304
11/22/2022, 12:18 AMstraight-shampoo-11124
11/22/2022, 12:19 AMstraight-shampoo-11124
11/22/2022, 12:20 AMput_files calls so that instead of uploading all files at once, upload e.g. 100 files at a time and then sleep for a few seconds (randomly) between calls to avoid overwhelming the instance
another option is to distribute processing over multiple instances with @batch or @kubernetes which may help a bitabundant-furniture-62668
11/22/2022, 12:22 AMstraight-shampoo-11124
11/22/2022, 12:26 AMabundant-furniture-62668
11/22/2022, 12:29 AM