IBM / ibm-cos-sdk-js

ibm-cos-sdk-js
Apache License 2.0
38 stars 19 forks source link

I get "The specified key does not exist." error when trying to connect using cos-sdk #81

Closed DevAmirreza closed 3 years ago

DevAmirreza commented 3 years ago

Hey team,

import COS from 'ibm-cos-sdk';

var config = {
  endpoint: process.env.COS_ENDPOINT as string,
  apiKeyId: process.env.COS_API_KEY as string,
  serviceInstanceId: process.env.COS_SERVICE_INSTANCE as string
};

const cosService = new COS.S3(config);

export default cosService;

For any operation on cloud object storage, I get this error "The specified key does not exist." , statusCode: 404, Please note that I used this thread to debug and it seems to be the same issue https://github.com/IBM/ibm-cos-sdk-js/issues/26

My instance is: Global My bucket is: Regional & us-east Endpoint using is: s3.us-east.cloud-object-storage.appdomain.cloud version of SDK: 1.6 & 1.9 gives me the same error

I have aligned the region of bucket and endpoint as it was suggested in the thread but still getting the same error.

Please advise.

Thanks Your IBM fellow

Here is the full error log errorLog.txt

nglange commented 3 years ago

Very odd. Can you share a snippet showing a call that results in that error?

As you saw, this is often a misleading error caused by looking for a bucket in the wrong location. If you're sure that your bucket is in us-east then it might be something weirder.

nglange commented 3 years ago

Presumably this error has been fixed, so we'll be closing this ticket shortly. Please feel free to reopen as needed.

IBMeric commented 3 years ago

Closing for inactivity