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

dotnet tool restore --interactive hangs forever #24220

Closed
dave-yotta opened this issue Mar 3, 2022 · 7 comments
Closed

dotnet tool restore --interactive hangs forever #24220

dave-yotta opened this issue Mar 3, 2022 · 7 comments
Assignees
Milestone

Comments

@dave-yotta
Copy link

Description

Running dotnet tool restore --interactive does not prompt for user input with the azure artifacts credential provider while dotnet restore --interactive does. Is there an issue with interactive mode on dotnet tool restore?

PS C:\Users\...\repro> dotnet restore --interactive
  Determining projects to restore...
      [CredentialProvider]DeviceFlow: https://pkgs.dev.azure.com/...
      [CredentialProvider]ATTENTION: User interaction required.

      **********************************************************************

      To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ... to authenticate.

      **********************************************************************

Attempting to cancel the build...
C:\Program Files\dotnet\sdk\6.0.200\NuGet.targets(130,5): error : Restore canceled! [C:\Users\...\repro\repro.csproj]
PS C:\Users\...\repro> cd ..
PS C:\Users\...> dotnet tool restore --interactive
(hangs here forever)

Configuration

.NET SDK (reflecting any global.json):
 Version:   6.0.200
 Commit:    4c30de7899

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\6.0.200\

Host (useful for support):
  Version: 6.0.2
  Commit:  839cdfb0ec

.NET SDKs installed:
  3.1.416 [C:\Program Files\dotnet\sdk]
  6.0.200 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Regression?

Other information

@mairaw mairaw transferred this issue from dotnet/core Mar 4, 2022
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Mar 4, 2022
@dsplaisted
Copy link
Member

Looking at the code, it looks like the --interactive flag is ignored for dotnet tool restore.

Also, it doesn't currently use NuGetPackageDownloader. It might be good to change that at the same time.

@dsplaisted dsplaisted added needs team triage Requires a full team discussion and removed untriaged Request triage from a team member labels Mar 16, 2022
@dsplaisted dsplaisted removed their assignment Mar 16, 2022
@marcpopMSFT marcpopMSFT added For consideration Used for items on the backlog to raise them to the top of that list for discussion and removed needs team triage Requires a full team discussion labels Mar 23, 2022
@marcpopMSFT marcpopMSFT modified the milestones: Backlog, 8.0.1xx Mar 23, 2022
@marcpopMSFT marcpopMSFT removed the For consideration Used for items on the backlog to raise them to the top of that list for discussion label Mar 23, 2022
@AraHaan
Copy link
Member

AraHaan commented Mar 31, 2022

Is it ok that I post an issue I face with dotnet-ef here as well?

For some reason for my locally manifested tool (in this case dotnet-ef) right after I restore it, it tells me to restore it again when I try to use it:

image

@MiYanni
Copy link
Member

MiYanni commented Sep 18, 2023

@JL03-Yue Do you know if --interactive works with your changes in #33835?

@MiYanni
Copy link
Member

MiYanni commented Oct 14, 2023

@dave-yotta

I haven't dug into the code for this issue, but I just did a basic test.

PS C:\Workspace\ToolTest> dotnet new tool-manifest
The template "Dotnet local tool manifest file" was created successfully.

PS C:\Workspace\ToolTest> dotnet tool restore --interactive


Restore was successful.
PS C:\Workspace\ToolTest> dotnet tool restore


Restore was successful.

Trying both restore with --interactive and without it were successful. Now, this is just a blank manifest so I have no idea if the scenario is valid. If I could have a manifest that shows the issue, that would help significantly. Lastly, I have no idea why there are so many blank lines after every command execution. If there is still a bug here, I'd clean up that output too along with the fix.

@dave-yotta
Copy link
Author

Seems ok now, I'm on a newer sdk:

.NET SDK:
 Version:   7.0.201
 Commit:    68f2d7e7a3

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19044
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\7.0.201\

Host:
  Version:      7.0.3
  Architecture: x64
  Commit:       0a2bda10e8

.NET SDKs installed:
  7.0.201 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 6.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 7.0.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  x86   [C:\Program Files (x86)\dotnet]
    registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

@MiYanni
Copy link
Member

MiYanni commented Oct 16, 2023

If the issue comes up again, let us know so I reopen the issue. For now, I'm closing it. Thanks.

@MiYanni MiYanni closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2023
@cfeilen
Copy link

cfeilen commented Oct 18, 2023

For those who hit this in the future...
dotnet tool restore --interactive --verbosity d
Adding the --verbosity d will cause the message to be displayed (for me that's the link) so you can click on it.

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

6 participants