Closed vegoutha closed 6 years ago
@vegoutha can you confirm that the path exists and that you have sufficient permissions prior to calling download_file. I can only reproduce this error by providing an invalid path.
@Patrick-Browne This is the same code snippet used to download the content during every attempt. If it issue with Permission (or) Path, it should always fail with same error. This issue is observed intermittently.
As per our code, we create the directory /opt/ibm/scoring/python/workdir/batch_input_abe514e7e26c7c8c137e80162fdfdfe8
and this will valid path and it won't have any issues with permission.
But I see it is failing to find some temporary file FileNotFoundError: [Errno 2] No such file or directory: '/opt/ibm/scoring/python/workdir/batch_input_abe514e7e26c7c8c137e80162fdfdfe8/test_/.2f6C9b89'
in some test_
directory. We don't create this test_
directory.
@vegoutha thanks for the update. A couple of questions, how frequently does the error occur ? Do you download to the same path every time ? Does the code download multiple files for each run or a single file per run ?The SDK will not create the test_ directory during the download_file operation. Can you ensure that the full path exists prior the to calling download_file ?
@Patrick-Browne This issue was reported couple of times during internal testing.
Download Path is varying for each download request, but base path remains the same.
Base Path
: /opt/ibm/scoring/python/workdir/
Download Path
: Base Path
+ batch_input_<requestID>
This code will download all the files in the COS bucket( Both Single (or) Multiple files)
I am not sure how this test_
directory. We are checking on this.
@vegoutha were you able to follow up on were 'test_' node in the download path was coming from and ensure that the full path exists before starting the download ?
Hi @vegoutha if there are no further updates, are we okay to close this ticket?
Thanks Barry
@Patrick-Browne this is the code we follow to download the files:
amz = ibm_boto3.resource('s3',
endpoint_url=service_endpoint,
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key)
my_bucket = amz.Bucket(bucket_name)
for object in my_bucket.objects.all():
amz.meta.client.download_file(bucket_name, object.key, download_path+'/'+object.key)
Here download_path
is:
/opt/ibm/scoring/python/workdir/batch_input_abe514e7e26c7c8c137e80162fdfdfe8
I believe test_/
might get added here from object.key
.
We are trying to download the bucket content using IBM BOTO3 and it fails with below error message: FileNotFoundError: [Errno 2] No such file or directory: '/opt/ibm/scoring/python/workdir/batch_inputabe514e7e26c7c8c137e80162fdfdfe8/test/.2f6C9b89'
Here is the detailed exception stack trace:
Installation of IBM BOTO3 using the below command:
Code Snippet: amz = ibm_boto3.resource('s3', endpoint_url=service_endpoint, aws_access_key_id=aws_access_key_id, aws_secret_access_key=aws_secret_access_key)
my_bucket = amz.Bucket(bucket_name) for object in my_bucket.objects.all(): amz.meta.client.download_file(bucket_name, object.key, download_path+'/'+object.key)
This error is observed intermittently. Please have a look into it.