Skip to content

Upgrade failed; error message not helpful, error code incorrect #4151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stepancheg opened this issue Jan 11, 2025 · 2 comments
Closed

Upgrade failed; error message not helpful, error code incorrect #4151

stepancheg opened this issue Jan 11, 2025 · 2 comments

Comments

@stepancheg
Copy link

Problem you are trying to solve

$ rustup upgrade
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2025-01-09, rust version 1.84.0 (9fc6b4312 2025-01-07)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: removing previous version of component 'cargo'
info: rolling back changes
error: could not rename component file from '/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/etc/bash_completion.d' to '/root/.rustup/tmp/_5gb26t_5aka0pr1_dir/bk'
info: checking for self-update

  stable-x86_64-unknown-linux-gnu update failed - rustc 1.74.0 (79e9716c9 2023-11-13)

info: cleaning up downloads & tmp directories

Also

$ echo $?
0

So

  • Error message should say, why it could not rename. Directory not found? Permission denied? Out of disk space?
  • Upgrade failed, exit code should be not zero

Solution you'd like

  • Amend error message with the reason why it failed
  • Exit code not zero

Notes

$ rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.74.0 (79e9716c9 2023-11-13)`
@rami3l
Copy link
Member

rami3l commented Jan 12, 2025

@stepancheg Thanks for your report! The exit code part is a duplicate of #3476; I'm not sure about the error part, but my guess for the moment would be that this will be related to #988. Would you mind removing the toolchain to be upgraded and install it again, instead of performing a direct upgrade, as a workaround?

@stepancheg
Copy link
Author

Uninstalling the toolchain and installing again works. Thank you!

@rami3l rami3l closed this as completed Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants