nikivdev/code · error · anyhow::Error
You don't own this project.
Error message
You don't own this project.
What it means
Raised by the service-token creation path when the cloud API responds 403 Forbidden. Authentication succeeded (the token is valid) but the authenticated user is not the owner of the target project, so they may not create service tokens for it. This is an authorization (permissions) error, not an authentication error.
Source
Thrown at src/env.rs:3995
let body = serde_json::json!({
"projectName": project,
"name": token_name,
"permissions": permissions,
});
let resp = client
.post(&url)
.header("Authorization", format!("Bearer {}", token))
.json(&body)
.send()
.context("failed to connect to cloud")?;
if resp.status() == 401 {
bail!("Unauthorized. Check your token with `f env login`.");
}
if resp.status() == 403 {
bail!("You don't own this project.");
}
if !resp.status().is_success() {
let status = resp.status();
let body = resp.text().unwrap_or_default();
bail!("API error {}: {}", status, body);
}
let data: CreateTokenResponse = resp.json().context("failed to parse response")?;
println!();
println!("✓ Service token created!");
println!();
println!("Token: {}", data.token);
println!("Project: {}", data.project_name);
println!("Name: {}", data.name);
println!("Permissions: {}", data.permissions);
println!();View on GitHub (pinned to a747e741ae)
Solutions
- Ask the project owner (or an org admin) to create the service token, or to grant you owner access.
- Verify local project config resolves to a project you actually own.
- If ownership transferred, have the new owner re-share or re-register the project with your account.
Example fix
// before: local config points at teammate's project // f.toml: project = "teammates-api" f env token create ci-token // after: point at your own project or ask the owner // f.toml: project = "my-api"
Defensive patterns
Strategy: validation
Validate before calling
# confirm you own the resolved project before creating tokens f env list # a 403 here also signals you lack access to this project # check project identity in local config before proceeding
Try / catch
// surface ownership requirement clearly
match create_token(name) {
Err(e) if e.to_string().contains("don't own this project") => {
eprintln!("ask the project owner to create this token or grant you owner access");
std::process::exit(3);
}
other => other?,
} Prevention
- Only attempt token creation on projects you own; check ownership in the dashboard first.
- Keep local project config pointing at your own project in forks.
- Have org admins create shared CI tokens instead of individual contributors.
When it happens
Trigger: Running the create-token command in a directory/config whose resolved project belongs to another user or org, so the API returns 403.
Common situations: Contributing to someone else's repo and trying to mint tokens for their project; local config pointing at the wrong (foreign) project; ownership transferred to an org your account isn't an admin of.
Understand the failure class
Background: "You do not have permission" / 403 Forbidden errors: authenticated but not allowed — causes and fixes across open-source libraries — this error's family across 31 libraries.
Related errors
- device code invalid. Run `f auth` again.
- Token cannot be empty
- Project not found. Create it with `f env push` first.
- `gh auth token` failed; run `gh auth login`
- Missing profile: {}
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/75f5819e702def41.
Report an issue: GitHub.