hello. is there a problem with authentication? I have not changed anything, and I am getting unautho
hello. is there a problem with authentication? I have not changed anything, and I am getting unauthorized from both go-sdk and aws cli.


// Size is sent over by the client. It is checked against the maximum allowed file size on the server
const chunkCount = Math.ceil(size / FILE_CHUNK_SIZE_BYTES);
const fileKey = "my/r2/file_key";
const uploadSessionId = "R2_MULTIPART_SESSION_ID";
const presignedUrls = [];
for(let x = 1; x <= chunkCount; x++) {
presignedUrls.push(await r2.getPresignedChunkUrl(fileKey, uploadSessionId, x, (60 * 60 * 24), x < chunkCount ? FILE_CHUNK_SIZE_BYTES : (size % FILE_CHUNK_SIZE_BYTES)));
}async getPresignedChunkUrl(key: string, uploadSessionId: string, partNumber: number, expiresInSec: number, contentLength: number) {
try {
const command = new UploadPartCommand({
Bucket: this.bucket,
Key: key,
UploadId: uploadSessionId,
PartNumber: partNumber,
ContentLength: contentLength
});
return await getSignedUrl(this.client, command, {expiresIn: expiresInSec});
}
catch (e: any) {
console.error(e?.message);
}
return null;
}<Error>
<Code>InternalError</Code>
<Message>We encountered an internal error. Please try again.</Message>
</Error>getSignedUrl(s3, new PutObjectCommand({
Bucket: bucket,
Key: `${fileName}`
}), { expiresIn: 600 })