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

aws-cdk-lib/aws-chatbot: Tag elements cannot contain whitespaces #30381

Closed
nguyentoanit opened this issue May 30, 2024 · 13 comments
Closed

aws-cdk-lib/aws-chatbot: Tag elements cannot contain whitespaces #30381

nguyentoanit opened this issue May 30, 2024 · 13 comments
Labels
@aws-cdk/aws-chatbot Related to AWS Chatbot bug This issue is a bug. service-api This issue is due to a problem in a service API

Comments

@nguyentoanit
Copy link

nguyentoanit commented May 30, 2024

Describe the bug

Recently, CDK failed to update stacks.
Looks like, an internal service (WheatleyOrchestration) didn't accept Tag elements contain whitespaces.

Expected Behavior

The internal service accepts Tag elements contain whitespaces.

Current Behavior

CDK couldn't update SlackChannelConfiguration because an internal service required Tag elements without whitespaces.

Resource handler returned message: "An error occurred from the supplied tags: Tag elements cannot contain whitespaces (Service: WheatleyOrchestration; Status Code: 400; Error Code: InvalidRequestException; Request ID: b20ea829-9520-43c5-ba77-58f1f022d982; Proxy: null)" (RequestToken: 7328c745-af5d-cd1b-a3e3-54dd56dcb268, HandlerErrorCode: HandlerInternalFailure)

Reproduction Steps

Deploy this stack:

import { LoggingLevel, SlackChannelConfiguration, SlackChannelConfigurationProps } from 'aws-cdk-lib/aws-chatbot'

export class MyStack extends Stack {
  constructor(scope: Construct, id: string, properties: SlackChannelConfigurationProps) {
    super(scope, id)
    const { slackChannelId, slackWorkspaceId, slackChannelConfigurationName } = properties

    new SlackChannelConfiguration(this, 'SlackChannel', {
      slackChannelConfigurationName,
      slackWorkspaceId,
      slackChannelId,
      loggingLevel: LoggingLevel.INFO,
      logRetention: RetentionDays.ONE_MONTH,
    })
  }
}

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.143.0

Framework Version

2.143.0

Node.js Version

18.19.0

OS

Linux

Language

TypeScript

Language Version

TypeScript (5.4.5)

Other information

No response

@nguyentoanit nguyentoanit added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 30, 2024
@github-actions github-actions bot added the @aws-cdk/aws-chatbot Related to AWS Chatbot label May 30, 2024
@khushail khushail added needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels May 30, 2024
@khushail khushail self-assigned this May 30, 2024
@paulocen
Copy link

Update: Payload has changed to the AWSChatbot service.
Resource handler returned message: "Invalid request provided: Tag elements cannot contain whitespaces (Service: AWSChatbot; Status Code: 400; Error Code: InvalidRequestException; Request ID: bafe3797-61b0-4882-a3fd-8d0ee216dcfc; Proxy: null)" (RequestToken: df3c3e43-c259-2807-37f6-dc8b4b7d5622, HandlerErrorCode: InvalidRequest)

@paulocen
Copy link

paulocen commented Jun 6, 2024

Seems resolved now @nguyentoanit ??

@nguyentoanit
Copy link
Author

@paulocen : Not yet from my side. Still get the same error. 🤷
How about you?

@moltar
Copy link
Contributor

moltar commented Jun 10, 2024

Nope, the issue still exists:

Resource handler returned message: "An error occurred from the supplied tags: Unable to modify resource Tags. Please try again. (Service: WheatleyOrchestration; Status Code: 409; Error Code: ConflictException; Request ID: 0db9bdf5-11ba-4af9-932a-aee8e5a1d34a; Proxy: null)" (RequestToken: 99fd36c0-2cb5-0ca7-1fd8-53c636b5861f, HandlerErrorCode: HandlerInternalFailure)

screenshot-20240610T210257-S7hXEF8l@2x

@moltar
Copy link
Contributor

moltar commented Jun 10, 2024

@paulocen Also, I am not sure what you mean by this:

Payload has changed to the AWSChatbot service.

?

@moltar
Copy link
Contributor

moltar commented Jun 10, 2024

I think this is some internal error from AWS, because we are not even setting a tag on the given resource. I have inspected the actual CF template as it's in the CF stack.

