Closed TopGunBasten closed 6 years ago
The file you were trying to download/modify/access doesn't seem to exist.
It could be that you accidentally entered the wrong name, or that the object you were looking for was never successfully uploaded. Otherwise, it looks like everything is set up properly though.
I need to upload a file to my bucket, I can use listBuckets to get my bucket data. But once I use putObject method to upload a file under my bucket, I got the message "Unhandled error for request POST /api/object-storage/objects: NoSuchKey: The specified key does not exist". So I need to create a file under my bucket And this is the code I used, I upload the file through api and then pass the buffer of the uploaded to body, any incorrect points?
cos.putObject({
Bucket: 's3.gbsqms',
Key: 'hello',
Body: req.files[0].buffer,
},function(err, data) {
cb(err, data);
});
I don't see anything that sticks out. I'd maybe double-check that the region you created the bucket in is the same as the region your current config is tied to.
I'm not sure I'll be able to find anything, but would you mind pasting your cos
constructor/configuration minus apikey/serviceinstanceid/accesskeys?
Those are my credentials
endpoint: "s3-api.dal-us-geo.objectstorage.softlayer.net",
apiKeyId: "uDA5SQ7SBlZa5fOFACdfJM-mAOS1wd2lHhYYL9jjbEor",
serviceInstanceId: "crn:v1:bluemix:public:cloud-object-storage:global:a/3496eff1aa4dc5ce59049e0bb8cbf05e:485ac6b3-4a27-43c6-bda2-c2ac2a0bba45::",
resovle by my self :)
You can't say
resolved by myself
without posting a potential solution for the futur googlers ! :anger:
Just in case you have the same errors, I have solved this passing the stage variable to my lambda.
please use correct region with the corresponding endpoints
i found that the endpoints had been changed. from these
to
auth_endpoint = 'https://iam.bluemix.net/identity/token' service_endpoint = 'https://s3.ap.cloud-object-storage.appdomain.cloud'
how do we contact someone to change / update the course accordingly?
Believe it or not I actually got this error when I incorrectly tried to grab the stream from my LOCAL file, so don't let that fool you.
What's wrong with the error? here is the endpoint and ibmAuthEndpoint endpoint: "s3-api.dal-us-geo.objectstorage.softlayer.net", ibmAuthEndpoint: "https://iam.ng.bluemix.net/oidc/token",