chenhg5/cc-connect · error

%s: list chat members: %w

Error message

%s: list chat members: %w

What it means

The Lark GetChatMembers API call inside fetchChatMembers failed (transport or wrapped API error) while resolving the chat's member name/open_id map. Wraps the underlying error after token acquisition succeeded.

Source

Thrown at platform/feishu/feishu.go:2264

func (p *Platform) fetchChatMembers(ctx context.Context, chatID string) (map[string]string, error) {
	if p.client == nil {
		return nil, fmt.Errorf("%s: client not initialized", p.tag())
	}
	members := make(map[string]string)
	req := larkim.NewGetChatMembersReqBuilder().
		ChatId(chatID).
		MemberIdType("open_id").
		PageSize(100).
		Build()
	timeoutCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
	defer cancel()
	token, err := p.fetchFreshTenantAccessToken(timeoutCtx)
	if err != nil {
		return nil, fmt.Errorf("%s: fetch tenant token for chat members: %w", p.tag(), err)
	}
	iter, err := p.client.Im.ChatMembers.GetByIterator(timeoutCtx, req, larkcore.WithTenantAccessToken(token))
	if err != nil {
		return nil, fmt.Errorf("%s: list chat members: %w", p.tag(), err)
	}
	for {
		hasMore, member, err := iter.Next()
		if err != nil {
			slog.Debug(p.tag()+": fetch chat members page error", "chat_id", chatID, "error", err)
			break
		}
		if member != nil && member.Name != nil && member.MemberId != nil {
			name := *member.Name
			if _, exists := members[name]; !exists {
				members[name] = *member.MemberId
			} else {
				members[name] = ""
			}
		}
		if !hasMore {
			break
		}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Verify the bot is in the chat and has member-read permission
  2. Check Feishu rate limits if failures repeat
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at platform/feishu/feishu.go:2264 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/12dd108bd359343b. Report an issue: GitHub.