Here's the definition:

    "DriverSlackChannel8D461434": {
      "Type": "AWS::Chatbot::SlackChannelConfiguration",
      "Properties": {
        "ConfigurationName": "AD-OpsTools-foo",
        "IamRoleArn": {
          "Fn::GetAtt": [
            "DriverSlackChannelConfigurationRoleB1E5C93B",
            "Arn"
          ]
        },
        "LoggingLevel": "INFO",
        "SlackChannelId": "snipped",
        "SlackWorkspaceId": "snipped",
        "SnsTopicArns": [
          {
            "Fn::Join": [
              "",
              [
                "arn:",
                {
                  "Ref": "AWS::Partition"
                },
                ":sns:us-east-1:123:foo"
              ]
            ]
          },
          {
            "Fn::ImportValue": "..."
          },
          {
            "Fn::Join": [
              "",
              [
                "arn:",
                {
                  "Ref": "AWS::Partition"
                },
                ":sns:ap-northeast-1:123:foo"
              ]
            ]
          },
          {
            "Fn::Join": [
              "",
              [
                "arn:",
                {
                  "Ref": "AWS::Partition"
                },
                ":sns:me-central-1:123:foo"
              ]
            ]
          }
        ]
      }
    },

@khushail khushail added investigating This issue is being investigated and/or work is in progress to resolve the issue. and removed needs-reproduction This issue needs reproduction. labels Jun 11, 2024
@khushail
Copy link
Contributor

Hi @nguyentoanit , thanks for reaching out and sharing the repro code. I am not able to repro the error on my side rather, getting a different one which is related to channel access, seems fixable so working on it.

Meanwhile, as a workarond, Could you please try using the L1 construct like the given code shared below as I was able to successfully deploy the chatbot with L1 Construct .

Source code -

    const slackChannel = new CfnSlackChannelConfiguration(this, 'SlackChannelConfiguration', {
      configurationName: "cdk-integration-test-slack-config",
      slackChannelId: "********12",
      slackWorkspaceId: "T0****Z",
      loggingLevel: LoggingLevel.ERROR,
      iamRoleArn: "arn:aws:iam::123456789:role/service-role/AWSChatbot-role-1503-private", 
    });

Generated Synth template snippet-

{
 "Resources": {
  "SlackChannelConfiguration": {
   "Type": "AWS::Chatbot::SlackChannelConfiguration",
   "Properties": {
    "ConfigurationName": "cdk-integration-test-slack-config",
    "IamRoleArn": "arn:aws:iam::123456789:role/service-role/AWSChatbot-role-1503-private",
    "LoggingLevel": "ERROR",
    "SlackChannelId": "********12",
    "SlackWorkspaceId": "T0****Z"
   },
   "Metadata": {
    "aws:cdk:path": "SlackissueStack/SlackChannelConfiguration"
   }
  },
  "CDKMetadata": {
   "Type": "AWS::CDK::Metadata",
   "Properties": {
    "Analytics": "v2:deflate64:H4sIAAAAAAAA/yXJOw6DMBBF0bXQ25MYUaT3DmAB0WAPYcAZS/4kRZS9Y0T1nu7pwQwD3Dv8Zu38rgPP8JsKul219HQrljkWsItMoUW7oggFG2XhV01YOIpqOFKONTk6f0PPJ/yVRE+w5dvHPMD0YLotM+tUpfCbYLz2AKlKzkyDAAAA"
   },
   "Metadata": {
    "aws:cdk:path": "SlackissueStack/CDKMetadata/Default"
   },
   "Condition": "CDKMetadataAvailable"
  }
 },

Deployment -

Screenshot 2024-06-10 at 6 27 29 PM

Let me know if that works for you.

@khushail khushail added the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 11, 2024
@moltar
Copy link
Contributor

moltar commented Jun 11, 2024

Why would L1 be any different?

It just produces the same CloudFormation template in the end.

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Jun 11, 2024
@khushail
Copy link
Contributor

khushail commented Jun 11, 2024

yes, it would. I am not saying its wrong. Its just that deployment is successful so that would mean there might be some bug in L2 construct implementation which I am currently investigating.

I shared the L1 construct as an alternate to existing issue.

@moltar
Copy link
Contributor

moltar commented Jun 11, 2024

I don't see how the L2 or L3 has anything to do with it. I posted the entire template. Which is ultimately what the pipeline deploys. Pipeline does not use CDK to deploy. It uses CodePipeline native actions, and the templates produced by CDK. The template is there for everyone to see, as an artifact of the build. It does not even contain tags.

@nguyentoanit
Copy link
Author

the AWS team has made some adjustments on their end.
And the issue seems to be resolved.

Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@khushail khushail removed their assignment Jun 17, 2024
@khushail khushail added service-api This issue is due to a problem in a service API and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jun 17, 2024
@aws-cdk-automation
Copy link
Collaborator

Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.

@aws aws locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-chatbot Related to AWS Chatbot bug This issue is a bug. service-api This issue is due to a problem in a service API
Projects
None yet
Development

No branches or pull requests

5 participants