Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardized error messages for S3 #17000

Closed
wants to merge 1 commit into from

Conversation

ers81239
Copy link

@ers81239 ers81239 commented Jan 6, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

Error messages for S3 objects now contain the S3 bucket name experiencing the error

Output from acceptance testing:

$make testacc TESTARGS='-parallel=5 -run=TestAccAWSS3Bucket_' | tee tests_out.txt
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -parallel=5 -run=TestAccAWSS3Bucket_ -timeout 120m
=== RUN   TestAccAWSS3Bucket_basic
=== PAUSE TestAccAWSS3Bucket_basic
=== RUN   TestAccAWSS3Bucket_Bucket_EmptyString
=== PAUSE TestAccAWSS3Bucket_Bucket_EmptyString
=== RUN   TestAccAWSS3Bucket_tagsWithNoSystemTags
=== PAUSE TestAccAWSS3Bucket_tagsWithNoSystemTags
=== RUN   TestAccAWSS3Bucket_tagsWithSystemTags
=== PAUSE TestAccAWSS3Bucket_tagsWithSystemTags
=== RUN   TestAccAWSS3Bucket_ignoreTags
=== PAUSE TestAccAWSS3Bucket_ignoreTags
=== RUN   TestAccAWSS3Bucket_namePrefix
=== PAUSE TestAccAWSS3Bucket_namePrefix
=== RUN   TestAccAWSS3Bucket_generatedName
=== PAUSE TestAccAWSS3Bucket_generatedName
=== RUN   TestAccAWSS3Bucket_acceleration
=== PAUSE TestAccAWSS3Bucket_acceleration
=== RUN   TestAccAWSS3Bucket_RequestPayer
=== PAUSE TestAccAWSS3Bucket_RequestPayer
=== RUN   TestAccAWSS3Bucket_Policy
=== PAUSE TestAccAWSS3Bucket_Policy
=== RUN   TestAccAWSS3Bucket_UpdateAcl
=== PAUSE TestAccAWSS3Bucket_UpdateAcl
=== RUN   TestAccAWSS3Bucket_UpdateGrant
=== PAUSE TestAccAWSS3Bucket_UpdateGrant
=== RUN   TestAccAWSS3Bucket_AclToGrant
=== PAUSE TestAccAWSS3Bucket_AclToGrant
=== RUN   TestAccAWSS3Bucket_GrantToAcl
=== PAUSE TestAccAWSS3Bucket_GrantToAcl
=== RUN   TestAccAWSS3Bucket_Website_Simple
=== PAUSE TestAccAWSS3Bucket_Website_Simple
=== RUN   TestAccAWSS3Bucket_WebsiteRedirect
=== PAUSE TestAccAWSS3Bucket_WebsiteRedirect
=== RUN   TestAccAWSS3Bucket_WebsiteRoutingRules
=== PAUSE TestAccAWSS3Bucket_WebsiteRoutingRules
=== RUN   TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical
=== PAUSE TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical
=== RUN   TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed
=== PAUSE TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed
=== RUN   TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled
=== PAUSE TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled
=== RUN   TestAccAWSS3Bucket_shouldFailNotFound
=== PAUSE TestAccAWSS3Bucket_shouldFailNotFound
=== RUN   TestAccAWSS3Bucket_Versioning
=== PAUSE TestAccAWSS3Bucket_Versioning
=== RUN   TestAccAWSS3Bucket_Cors_Update
=== PAUSE TestAccAWSS3Bucket_Cors_Update
=== RUN   TestAccAWSS3Bucket_Cors_Delete
=== PAUSE TestAccAWSS3Bucket_Cors_Delete
=== RUN   TestAccAWSS3Bucket_Cors_EmptyOrigin
=== PAUSE TestAccAWSS3Bucket_Cors_EmptyOrigin
=== RUN   TestAccAWSS3Bucket_Logging
=== PAUSE TestAccAWSS3Bucket_Logging
=== RUN   TestAccAWSS3Bucket_LifecycleBasic
=== PAUSE TestAccAWSS3Bucket_LifecycleBasic
=== RUN   TestAccAWSS3Bucket_LifecycleExpireMarkerOnly
=== PAUSE TestAccAWSS3Bucket_LifecycleExpireMarkerOnly
=== RUN   TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock
=== PAUSE TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock
=== RUN   TestAccAWSS3Bucket_LifecycleRule_AbortIncompleteMultipartUploadDays_NoExpiration
=== PAUSE TestAccAWSS3Bucket_LifecycleRule_AbortIncompleteMultipartUploadDays_NoExpiration
=== RUN   TestAccAWSS3Bucket_Replication
=== PAUSE TestAccAWSS3Bucket_Replication
=== RUN   TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation
=== PAUSE TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation
=== RUN   TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation
=== PAUSE TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation
=== RUN   TestAccAWSS3Bucket_ReplicationWithoutStorageClass
=== PAUSE TestAccAWSS3Bucket_ReplicationWithoutStorageClass
=== RUN   TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError
=== PAUSE TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError
=== RUN   TestAccAWSS3Bucket_ReplicationWithoutPrefix
=== PAUSE TestAccAWSS3Bucket_ReplicationWithoutPrefix
=== RUN   TestAccAWSS3Bucket_ReplicationSchemaV2
=== PAUSE TestAccAWSS3Bucket_ReplicationSchemaV2
=== RUN   TestAccAWSS3Bucket_SameRegionReplicationSchemaV2
=== PAUSE TestAccAWSS3Bucket_SameRegionReplicationSchemaV2
=== RUN   TestAccAWSS3Bucket_objectLock
=== PAUSE TestAccAWSS3Bucket_objectLock
=== RUN   TestAccAWSS3Bucket_forceDestroy
=== PAUSE TestAccAWSS3Bucket_forceDestroy
=== RUN   TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes
=== PAUSE TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes
=== RUN   TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled
=== PAUSE TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled
=== CONT  TestAccAWSS3Bucket_basic
=== CONT  TestAccAWSS3Bucket_LifecycleExpireMarkerOnly
=== CONT  TestAccAWSS3Bucket_Website_Simple
=== CONT  TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled
=== CONT  TestAccAWSS3Bucket_acceleration
=== CONT  TestAccAWSS3Bucket_Website_Simple
    resource_aws_s3_bucket_test.go:760: Step 3/4 error: After applying this test step, the plan was not empty.
        stdout:


        An execution plan has been generated and is shown below.
        Resource actions are indicated with the following symbols:
          ~ update in-place

        Terraform will perform the following actions:

          # aws_s3_bucket.bucket will be updated in-place
          ~ resource "aws_s3_bucket" "bucket" {
                id                          = "tf-test-bucket-5712525593669235051"
                tags                        = {}
                # (11 unchanged attributes hidden)


              ~ website {
                  + error_document = "error.html"
                    # (1 unchanged attribute hidden)
                }
                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
=== CONT  TestAccAWSS3Bucket_LifecycleExpireMarkerOnly
    resource_aws_s3_bucket_test.go:1356: Step 3/3 error: After applying this test step, the plan was not empty.
        stdout:


        An execution plan has been generated and is shown below.
        Resource actions are indicated with the following symbols:
          ~ update in-place

        Terraform will perform the following actions:

          # aws_s3_bucket.bucket will be updated in-place
          ~ resource "aws_s3_bucket" "bucket" {
                id                          = "tf-test-bucket-1210721156535621711"
                tags                        = {}
                # (9 unchanged attributes hidden)

              - lifecycle_rule {
                  - abort_incomplete_multipart_upload_days = 0 -> null
                  - enabled                                = true -> null
                  - id                                     = "id1" -> null
                  - prefix                                 = "path1/" -> null
                  - tags                                   = {} -> null

                  - expiration {
                      - days                         = 0 -> null
                      - expired_object_delete_marker = true -> null
                    }
                }

                # (1 unchanged block hidden)
            }

        Plan: 0 to add, 1 to change, 0 to destroy.
--- PASS: TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled (23.38s)
=== CONT  TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes
--- PASS: TestAccAWSS3Bucket_basic (23.78s)
=== CONT  TestAccAWSS3Bucket_forceDestroy
--- FAIL: TestAccAWSS3Bucket_Website_Simple (24.05s)
=== CONT  TestAccAWSS3Bucket_LifecycleBasic
--- FAIL: TestAccAWSS3Bucket_LifecycleExpireMarkerOnly (28.21s)
=== CONT  TestAccAWSS3Bucket_Logging
--- PASS: TestAccAWSS3Bucket_acceleration (28.85s)
=== CONT  TestAccAWSS3Bucket_Cors_EmptyOrigin
--- PASS: TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes (12.83s)
=== CONT  TestAccAWSS3Bucket_Cors_Delete
--- PASS: TestAccAWSS3Bucket_forceDestroy (14.85s)
=== CONT  TestAccAWSS3Bucket_Cors_Update
--- PASS: TestAccAWSS3Bucket_Cors_EmptyOrigin (17.02s)
=== CONT  TestAccAWSS3Bucket_objectLock
--- PASS: TestAccAWSS3Bucket_Logging (19.12s)
=== CONT  TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation
--- PASS: TestAccAWSS3Bucket_Cors_Delete (11.31s)
=== CONT  TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation
--- PASS: TestAccAWSS3Bucket_LifecycleBasic (37.10s)
=== CONT  TestAccAWSS3Bucket_Versioning
--- PASS: TestAccAWSS3Bucket_Cors_Update (25.45s)
=== CONT  TestAccAWSS3Bucket_Replication
--- PASS: TestAccAWSS3Bucket_objectLock (29.71s)
=== CONT  TestAccAWSS3Bucket_LifecycleRule_AbortIncompleteMultipartUploadDays_NoExpiration
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation (42.30s)
=== CONT  TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock
--- PASS: TestAccAWSS3Bucket_LifecycleRule_AbortIncompleteMultipartUploadDays_NoExpiration (14.90s)
=== CONT  TestAccAWSS3Bucket_ignoreTags
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (44.81s)
=== CONT  TestAccAWSS3Bucket_shouldFailNotFound
--- PASS: TestAccAWSS3Bucket_Versioning (41.20s)
=== CONT  TestAccAWSS3Bucket_generatedName
--- PASS: TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock (12.93s)
=== CONT  TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled
--- PASS: TestAccAWSS3Bucket_ignoreTags (24.27s)
=== CONT  TestAccAWSS3Bucket_namePrefix
--- PASS: TestAccAWSS3Bucket_generatedName (21.62s)
=== CONT  TestAccAWSS3Bucket_WebsiteRoutingRules
--- PASS: TestAccAWSS3Bucket_namePrefix (15.21s)
=== CONT  TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical
=== CONT  TestAccAWSS3Bucket_WebsiteRedirect
--- PASS: TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled (27.44s)
--- PASS: TestAccAWSS3Bucket_Replication (81.64s)
=== CONT  TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical (18.66s)
=== CONT  TestAccAWSS3Bucket_tagsWithNoSystemTags
--- PASS: TestAccAWSS3Bucket_WebsiteRoutingRules (31.63s)
=== CONT  TestAccAWSS3Bucket_tagsWithSystemTags
--- PASS: TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed (14.78s)
=== CONT  TestAccAWSS3Bucket_Bucket_EmptyString
--- PASS: TestAccAWSS3Bucket_WebsiteRedirect (42.10s)
=== CONT  TestAccAWSS3Bucket_UpdateGrant
--- PASS: TestAccAWSS3Bucket_Bucket_EmptyString (15.64s)
=== CONT  TestAccAWSS3Bucket_GrantToAcl
--- PASS: TestAccAWSS3Bucket_GrantToAcl (23.62s)
=== CONT  TestAccAWSS3Bucket_ReplicationWithoutStorageClass
--- PASS: TestAccAWSS3Bucket_tagsWithNoSystemTags (52.95s)
=== CONT  TestAccAWSS3Bucket_SameRegionReplicationSchemaV2
--- PASS: TestAccAWSS3Bucket_UpdateGrant (38.97s)
=== CONT  TestAccAWSS3Bucket_Policy
=== CONT  TestAccAWSS3Bucket_shouldFailNotFound
    resource_aws_s3_bucket_test.go:993: Step 1/1 error: Error running post-apply refresh:
        Error: Error getting CORS configuration for S3 bucket (tf-test-bucket-7596454283406578608): NoSuchBucket: The specified bucket does not exist
        	status code: 404, request id: FEEA2B33C7597F43, host id: yEYrgY5/dnyyClFeukBFLZnkvnkHPwk8epepdzcLnTAS5mTKJTiSF0G3pZTjfqhZeNzO32f8XVQ=


--- FAIL: TestAccAWSS3Bucket_shouldFailNotFound (128.85s)
=== CONT  TestAccAWSS3Bucket_UpdateAcl
--- PASS: TestAccAWSS3Bucket_SameRegionReplicationSchemaV2 (21.03s)
=== CONT  TestAccAWSS3Bucket_AclToGrant
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (23.18s)
=== CONT  TestAccAWSS3Bucket_RequestPayer
--- PASS: TestAccAWSS3Bucket_UpdateAcl (23.78s)
=== CONT  TestAccAWSS3Bucket_ReplicationSchemaV2
--- PASS: TestAccAWSS3Bucket_AclToGrant (23.30s)
=== CONT  TestAccAWSS3Bucket_ReplicationWithoutPrefix
--- PASS: TestAccAWSS3Bucket_Policy (36.68s)
=== CONT  TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError
--- PASS: TestAccAWSS3Bucket_RequestPayer (25.88s)
--- PASS: TestAccAWSS3Bucket_tagsWithSystemTags (95.87s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (9.15s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (26.19s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (76.31s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	323.182s
FAIL
make: *** [testacc] Error 1

...

@ers81239 ers81239 requested a review from a team as a code owner January 6, 2021 18:00
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/s3 Issues and PRs that pertain to the s3 service. labels Jan 6, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 6, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @ers81239 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

Base automatically changed from master to main January 23, 2021 01:00
@breathingdust breathingdust added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 16, 2021
@zhelding
Copy link
Contributor

Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding.

Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single aws directory to a large number of separate directories in internal/service, each corresponding to a particular AWS service. This separation of code has also allowed for us to simplify the names of underlying functions -- while still avoiding namespace collisions.

We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author.

For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000.

For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide.

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/s3 Issues and PRs that pertain to the s3 service. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants