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

AmazonS3Client.PutBucketTagging puts tags key as a bucket tag value #1096

Closed
stanb opened this issue Oct 14, 2018 · 4 comments
Closed

AmazonS3Client.PutBucketTagging puts tags key as a bucket tag value #1096

stanb opened this issue Oct 14, 2018 · 4 comments
Labels
bug This issue is a bug.

Comments

@stanb
Copy link

stanb commented Oct 14, 2018

AmazonS3Client.PutBucketTagging puts tags key as a tag value.

Expected Behavior

AmazonS3Client.PutBucketTagging puts passed tag value as a value

Current Behavior

AWSSDK.S3 starting from version 3.3.24 creates buckets tags with wrong value. It puts passed Key as a Value.

Possible Solution

It seems that there is a bug in the https://github.com/aws/aws-sdk-net/blob/master/sdk/src/Services/S3/Custom/Model/Tag.cs line 69
there are should be:
xmlWriter.WriteElementString("Value", S3Transforms.ToXmlStringValue(value));

Steps to Reproduce (for bugs)

        var s3 = new AmazonS3Client(RegionEndpoint.EUWest1);
        var res1 = await s3.PutBucketAsync(bucketName);
        var res2 = await s3.PutBucketTaggingAsync(new PutBucketTaggingRequest
        {
            BucketName = bucketName,
            TagSet = new List<Tag>
            {
                new Tag { Key = "my-key", Value = "my-value"}
            }
        });
        var res3 = await s3.GetBucketTaggingAsync(new GetBucketTaggingRequest {BucketName = bucketName});
        var tag = res3.TagSet.FirstOrDefault();
        if (tag.Key != "my-key" || tag.Value != $"my-value")
            Console.WriteLine("Wrong tags");

Context

Create bucket and put some tag

Your Environment

  • AWSSDK.Core version used: 3.3.25.4
  • Service assembly and version used: AWSSDK.S3 3.3.24.1
  • Operating System and version: Ubuntu 16.04
  • Visual Studio version: Rider 2018.2.3
  • Targeted .NET platform: .NETCoreApp 2.1

.NET Core Info

  • .NET Core version used for development:
  • .NET Core version installed in the environment where application runs:
  • Output of dotnet --info:

.NET Core SDK (reflecting any global.json):
Version: 2.1.403
Commit: 04e15494b6

Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/2.1.403/

Host (useful for support):
Version: 2.1.5
Commit: 290303f510

.NET Core SDKs installed:
2.1.403 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

  • Contents of project.json/project.csproj:
<PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <LangVersion>7.1</LangVersion>
</PropertyGroup>

<ItemGroup>
  <PackageReference Include="AWSSDK.S3" Version="3.3.24.1" />
</ItemGroup>
@normj normj added the bug This issue is a bug. label Oct 15, 2018
@normj
Copy link
Member

normj commented Oct 15, 2018

Agreed, we'll get that fixed up.

aws-sdk-dotnet-automation pushed a commit that referenced this issue Oct 17, 2018
Addresses this GitHub issue.
#1096
@costleya
Copy link
Contributor

This was fixed and released as of AWSSDK.S3 3.3.25.1

@jerryhxu
Copy link

Hi,

I used latest version AWSSDK.S3 3.3.31.17 and the same issue happened: AmazonS3Client.PutBucketTagging puts tags key as a tag value.

I then tried version AWSSDK.S3 3.3.25.1 and still the issue remains. Can someone please verify that this issue is indeed fixed? Thanks!

@jerryhxu
Copy link

Sorry, ignore my last post. This issue is fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants