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-sdk-8.0.200] dotnet tool install command get access deny message #38354

Closed
Junjun-zhao opened this issue Jan 30, 2024 · 13 comments
Closed
Labels
Area-Tools needs team triage Requires a full team discussion

Comments

@Junjun-zhao
Copy link
Member

Application Name: globaltools
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-8.0.200

Verify Scenarios

  1. Windows10 21h2 x64 + dotnet-sdk-8.0.101: Pass
  2. Windows10 21h2 x64 + dotnet-sdk-8.0.102: Pass
  3. Windows10 21h2 x64 + dotnet-sdk-8.0.200: Fail

Issue Description:

When installing dotnet tools with "gti -c install" command, it get access deny error for gti tool installation.

Repro steps:

The machine only has dotnet-sdk-8.0.200 installed. And environment variable DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX set as 2.

1.Open command prompt window.
2. Execute "dotnet tool install –g gti" command.
3. Navigate to a local folder with "cd {localfolderpath}" command
4. Execute "gti –c save" command.
5. Execute "gti –c install" command.

Expected Result:
Tools will be installed successfully and "Tool is already installed" message will show if the tools were installed before.
image

Actual Result:

Get access deny error when installing gti tool which had installed before.
image

DotNet Info:


.NET SDK:
 Version:           8.0.200
 Commit:            438cab6a9d
 Workload version:  8.0.200-manifests.cdf2cc8e

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

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.2
  Architecture: x64
  Commit:       1381d5ebd2

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

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

Findings:

The permissions for the folder path in error message not changed when running with both dotnet-sdk-8.0.101 and dotnet-sdk-8.0.200.
This issue also repro on .NET 9 Preview1 build #38183 and file this bug to tracking the status for .NET 8.

@dotnet-actwx-bot @dotnet/compat

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Tools untriaged Request triage from a team member labels Jan 30, 2024
@JL03-Yue
Copy link
Member

Thanks for reporting it

@JL03-Yue
Copy link
Member

Hi @Junjun-zhao, may i ask if the gti tool is a tool in a private registry or in a public feed such as NuGet?

@Junjun-zhao
Copy link
Member Author

Hi @Junjun-zhao, may i ask if the gti tool is a tool in a private registry or in a public feed such as NuGet?

It comes from public NuGet feed: NuGet Gallery | gti 1.0.0

@JL03-Yue
Copy link
Member

Thank you so much @Junjun-zhao for this issue, I tried reproducing this issue with 8.0.2xx and it shows
image

For tools other than the gti tool, it installs successfully. For the gti tool, I wonder if the gti tool can be installed globally again while this tool is being used to install other tools. I'll investigate more into this issue. Any of your thoughts are helpful

@Junjun-zhao
Copy link
Member Author

Yes. This is the difference from previous behavior. Before dotnet-sdk-8.0.200, it will check the installation information and shows the message that tool 'gti' is already installed.
Currently, the process seems changed that it tries to uninstall itself. It is a little weird. I think the previous behavior is more reasonable.

@JL03-Yue JL03-Yue added this to the 9.0.1xx milestone Apr 4, 2024
@JL03-Yue JL03-Yue removed their assignment Apr 19, 2024
@marcpopMSFT marcpopMSFT added needs team triage Requires a full team discussion good first issue Issues that would be a good fit for someone new to the repository. Narrow in scope, well-defined. and removed needs team triage Requires a full team discussion labels Jun 4, 2024
@marcpopMSFT
Copy link
Member

@Junjun-zhao Chet doesn't see this in .net 9 or 8.0.301. Can you confirm it still repros for you in 8.0.300 (8.0.2xx is out of support now)
image

@Junjun-zhao
Copy link
Member Author

@marcpopMSFT Thanks for your quickly response.

It is still reproduced with the latest 9.0 P5 build & 8.0.300 build.

Verify Scenarios:
Windows10 21h2 x64 + dotnet-sdk-8.0.302: Fail
Windows10 21h2 x64 + dotnet-sdk-9.0.100-preview.5.24304.3: Fail

From the screenshot, it indicates only execute "dotnet tool install –g gti" command twice, it can't repro the issue. Please try with the following steps. Thanks.

  1. Execute "dotnet tool install –g gti" command.
  2. Navigate to a local folder with "cd {localfolderpath}" command
  3. Execute "gti –c save" command.
  4. Execute "gti –c install" command

@Junjun-zhao
Copy link
Member Author

Update status for .NET 8 release:
Refer to #38183 (comment) from @marcpopMSFT

We'll discuss in triage. Annie has left the team so we do not currently have someone digging into the tools issues anymore. We're short on time for 8.0.4xx and would not fix it in any other 8 sdk.

@marcpopMSFT marcpopMSFT added needs team triage Requires a full team discussion and removed good first issue Issues that would be a good fit for someone new to the repository. Narrow in scope, well-defined. needs team triage Requires a full team discussion labels Jul 16, 2024
@marcpopMSFT marcpopMSFT removed this from the 9.0.1xx milestone Jul 16, 2024
@marcpopMSFT
Copy link
Member

Thanks for the clarification. If it's the gti install command failing, that's on the tool itself, not on the SDK. It looks like the tool calls the install through us but it's trying to replace itself which is probably why it gets access denied and would need to find some other way to make the install work. I don't know why it worked before but this doesn't seem like a priority.

@marcpopMSFT marcpopMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2024
@marklio
Copy link

marklio commented Jul 23, 2024

@marcpopMSFT I was asked to look at this bug. I agree with your assessment that the error is likely because the tool is trying to update itself (calling dotnet tool install -g on its own id). However, it looks like this is the result of some change in behavior for dotnet tool install where it is reinstalling rather than simply indicating that the tool is already installed.

If that behavior is "by design", then that's fine, but it should be taken through the breaking change process. If that behavior is not "by design", then it should be fixed.

@marcpopMSFT
Copy link
Member

Hmmm, I'll have to think more on this. We made an intentional change in how we install tools but there wasn't an intentional change in behavior around locking the files or not-reinstalling. If we are installing the same version that's already installed, perhaps that's something we could potentially resolve.

Beyond that, I don't now how I would phrase this as a breaking change as it's not like there was something we intentionally broke. We don't think the original tool listed in this issue should be doing what it does (updating itself) but we don't have a good alternative. cc @baronfel

@Junjun-zhao
Copy link
Member Author

@marcpopMSFT @marklio This should be same as this issue dotnet tool install --global reinstalls even if the same version is already present which has been fixed since .NET 9 Preview 7 via PR Avoid reinstall tool already installed. Could you please have a look and see if the fix can be merged to .NET 8 8.0.30x and 8.0.40x releases?

Updated verify scenarios with latest release:
Windows10 21h2 x64 + dotnet-sdk-8.0.108: Pass
Windows10 21h2 x64 + dotnet-sdk-8.0.303: Fail
Windows10 21h2 x64 + dotnet-sdk-8.0.404: Fail
Windows10 21h2 x64 + dotnet-sdk-9.0.100-preview.7.24352.8 or later: Pass

@Junjun-zhao
Copy link
Member Author

Ping @marcpopMSFT , could you please take a look at this issue again? This issue has been fixed on .NET 9 release. Could it to be fixed on the .NET 8.0.30x and 8.0.40x releases? Thanks.

@marcpopMSFT marcpopMSFT added the needs team triage Requires a full team discussion label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Tools needs team triage Requires a full team discussion
Projects
None yet
Development

No branches or pull requests

4 participants