Closed pzbitskiy closed 6 years ago
This only happens with IAM auth. With hmac, the promise finishes correctly. I'm looking into the cause of this.
I am seeing this too...
Looks like it's the preemptive IAM token refresh code: https://github.com/IBM/ibm-cos-sdk-js/blob/master/lib/iam/token_manager.js#L381
We're looking into some fixes. For now it looks like the workaround is to call process.exit()
after the final call.
e.g.:
// es5
doCreateBucket()
.then((res) => console.log('Response: ' + util.inspect(res)))
.catch((err) => console.log('An exception occurred: ' + util.inspect(err)))
.then(() => process.exit(0));
or
// es6
try {
const res = await doCreateBucket();
console.log(`Response: ${res}`);
} catch (err) {
console.log(`An exception occurred: ${err}`);
}
console.log('done');
process.exit(0);
Same story here...
This is resolved in release 1.3.1.
Hello,
I run the following code and the script never finishes (does not return back to shell):
Console output:
So... What's wrong with it?