{"record":{"id":"9277fbd74db49946","repo":"chenhg5/cc-connect","slug":"unknown-validation-error","errorCode":null,"errorMessage":"unknown validation error","messagePattern":"unknown validation error","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":493,"sourceCode":"\n\tvar lastErr error\n\tfor _, candidate := range candidates {\n\t\tbase := openFeishuBaseURL\n\t\tif candidate == \"lark\" {\n\t\t\tbase = openLarkBaseURL\n\t\t}\n\t\tok, err := validateAppCredentialsAgainstBase(base, appID, appSecret)\n\t\tif err != nil {\n\t\t\tlastErr = err\n\t\t\tcontinue\n\t\t}\n\t\tif ok {\n\t\t\treturn candidate, nil\n\t\t}\n\t\tlastErr = fmt.Errorf(\"remote returned non-zero code\")\n\t}\n\tif lastErr == nil {\n\t\tlastErr = fmt.Errorf(\"unknown validation error\")\n\t}\n\treturn \"\", lastErr\n}\n\nfunc validateAppCredentialsAgainstBase(baseURL, appID, appSecret string) (bool, error) {\n\tbody, _ := json.Marshal(map[string]string{\n\t\t\"app_id\":     appID,\n\t\t\"app_secret\": appSecret,\n\t})\n\treq, err := http.NewRequest(http.MethodPost, baseURL+\"/open-apis/auth/v3/tenant_access_token/internal\", bytes.NewReader(body))\n\tif err != nil {\n\t\treturn false, err\n\t}\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\n\tclient := &http.Client{Timeout: 10 * time.Second}\n\tresp, err := client.Do(req)\n\tif err != nil {","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L475-L511","documentation":"validateAppCredentials falls back to \"unknown validation error\" when the candidate loop ends with lastErr == nil, i.e. no candidate produced a definitive success or failure. This is a defensive placeholder indicating the validation loop never actually attempted a check.","triggerScenarios":"The candidate base URL list was empty, or every iteration hit the `continue` path without setting lastErr (an edge case in how candidates/errors are collected), leaving lastErr nil after the loop.","commonSituations":"Misconfigured or empty platform-type/base-URL candidate derivation; an internal edge case rather than a user-input mistake.","solutions":["Re-run with --debug if available to see which base URLs were attempted.","Explicitly pass --platform-type feishu or lark so a valid candidate base URL is generated.","Check network/proxy settings; if requests fail before producing an error the loop may never set lastErr.","If reproducible, report as a bug — this message signals an unhandled path in validateAppCredentials."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"if platformType == \"\" { platformType = \"feishu\" } // ensure a candidate base URL exists before validation","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"unknown validation error\") { log.Printf(\"validation loop produced no attempt; re-run with explicit --platform-type and debug enabled\") }","preventionTips":["Always set --platform-type explicitly so at least one base URL candidate is generated.","Use --debug to observe which validation attempts ran.","Report persistent occurrences as a bug in candidate generation."],"tags":["feishu","validation","internal"],"backgroundTag":"unexpected-api-response-shape","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"}