Skip to content
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

error: conflict detected #1723

Closed
bjorn3 opened this issue Mar 22, 2019 · 17 comments
Closed

error: conflict detected #1723

bjorn3 opened this issue Mar 22, 2019 · 17 comments
Labels

Comments

@bjorn3
Copy link
Member

bjorn3 commented Mar 22, 2019

Problem
rustup update fails with error: could not rename component file.

Steps

$ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2019-03-22, rust version 1.35.0-nightly (94fd04589 2019-03-21)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: removing component 'rustc'
info: removing component 'rust-std'
info: removing component 'cargo'
info: removing component 'rust-docs'
info: removing component 'rust-src'
info: installing component 'rustc'
 87.0 MiB /  87.0 MiB (100 %)   9.4 MiB/s ETA:   0 s                
info: installing component 'rust-std'
 57.6 MiB /  57.6 MiB (100 %)  12.6 MiB/s ETA:   0 s                
info: rolling back changes
error: could not rename component file from '/home/bjorn/.rustup/tmp/_uskl5s584qovc85_dir/bk' to '/home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share'
error: could not rename component file from '/home/bjorn/.rustup/tmp/ytx3usejm6m2vvm4_dir/bk' to '/home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/doc'
error: could not rename component file from '/home/bjorn/.rustup/tmp/j9yeu6yu2bn83t6k_dir/bk' to '/home/bjorn/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/share/man'
error: failed to install component: 'rust-std-x86_64-unknown-linux-gnu', detected conflict: '"lib/rustlib/x86_64-unknown-linux-gnu/lib/libjemalloc_sys-99c4b45b0d0ee377.rlib"'
info: checking for self-updates

       stable-x86_64-unknown-linux-gnu unchanged - rustc 1.33.0 (2aa4c46cf 2019-02-28)
  nightly-x86_64-unknown-linux-gnu update failed - rustc 1.35.0-nightly (82e2f3ec2 2019-03-20)

Notes

Output of rustup --version: rustup 1.17.0 (069c88ed6 2019-03-05)
Output of rustup show:

Default host: x86_64-unknown-linux-gnu

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu
rust2-stage1
rust2-stage2

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (overridden by '/home/bjorn/Documenten/rustc_codegen_cranelift/rust-toolchain')
rustc 1.35.0-nightly (82e2f3ec2 2019-03-20)

In the past space issues have caused update problems, but I believe I have enough free space now:

$ df -h
[...]
/dev/sda5           64G      59G  2,2G  97% /
[...]

rm -r ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu fixes the problem though, so it may be a space problem anyway. It would be nice to give a message that the disk is full in that case though.

@bjorn3 bjorn3 added the bug label Mar 22, 2019
@s-n-ushakov
Copy link

The same is observed for a fresh install of 1.35.0 release on Windows:

>rustup-init.exe

Welcome to Rust!

This will download and install the official compiler for the Rust programming
language, and its package manager, Cargo.

It will add the cargo, rustc, rustup and other commands to Cargo's bin
directory, located at:

  C:\Users\ushakov\.cargo\bin

This path will then be added to your PATH environment variable by modifying the
HKEY_CURRENT_USER/Environment/PATH registry key.

You can uninstall at any time with rustup self uninstall and these changes will
be reverted.

Current installation options:

   default host triple: x86_64-pc-windows-msvc
     default toolchain: stable
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2019-05-23, rust version 1.35.0 (3c235d560 2019-05-20)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: installing component 'rustc'
 60.0 MiB /  60.0 MiB (100 %)  10.3 MiB/s in  6s ETA:  0s
info: installing component 'rust-std'
 53.1 MiB /  53.1 MiB (100 %)   9.1 MiB/s in  6s ETA:  0s
info: installing component 'cargo'
info: installing component 'rust-docs'
 10.3 MiB /  10.3 MiB (100 %) 193.6 KiB/s in 47s ETA:  0s
