diff --git a/src/remoteForS3.ts b/src/remoteForS3.ts index e028888..ddee612 100644 --- a/src/remoteForS3.ts +++ b/src/remoteForS3.ts @@ -509,6 +509,11 @@ export const deleteFromRemote = async ( /** * Check the config of S3 by heading bucket * https://stackoverflow.com/questions/50842835 + * + * Updated on 20240102: + * Users are not always have permission of heading bucket, + * so we need to use listing objects instead... + * * @param s3Client * @param s3Config * @returns @@ -519,9 +524,15 @@ export const checkConnectivity = async ( callbackFunc?: any ) => { try { - const results = await s3Client.send( - new HeadBucketCommand({ Bucket: s3Config.s3BucketName }) - ); + // const results = await s3Client.send( + // new HeadBucketCommand({ Bucket: s3Config.s3BucketName }) + // ); + // very simplified version of listing objects + const confCmd = { + Bucket: s3Config.s3BucketName, + } as ListObjectsV2CommandInput; + const results = await s3Client.send(new ListObjectsV2Command(confCmd)); + if ( results === undefined || results.$metadata === undefined ||