{"record":{"id":"29226e3ef60dc75b","repo":"Hmbown/CodeWhale","slug":"a-gitee-access-token-is-not-configured-in-the-codewhale","errorCode":null,"errorMessage":"a Gitee access token is not configured in the Codewhale service slot; the branch was pushed but no pull request was opened","messagePattern":"a Gitee access token is not configured in the Codewhale service slot; the branch was pushed but no pull request was opened","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/dispatch_runner.rs","lineNumber":626,"sourceCode":"            sanitize_error(&String::from_utf8_lossy(&output.stderr))\n        );\n    }\n    let url = String::from_utf8_lossy(&output.stdout).trim().to_string();\n    if !url.starts_with(\"https://\") {\n        bail!(\"gh did not report a pull request URL; refusing to invent one.\");\n    }\n    Ok(url)\n}\n\nfn open_pr_gitee(\n    slug: &str,\n    job: &CloudJob,\n    patch: &PatchReceipt,\n    title: &str,\n    body: &str,\n) -> Result<String> {\n    let token = read_service_token(\"gitee\").ok_or_else(|| {\n        anyhow!(\"a Gitee access token is not configured in the Codewhale service slot; the branch was pushed but no pull request was opened\")\n    })?;\n    let url = validate_outbound_origin(&gitee_pr_url(slug))?;\n    let response = crate::tls::reqwest_blocking_client_builder()\n        .connect_timeout(std::time::Duration::from_secs(8))\n        .timeout(std::time::Duration::from_secs(30))\n        .redirect(reqwest::redirect::Policy::none())\n        .build()\n        .context(\"could not initialize the Gitee client\")?\n        .post(url)\n        .form(&[\n            (\"access_token\", token.as_str()),\n            (\"title\", title),\n            (\"head\", job.branch.as_str()),\n            (\"base\", patch.base_branch.as_str()),\n            (\"body\", body),\n        ])\n        .send()\n        .context(\"could not reach Gitee\")?;","sourceCodeStart":608,"sourceCodeEnd":644,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/dispatch_runner.rs#L608-L644","documentation":"open_pr_gitee requires a Gitee access token read from the Codewhale service token slot; when read_service_token(\"gitee\") returns None it fails with this error. The message explicitly states the branch push already succeeded — only the PR-open step could not proceed.","triggerScenarios":"open -> open_pr_gitee on a Gitee forge job while no 'gitee' token is stored in the Codewhale service slot (never configured, stored under a different key, or the secret service returned nothing).","commonSituations":"Fresh setup where credentials were never configured; token stored under a different service name; keyring/secret service unavailable so lookup returns None; token revoked and deleted.","solutions":["Store a Gitee personal access token in the Codewhale service slot under the 'gitee' key, then retry the PR step.","Verify the token exists by listing/reading Codewhale service tokens for 'gitee'.","If the branch is already on Gitee, open the PR manually in the Gitee web UI using the pushed branch."],"exampleFix":"# before\n$ codewhale service-token list   # no gitee entry\n# after\n$ codewhale service-token set gitee <personal-access-token>","handlingStrategy":"validation","validationCode":"if read_service_token(\"gitee\").is_none() {\n    eprintln!(\"configure a Gitee token in the Codewhale service slot before dispatching Gitee PR jobs\");\n}","typeGuard":null,"tryCatchPattern":"match open_pr_gitee(slug, job, patch, title, body) {\n    Err(e) if e.to_string().contains(\"not configured in the Codewhale service slot\") => {\n        // branch was pushed; prompt user to set the token, then open PR manually\n    }\n    other => other?,\n}","preventionTips":["Store the Gitee token during initial setup with the service-token command.","Pre-flight credential checks before starting a Gitee cloud job.","Handle keyring unavailability so a missing secret is detected early."],"tags":["authentication","gitee","token","pull-request"],"backgroundTag":"missing-api-key","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T10:30:35.592Z"}