info: rolling back changes
error: could not rename component file from 'C:\Users\ushakov\.rustup\tmp\zh56rn2tryofc6cz_dir\rust-docs\share/doc/rust/
html' to 'C:\Users\ushakov\.rustup\toolchains\stable-x86_64-pc-windows-msvc\share/doc/rust/html'
info: caused by: Отказано в доступе. (os error 5)

Press the Enter key to continue.

os error 5 is 'Access denied'.

Keeping in mind the initial bug report for an update installation on linux, my current guess is that 'access denied' is likely to be due to an attempt of renaming the files that are not closed yet.

@s-n-ushakov
Copy link

The problem was finally solved on Windows 8 by running the installer with admin privileges, as per https://stackoverflow.com/questions/52542965/rust-installation-fails-on-windows-subsystem-for-linux-could-not-rename-compone/55373522#55373522

@kinnison
Copy link
Contributor

Interesting. I don't think any of us in the wg have windows 8 so we'd need assistance to diagnose, but I wouldn't be surprised if it were related to AV or similar protections.

@s-n-ushakov
Copy link

@kinnison Well, please feel free to use me as a remote agent :)

@kinnison
Copy link
Contributor

@s-n-ushakov thank you. If anyone in the wg knows the right questions to ask, it'd be @rbtcollins but I think that his time for this has been curtailed due to new job. Hopefully he'll have time to kick things off at some point soon, but please don't be surprised if it takes a while. At least you have a functional toolchain, albeit clunky, for the meantime.

@rbtcollins rbtcollins changed the title error: could not rename component file error: conflict detected Jun 20, 2019
@rbtcollins
Copy link
Contributor

So first things, what @bjorn3 reported was not and error with 'could not rename component file' - that is a victim, not a cause - the cause is the last - the error: failed to install component: 'rust-std-x86_64-unknown-linux-gnu', detected conflict: '"lib/rustlib/x86_64-unknown-linux-gnu/lib/libjemalloc_sys-99c4b45b0d0ee377.rlib"' output. We can tell this because of the .bk suffix on the temp directory - bk for 'backup'.

We should add some more output after rolling back the changes to separate rollback errors - which happened from the output of the original error. This would aid in folk filing bugs and finding duplicates etc.

I suspect @bjorn3 that you've had a partially written manifest as a result of the space issue; if the problem is ongoing we should get the manifest and a recursive directory directory listing (or a zip of the .rustup) and then we can figure out the current state and perhaps what bug let us get into that state.

@s-n-ushakov your issue is thus entirely separate; the bug title was a false friend :). please do file a separate ticket; getting a trace with procmon of the entire IO affecting the .rustup directory in your wslv1 homedir should let us track down the error that is occuring when you run unpriviled.

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 21, 2019

I freed some space and deleted nightly, so that I could install it again.

@s-n-ushakov
Copy link

@rbtcollins I have made a new attempt of a fresh install with non-elevated user rights, and I am ready to create a separate ticket. Currently I have Process Monitor logs saved in three formats:

  • CSV : 64 M
  • PML (Process Monitor native binary format) : 126 M
  • XML : 117 M
    Which format is best to be attached to the ticket?
    I have only retained the events for the ".cargo" and ".rustup" folders in the log, as well as "profiling events" as suggested by the log export form. Is that ok?

@s-n-ushakov
Copy link

@rbtcollins I have filed a new bug as #1912 , please have a look. Currently refraining from attaching any of ~100M Process Monitor logs, looking forward to your further suggestions/guidelines...

@rbtcollins
Copy link
Contributor

@s-n-ushakov thanks; lets discuss there :)

@rbtcollins
Copy link
Contributor

@bjorn3 ok. sounds like that cleared the fault for you?

@bjorn3
Copy link
Member Author

bjorn3 commented Jun 25, 2019

@rbtcollins yes, at least for now. I think I will get it again when I run low in disk space again. I will try to reproduce it by filling my disk soon.

@kinnison
Copy link
Contributor

