{"record":{"id":"f0811a46e8357262","repo":"chenhg5/cc-connect","slug":"s-s-f0811a","errorCode":null,"errorMessage":"%s: %s","messagePattern":"%s: %s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/feishu.go","lineNumber":549,"sourceCode":"\treturn false, nil\n}\n\nfunc runRegistrationFlow(opts registrationFlowOptions) (*registrationFlowResult, error) {\n\tif opts.TimeoutSeconds <= 0 {\n\t\topts.TimeoutSeconds = 600\n\t}\n\tclient := &registrationClient{\n\t\tbaseURL: accountsFeishuBaseURL,\n\t\thttp:    &http.Client{Timeout: 15 * time.Second},\n\t\tdebug:   opts.Debug,\n\t}\n\n\tvar initRes registrationInitResponse\n\tif err := client.registrationCall(\"init\", nil, &initRes); err != nil {\n\t\treturn nil, fmt.Errorf(\"init failed: %w\", err)\n\t}\n\tif initRes.Error != \"\" {\n\t\treturn nil, fmt.Errorf(\"%s: %s\", initRes.Error, initRes.ErrorDescription)\n\t}\n\tif len(initRes.SupportedAuthMethods) > 0 && !containsString(initRes.SupportedAuthMethods, \"client_secret\") {\n\t\treturn nil, fmt.Errorf(\"current environment does not support client_secret auth\")\n\t}\n\n\tvar beginRes registrationBeginResponse\n\tbeginParams := map[string]string{\n\t\t\"archetype\":         \"PersonalAgent\",\n\t\t\"auth_method\":       \"client_secret\",\n\t\t\"request_user_info\": \"open_id\",\n\t}\n\tif err := client.registrationCall(\"begin\", beginParams, &beginRes); err != nil {\n\t\treturn nil, fmt.Errorf(\"begin failed: %w\", err)\n\t}\n\tif beginRes.Error != \"\" {\n\t\treturn nil, fmt.Errorf(\"%s: %s\", beginRes.Error, beginRes.ErrorDescription)\n\t}\n\tif beginRes.DeviceCode == \"\" || beginRes.VerificationURIComplete == \"\" {","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/feishu.go#L531-L567","documentation":"When the registration \"init\" call succeeds but the response carries an Error field, runRegistrationFlow returns `<Error>: <ErrorDescription>`, surfacing the remote service's own error name and description directly to the user.","triggerScenarios":"The registration service rejects the init request — e.g. invalid request parameters, disallowed origin/environment, service-side validation failure, or rate limiting — returning {error, error_description} in the init response body.","commonSituations":"Registration service temporarily rejecting requests; environment restrictions (the follow-up check also rejects environments without client_secret support); malformed request built by an outdated cc-connect version.","solutions":["Read <Error> and <ErrorDescription> from the message and address what the service reports (e.g. invalid parameter, forbidden).","Retry later if the description indicates a temporary/service-side condition or rate limit.","Update cc-connect to the latest version in case the request format changed.","If the environment is unsupported, use the manual setup path (editing config.toml directly) instead of the registration flow."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := runFeishuSetup(...); err != nil {\n    var svcErr *RegistrationServiceError // or match \"<name>: <desc>\" shape\n    if errors.As(err, &svcErr) {\n        log.Printf(\"registration service rejected init: %s - %s\", svcErr.Name, svcErr.Description)\n    }\n}","preventionTips":["Read the error name/description and follow what the remote service instructs.","Keep cc-connect updated so request formats match the current registration API.","Fall back to manual config.toml setup when the environment is unsupported."],"tags":["registration","feishu","api-error","remote"],"backgroundTag":"api-error-response","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"}