{"record":{"id":"ff92feea56cd61f3","repo":"chenhg5/cc-connect","slug":"s-fetch-tenant-access-token-returned-empty-token","errorCode":null,"errorMessage":"%s: fetch tenant access token returned empty token","messagePattern":"(.+?): fetch tenant access token returned empty token","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/feishu/feishu.go","lineNumber":4115,"sourceCode":"\t}\n\n\tslog.Warn(p.tag()+\": retrying request with fresh tenant access token\", \"operation\", operation)\n\treturn fn(p.replayAPIClient(), larkcore.WithTenantAccessToken(freshToken))\n}\n\nfunc (p *Platform) fetchFreshTenantAccessToken(ctx context.Context) (string, error) {\n\tresp, err := p.replayAPIClient().GetTenantAccessTokenBySelfBuiltApp(ctx, &larkcore.SelfBuiltTenantAccessTokenReq{\n\t\tAppID:     p.appID,\n\t\tAppSecret: p.appSecret,\n\t})\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"%s: fetch tenant access token: %w\", p.tag(), err)\n\t}\n\tif !resp.Success() {\n\t\treturn \"\", fmt.Errorf(\"%s: fetch tenant access token code=%d msg=%s\", p.tag(), resp.Code, resp.Msg)\n\t}\n\tif strings.TrimSpace(resp.TenantAccessToken) == \"\" {\n\t\treturn \"\", fmt.Errorf(\"%s: fetch tenant access token returned empty token\", p.tag())\n\t}\n\treturn resp.TenantAccessToken, nil\n}\n\nfunc (p *Platform) replayAPIClient() *lark.Client {\n\tp.replayClientMu.Lock()\n\tdefer p.replayClientMu.Unlock()\n\tif p.replayClient == nil {\n\t\tp.replayClient = newFeishuReplayClient(p.appID, p.appSecret, p.domain)\n\t}\n\treturn p.replayClient\n}\n\nfunc newFeishuReplayClient(appID, appSecret, domain string) *lark.Client {\n\tvar opts []lark.ClientOptionFunc\n\topts = append(opts, lark.WithEnableTokenCache(false))\n\tif domain != \"\" && domain != lark.FeishuBaseUrl {\n\t\topts = append(opts, lark.WithOpenBaseUrl(domain))","sourceCodeStart":4097,"sourceCodeEnd":4133,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/feishu/feishu.go#L4097-L4133","documentation":"fetchFreshTenantAccessToken: the self-built-app token endpoint call succeeded but returned success without issuing a token (empty token) — an app-configuration problem rather than a transport failure.","triggerScenarios":"Thrown at platform/feishu/feishu.go:4115 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the app is enabled and the same app_id/app_secret pair is used","Re-check app permissions/scopes in the Feishu developer console"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}