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

Workload install copying across mounts error #18450

Closed
sfoslund opened this issue Jun 22, 2021 · 5 comments · Fixed by #18482
Closed

Workload install copying across mounts error #18450

sfoslund opened this issue Jun 22, 2021 · 5 comments · Fixed by #18482
Assignees
Milestone

Comments

@sfoslund
Copy link
Member

The files on disk workload install needs to copy files into both the user's home (advertising manifests) and the dotnet directory (packs, installed manifests). This can cause problems with those are under different mounts, for example, the default user home on linux is /home/... and you could potentially install dotnet to /mnt/.... This is problematic because install uses one temp directory and has to be able to copy from that temp directory into both the home and dotnet directories. When the mounts for these locations conflict we run into a Invalid cross-device link. error (dotnet/runtime#31149).

Repro: Workload install using WSL

Error output:

/mnt/c/code/tmp2$ ./dotnet workload install microsoft-net-sdk-blazorwebassembly-aot
Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
Updated advertising manifest microsoft.net.sdk.android.
Updated advertising manifest microsoft.net.sdk.ios.
Updated advertising manifest microsoft.net.sdk.maccatalyst.
Updated advertising manifest microsoft.net.sdk.macos.
Failed to update the advertising manifest microsoft.net.sdk.maui: microsoft.net.sdk.maui.manifest-6.0.100 is not found in NuGet feeds https://api.nuget.org/v3/index.json"..
Updated advertising manifest microsoft.net.sdk.tvos.
Updated advertising manifest microsoft.net.workload.mono.toolchain.
Installing workload manifest microsoft.net.sdk.android version 30.0.100-preview.5.28.
Workload installation failed, rolling back installed packs...
Installing workload manifest microsoft.net.sdk.android version 11.0.200-ci.main.256.
Installation roll back failed: Failed to install manifest microsoft.net.sdk.android version 11.0.200-ci.main.256: The transaction has aborted..
Workload installation failed: Failed to install manifest microsoft.net.sdk.android version 30.0.100-preview.5.28: Invalid cross-device link.

@sfoslund sfoslund added this to the 6.0.1xx milestone Jun 22, 2021
@sfoslund sfoslund self-assigned this Jun 22, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jun 22, 2021
@sfoslund sfoslund removed the untriaged Request triage from a team member label Jun 22, 2021
@sfoslund
Copy link
Member Author

@wli3 @joeloff are you aware of any alternatives to Directory.Move that don't have problems copying between mounts? If not, I think we'll need to implement logic to use temp directories located on the mount we plan on copying to, which might be complicated.

@radical
Copy link
Member

radical commented Jun 22, 2021

I ran into this too on dotnet/runtime#54451 . And switched to using copying individual files with FileInfo.CopyTo, and worked fine.

@lewing
Copy link
Member

lewing commented Jun 23, 2021

Workloads on linux appear to be very broken due to this with a very recent SDK I get

dotnet workload install microsoft-net-sdk-blazorwebassembly-aot

Skip NuGet package signing validation. NuGet signing validation is not available on Linux or macOS https://aka.ms/workloadskippackagevalidation .
Failed to update the advertising manifest microsoft.net.workload.mono.toolchain: Invalid cross-device link.
Failed to update the advertising manifest microsoft.net.sdk.macos: Invalid cross-device link.
Failed to update the advertising manifest microsoft.net.sdk.maccatalyst: Invalid cross-device link.
Failed to update the advertising manifest microsoft.net.sdk.maui: Invalid cross-device link.
Failed to update the advertising manifest microsoft.net.sdk.ios: Invalid cross-device link.
Failed to update the advertising manifest microsoft.net.sdk.android: Invalid cross-device link.
Failed to update the advertising manifest microsoft.net.sdk.tvos: Invalid cross-device link.
Installing pack Microsoft.NET.Runtime.WebAssembly.Sdk version 6.0.0-preview.7.21321.15...
Workload installation failed, rolling back installed packs...
Rolling back pack Microsoft.NET.Runtime.WebAssembly.Sdk installation...
Workload installation failed: Invalid cross-device link
install
  Install a workload.

Usage:
  dotnet [options] workload install [<WORKLOAD_ID>...]

Arguments:
  <WORKLOAD_ID>  The NuGet Package Id of the workload to install.

Options:
  --sdk-version <VERSION>                                                  The version of the SDK.
  --configfile <FILE>                                                      The NuGet configuration file to use.
  --add-source <SOURCE>                                                    Add an additional NuGet package source to use during installation.
  --skip-manifest-update                                                   Skip updating the workload manifests.
  --from-cache <from-cache>                                                Complete the operation from cache (offline).
  --download-to-cache <download-to-cache>                                  Download packages needed to install a workload to a folder which can be used for offline installation.
  --include-previews                                                       Allow prerelease workload manifests.
  --temp-dir <temp-dir>                                                    Configure the temporary directory used for this command (must be secure).
  --disable-parallel                                                       Prevent restoring multiple projects in parallel.
  --ignore-failed-sources                                                  Treat package source failures as warnings.
  --no-cache                                                               Do not cache packages and http requests.
  --interactive                                                            Allows the command to stop and wait for user input or action (for example to complete authentication).
  -v, --verbosity <d|detailed|diag|diagnostic|m|minimal|n|normal|q|quiet>  Set the MSBuild verbosity level. Allowed values are q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
  -?, -h, --help                                                           Show help and usage information

@sfoslund
Copy link
Member Author

sfoslund commented Jun 23, 2021

Yes, I think this was all a result of #17860, where we changed to using the machine's default temp location, which on linux is often on a different mount from the dotnet install location. I'll get a PR out to fix this today but in the meantime it can be worked around by using the --temp-dir option and specifying a temp location within the same mount as the dotnet installation.

@jonathanpeppers
Copy link
Member

Saw this on Windows, might be related: #18516

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

Successfully merging a pull request may close this issue.

4 participants