smithy icon indicating copy to clipboard operation
smithy copied to clipboard

Very partial list of errors defined in smithy S3 model

Open guymguym opened this issue 3 years ago • 6 comments

Hi

For context:

  • I am working on this project that uses the S3 model to interact with S3 clients and servers - https://github.com/s3d-rs/s3d.
  • This is a followup from https://github.com/awslabs/smithy-rs/issues/1150.

When I look at the S3 smithy model, I find that it lacks a lot of error definitions for operations. Here is a list of all the operations that have errors defined:

$ node -e 'm=require("./smithy-rs/aws/sdk/aws-models/s3.json"); Object.entries(m.shapes).forEach(([n,s])=>{ if (s.type==="operation" && s.errors) console.log(n, "---", s.errors.map(x=>x.target).join(",")); })'
com.amazonaws.s3#AbortMultipartUpload --- com.amazonaws.s3#NoSuchUpload
com.amazonaws.s3#CopyObject --- com.amazonaws.s3#ObjectNotInActiveTierError
com.amazonaws.s3#CreateBucket --- com.amazonaws.s3#BucketAlreadyExists,com.amazonaws.s3#BucketAlreadyOwnedByYou
com.amazonaws.s3#GetObject --- com.amazonaws.s3#InvalidObjectState,com.amazonaws.s3#NoSuchKey
com.amazonaws.s3#GetObjectAcl --- com.amazonaws.s3#NoSuchKey
com.amazonaws.s3#HeadBucket --- com.amazonaws.s3#NotFound
com.amazonaws.s3#HeadObject --- com.amazonaws.s3#NotFound
com.amazonaws.s3#ListObjects --- com.amazonaws.s3#NoSuchBucket
com.amazonaws.s3#ListObjectsV2 --- com.amazonaws.s3#NoSuchBucket
com.amazonaws.s3#PutObjectAcl --- com.amazonaws.s3#NoSuchKey
com.amazonaws.s3#RestoreObject --- com.amazonaws.s3#ObjectAlreadyInActiveTierError

This is clearly a tiny fraction of the real errors that this API can return. See https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html

Is there a way to contribute to the model definition to make it represent the S3 errors correctly?

Thanks!

guymguym avatar Mar 23 '22 13:03 guymguym

We can raise an issue with the S3 team to fill in missing errors. There's no way to contribute to the models that drive service behavior because they often contain additional information that isn't publicly available.

mtdowling avatar Mar 24 '22 03:03 mtdowling

Thanks @mtdowling !

It would be much appreciated if you can report this request to the service team.

Just to clarify that the incompleteness of the model affects not just server codegen but also any smithy based client sdk's that cannot rely on the real service errors. I hope this is a strong motivation to keep the s3 smithy model up to date.

Will it be possible to keep this issue open for tracking purposes?

Thanks in advance

guymguym avatar Mar 24 '22 11:03 guymguym

Hey any update on this? It's becoming a bit challenging to work with such a limited error set defined for s3...

guymguym avatar Apr 12 '22 18:04 guymguym

Hi @mtdowling would you be able to ask for a rough time estimate on this for me? TIA

guymguym avatar Apr 23 '22 08:04 guymguym

We have reached out to S3 service team. They are looking into it. While we can't provide an exact timeline at this time, we will continue to monitor this request and report back when it is addressed.

gosar avatar Apr 26 '22 19:04 gosar

Thank you @gosar - I really appreciate your update.

guymguym avatar Apr 26 '22 20:04 guymguym

Hi there. Since this is a cross-SDK issue I've created a tracking issue at aws/aws-sdk#376. Please follow that issue for updates instead.

kellertk avatar Oct 19 '22 22:10 kellertk