Skip to content

Improve error message when 'cargo owner --add' fails with a GitHub team#17056

Open
theoxfaber wants to merge 1 commit into
rust-lang:masterfrom
theoxfaber:fix-cargo-owner-team
Open

Improve error message when 'cargo owner --add' fails with a GitHub team#17056
theoxfaber wants to merge 1 commit into
rust-lang:masterfrom
theoxfaber:fix-cargo-owner-team

Conversation

@theoxfaber
Copy link
Copy Markdown

When running cargo owner --add github:org:team and the GitHub team cannot be found, the error message now includes a helpful hint directing users to check their GitHub OAuth application permissions.

What does this PR do?

The underlying error from crates.io (could not find the github team org/repo) is often caused by crates.io not having permission to access the GitHub organization, not because the team doesn't exist. This PR adds a hint to the error message pointing users to:

Before

error: failed to invite owners to crate `foo` on registry at https://crates.io

Caused by:
  the remote server responded with an error: could not find the github team org/repo

After

error: failed to invite owners to crate `foo` on registry at https://crates.io

Caused by:
  the remote server responded with an error: could not find the github team org/repo
  hint: crates.io may not have permission to access the GitHub organization. Go to https://github.com/settings/applications, check that crates.io is authorized, and ensure the organization has granted access

Closes #11505

When adding a GitHub team as a crate owner fails with 'could not find the
github team', the error now includes a hint pointing users to check their
GitHub OAuth application settings. This is a common issue caused by crates.io
not having permission to access the GitHub organization.

Closes rust-lang#11505
@rustbot rustbot added A-interacts-with-crates.io Area: interaction with registries Command-owner S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 31, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 31, 2026

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @weihanglo (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage, weihanglo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-interacts-with-crates.io Area: interaction with registries Command-owner S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"cargo owner --add" doesn't seem to work with teams

3 participants