TiDB CDC Creating Sync Task Using Auto-Generated UUID Suddenly Reports Error

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: tidbcdc创建同步任务使用自动生成的uuid突然报错

| username: TiDBer_8xv3YpMO

This step of creating the task is unsuccessful, but when I use the command to create it, it is successful.

| username: ealam_小羽 | Original post link

Is it too long? You can check the corresponding version of cdc/model/changefeed.go in the latest version of Tiflow code. It is also possible that the changefeedId parameter name constructed in the code is incorrect. I suggest printing the parameters of httpUtil.

const changeFeedIDMaxLen = 128

var changeFeedIDRe = regexp.MustCompile(`^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$`)

// ValidateChangefeedID returns true if the changefeed ID matches
// the pattern "^[a-zA-Z0-9]+(\-[a-zA-Z0-9]+)*$", length no more than "changeFeedIDMaxLen", eg, "simple-changefeed-task".
func ValidateChangefeedID(changefeedID string) error {
	if !changeFeedIDRe.MatchString(changefeedID) || len(changefeedID) > changeFeedIDMaxLen {
		return cerror.ErrInvalidChangefeedID.GenWithStackByArgs(changeFeedIDMaxLen)
	}
	return nil
}