warpdotdev/warp · error · anyhow::Error

User is not on a team

Error message

User is not on a team

What it means

`resolve_owner(team_flag=true, ...)` asks `UserWorkspaces::sole_team_uid()` for the user's team. `None` means the account has no team, so a team-owned cloud object cannot be created and the `--team` request fails. The `--team` flag is an explicit demand, so no user fallback is attempted.

Source

Thrown at app/src/ai/agent_sdk/common.rs:107

) -> anyhow::Result<AmbientAgentTaskId> {
    let task_id = parse_ambient_task_id(run_id, "Invalid run ID")?;
    ServerApiProvider::handle(ctx)
        .as_ref(ctx)
        .get()
        .set_ambient_agent_task_id(Some(task_id));
    Ok(task_id)
}

/// Resolve the owner of a new cloud object. This resolution is based on the CLI `--team` and `--personal` flags.
///
/// If `team_flag` is true, attempts to get the current team UID (errors if not on a team).
/// If `user_flag` is true, gets the current user's UID.
/// Otherwise, defaults to team if available, falling back to user.
pub fn resolve_owner(team_flag: bool, user_flag: bool, ctx: &AppContext) -> anyhow::Result<Owner> {
    if team_flag {
        let team_id = UserWorkspaces::as_ref(ctx)
            .sole_team_uid()
            .ok_or_else(|| anyhow::anyhow!("User is not on a team"))?;
        return Ok(Owner::Team { team_uid: team_id });
    }

    if user_flag {
        let user_id = AuthStateProvider::as_ref(ctx)
            .get()
            .user_id()
            .ok_or_else(|| anyhow::anyhow!("User should be logged in"))?;
        return Ok(Owner::User { user_uid: user_id });
    }

    // Default: try team first, fall back to user
    if let Some(team_uid) = UserWorkspaces::as_ref(ctx).sole_team_uid() {
        return Ok(Owner::Team { team_uid });
    }

    log::warn!("Tried to default to creating team object, team could not be found.");
    let user_id = AuthStateProvider::as_ref(ctx)

View on GitHub (pinned to e72fd7aacb)

Solutions

  1. Drop `--team` or use `--personal` to create a user-owned object
  2. Verify team membership in the Warp app / team settings
  3. Refresh workspace metadata (re-login or restart the client) and retry
  4. If you just joined a team, retry after metadata sync completes

Example fix

# before
warp launch-configs create --team my-config
# after (personal account)
warp launch-configs create --personal my-config
Defensive patterns

Strategy: validation

Validate before calling

fn team_flag_usable(ctx: &AppContext) -> bool {
    UserWorkspaces::as_ref(ctx).sole_team_uid().is_some()
}
// Disable --team flows when false; default to --personal.

Prevention

When it happens

Trigger: Passing `--team` to a command that resolves a cloud-object owner via resolve_owner while the logged-in user's workspace metadata contains no sole team uid.

Common situations: Personal accounts with no team; workspace metadata not yet synced after joining a team; fresh login before metadata refresh; multiple-team edge cases.

Related errors


AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16). Data as JSON: /api/errors/c816dde08a66fd89. Report an issue: GitHub.