@bjorn3 Did you ever manage to reproduce this -- I think it's related to one or more of the manifest files becoming corrupted (or zero-size) in the toolchain's lib/rustlib directory.

@rbtcollins
Copy link
Contributor

If @bjorn3 has not reproduced this again, I think we should close it: a redesign / overhaul of the core storage is something we'll probably get to and deal with this sort of thing systemically eventually anyway.

@bjorn3 if you do reproduce this please do reopen it of course.

@bjorn3
Copy link
Member Author

bjorn3 commented Jul 15, 2020

I tried updating with 112MB of free space. While it doesn't say "detected conflict" anymore, the error message is still confusing:

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2020-07-15, rust version 1.46.0-nightly (23744c84d 2020-07-14)
warning: Force-skipping unavailable component 'rustfmt-x86_64-unknown-linux-gnu'
info: downloading component 'llvm-tools-preview'
 18.8 MiB /  18.8 MiB (100 %)   7.7 MiB/s in  2s ETA:  0s
info: downloading component 'rustc-dev'
 73.7 MiB /  73.7 MiB (100 %)   7.6 MiB/s in 10s ETA:  0s
info: downloading component 'clippy'
info: downloading component 'rust-src'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
 12.6 MiB /  12.6 MiB (100 %)   7.7 MiB/s in  1s ETA:  0s
info: downloading component 'rust-std'
info: Retrying download for 'https://static.rust-lang.org/dist/2020-07-15/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz'
info: Retrying download for 'https://static.rust-lang.org/dist/2020-07-15/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz'
info: Retrying download for 'https://static.rust-lang.org/dist/2020-07-15/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz'
info: Retrying download for 'https://static.rust-lang.org/dist/2020-07-15/rust-std-nightly-x86_64-unknown-linux-gnu.tar.xz'
error: component download failed for rust-std-x86_64-unknown-linux-gnu
info: checking for self-updates

       stable-x86_64-unknown-linux-gnu unchanged - rustc 1.44.1 (c7087fe00 2020-06-17)
  nightly-x86_64-unknown-linux-gnu update failed - rustc 1.46.0-nightly (346aec9b0 2020-07-11)

info: cleaning up downloads & tmp directories

With 220MB of free disk space, it does say perhaps you ran out of disk space?.

@ltfschoen
Copy link

i just encountered this same error and i had over 200 Gb of disk space when i ran

rustup update stable
rustup update nightly
error: could not rename component file from '/Users/me/.rustup/tmp/cnv087m5vbm924lb_dir/bk' to '/Users/me/.rustup/toolchains/stable-x86_64-apple-darwin/share/man'
error: could not rename component file from '/Users/ls2/.rustup/tmp/fdrchqk2l5_9fns5_dir/bk' to '/Users/me/.rustup/toolchains/stable-x86_64-apple-darwin/share/zsh'
error: could not rename component file from '/Users/ls2/.rustup/tmp/o39vnxcvlt4w5rub_dir/bk' to '/Users/me/.rustup/toolchains/stable-x86_64-apple-darwin/etc'
error: failed to install component: 'rust-docs-x86_64-apple-darwin', detected conflict: 'share/doc/rust/html'

i resolved the error by running

rm -rf /Users/me/.rustup/toolchains/nightly-x86_64-apple-darwin
rm -rf /Users/me/.rustup/toolchains/stable-x86_64-apple-darwin

then i was able to install

stable-x86_64-apple-darwin installed - rustc 1.54.0 (a178d0322 2021-07-26)
nightly-x86_64-apple-darwin installed - rustc 1.56.0-nightly (29ef6cf16 2021-08-31)

with

rustup update stable
rustup toolchain install nightly-2021-08-31
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-08-31
rustup default nightly-2021-08-31
rustup override set nightly-2021-08-31
rustup toolchain list

@rbtcollins
Copy link
Contributor

Locking this to avoid further noise. #2417 is the bug tracking the main aspect of this.

@rust-lang rust-lang locked and limited conversation to collaborators Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants