chenhg5/cc-connect · error

weibo: app_id and app_secret are required

Error message

weibo: app_id and app_secret are required

What it means

Configuration guard in the weibo platform constructor New: one or both of the mandatory app_id / app_secret options are missing or empty strings in config.toml. Without them the platform cannot authenticate against the Weibo open platform token endpoint, so construction fails at startup rather than at first use.

Source

Thrown at platform/weibo/weibo.go:77

	tokenMu     sync.Mutex
	uid         string

	ctx    context.Context
	cancel context.CancelFunc

	seen   map[string]struct{}
	seenMu sync.Mutex
}

func New(opts map[string]any) (core.Platform, error) {
	name, _ := opts["name"].(string)
	if name == "" {
		name = "weibo"
	}
	appID, _ := opts["app_id"].(string)
	appSecret, _ := opts["app_secret"].(string)
	if appID == "" || appSecret == "" {
		return nil, fmt.Errorf("weibo: app_id and app_secret are required")
	}

	tokenEndpoint, _ := opts["token_endpoint"].(string)
	if tokenEndpoint == "" {
		tokenEndpoint = defaultTokenEndpoint
	}
	wsEndpoint, _ := opts["ws_endpoint"].(string)
	if wsEndpoint == "" {
		wsEndpoint = defaultWSEndpoint
	}

	allowFrom, _ := opts["allow_from"].(string)
	core.CheckAllowFrom(name, allowFrom)

	return &Platform{
		name:          name,
		appID:         appID,
		appSecret:     appSecret,

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Set app_id and app_secret under the [platform.weibo] section in config.toml
  2. Copy both values exactly from the Weibo open-platform app console
  3. Fail fast at startup (as the code does) and surface the error in doctor output
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at platform/weibo/weibo.go:77 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/44c6d62695724f5c. Report an issue: GitHub.