community icon indicating copy to clipboard operation
community copied to clipboard

S3 controller - cryptic error message

Open gecube opened this issue 2 years ago • 4 comments

Hi!

When I am creating bucket like:

apiVersion: s3.services.k8s.aws/v1alpha1
kind: Bucket
metadata:
  name: test-rec
spec:
  name: test-rec
  logging:
    loggingEnabled:
      targetBucket: "test-rec-access"
      targetPrefix: "test-"
  objectLockEnabledForBucket: true

I am getting the next cryptic error message in controller:

  conditions:
    - message: "Error syncing property 'Versioningc': InvalidBucketState: An Object Lock configuration is present on this bucket, so the versioning state cannot be changed.\n\tstatus code: 409, request id: CEPWE7F806XMFF57, host id: o7n5o/9dqirQcSILbyRpbUBkknyZPIX//Io9SG9bdqaCzl+k8S/9aG0y8B3pp7Iuobdc7VMaD/s="
      status: 'True'
      type: ACK.Recoverable
    - lastTransitionTime: '2023-08-09T09:18:37Z'
      message: >-
        Unable to determine if desired resource state matches latest observed
        state
      reason: "Error syncing property 'Versioningc': InvalidBucketState: An Object Lock configuration is present on this bucket, so the versioning state cannot be changed.\n\tstatus code: 409, request id: CEPWE7F806XMFF57, host id: o7n5o/9dqirQcSILbyRpbUBkknyZPIX//Io9SG9bdqaCzl+k8S/9aG0y8B3pp7Iuobdc7VMaD/s="
      status: Unknown
      type: ACK.ResourceSynced

and bucket never goes to ACK.ResourceSynced state

Desired behaviour:

  1. correct error message, I think there is no property like Versioningc
  2. If there are default settings - make them explicit
  3. don't throw error as objectLockEnabledForBucket already suppose some versioning config. Otherwise - implement admission that will force compliant settings between different keys.

gecube avatar Aug 09 '23 09:08 gecube

The Versioningc is just a typo in the error message code - https://github.com/aws-controllers-k8s/s3-controller/blob/e0addd656d76730fbf0eac428e29f4520b0525ba/pkg/resource/bucket/hook.go#L279

This error message only happens when the code attempts to update versioning or replication settings for the bucket. Are you modifying either of these settings in your spec? Otherwise it may be an issue with the controller detecting a diff in the versioning part of the S3 response

RedbackThomson avatar Aug 15 '23 18:08 RedbackThomson

@RedbackThomson Hi! More details: I did not changed both fields in the S3 object definition.

gecube avatar Aug 16 '23 05:08 gecube

Issues go stale after 180d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 60d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://github.com/aws-controllers-k8s/community. /lifecycle stale

ack-bot avatar Feb 12 '24 07:02 ack-bot

/remove-lifecycle stale

gecube avatar Feb 12 '24 07:02 gecube

Issues go stale after 180d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 60d of inactivity and eventually close. If this issue is safe to close now please do so with /close. Provide feedback via https://github.com/aws-controllers-k8s/community. /lifecycle stale

ack-bot avatar Aug 10 '24 08:08 ack-bot

/remove-lifecycle stale

gecube avatar Aug 10 '24 10:08 gecube