Ugrading to terraform provider AWS version 5.54.0 and pipeline failing due to operation error S3: GetObjectTagging,

Hi there,
We are upgrading to terraform provider AWS version 5.54.0 and the pipeline is failing giving back this error:
│ Error: listing tags for S3 (Simple Storage) Object (arn:aws:s3:::bucketname-environment//xxx.py): operation error S3: GetObjectTagging, https response error StatusCode: 404, error NoSuchKey: The specified key does not exist.

The problem is what we see in AWS arn in console is we have one dash “/” before the xxx.py , however in the pipleline run we see this strange /.
our code was perfectly working before so we think this is due to update. Could you please support?
Thanks a lot

Let me understand more, this s3 arn is of your state? or resource? can you share with us the backend configuration?

Hey,
Thanks for your reply,
Its from the resource, I will put the code below but surprisingly when I even hardcode the bucket name without the variables , it again creates the double slash in the pipeline and giving back the same error. It seems that this has been created somewhere else but nowhere in our code we define this resource and we only have one glue job.
resource “aws_s3_object” “directory” {
count = var.stage == “XXX” ? 1 : 0
bucket = “{var.bucket_name}-{var.stage}/”
key = “XXX.py”
source = “{path.module}/XXX.py" etag = filemd5("{path.module}/XXX.py”)
acl = “private”
}
Also the problem is not getting the tagging either, because I created tags and listed the key values for the tags by going into the s3 and everything was ok there.
The problem is I really cannot figure out where this extra “/” coming from
Thank you!

did you try change bucket entry for bucket = "var.bucketname-${var.stage}" without the slash in the end of bucket reference?
make not sense using slash in bucket name reference.

yes I tried that, I get the same error. I even hardcoded the name but still the same error. Could be because of the update ?

I suspected because bucketname don’t accept / in your name, and the provider fixed this in future changes.

But i don’t have idea anymore, instead if this problem is because the state don’t change the property until have a change.

Other idea…

with old version of the provider change the bucket name and apply the code.
after apply update provider version.