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

Using go json.Unmarshal cdc changefeed list command output reports an error #11906

Open
CharlesCheung96 opened this issue Dec 18, 2024 · 0 comments
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. area/ticdc Issues or PRs related to TiCDC. severity/minor type/bug The issue is confirmed as a bug.

Comments

@CharlesCheung96
Copy link
Contributor

Implementation Code:

func (t *TiCDC) QueryChangefeedList() ([]Changefeed, error) {
	cmd := fmt.Sprintf(`/cdc cli changefeed list --server "%s"`, t.TiCDCServer)
	output, err := t.exec(cmd)
	if err != nil  {
		return nil, err
	}

	var changefeedlist []Changefeed
	if err := json.Unmarshal([]byte(output), &changefeedlist); err != nil {
		return nil, errors.New("fialed to unmarshal changefeed list" + err.Error())
	}
	return changefeedlist, nil
}

error:
Image

Root cause

Ref pingcap/tidb#52612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.1 This bug affects the 8.1.x(LTS) versions. area/ticdc Issues or PRs related to TiCDC. severity/minor type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant