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

With .Net 6 Preview7, failed to open '/etc/dotnet/install_location' when running dotnet tool #56219

Closed
WenJunJi01 opened this issue Jul 22, 2021 · 12 comments · Fixed by #56327
Closed
Assignees
Milestone

Comments

@WenJunJi01
Copy link
Member

Repro steps:

  1. Install .NET 6 Preview7 SDK(6.0.100-preview.7.21369.19)
  2. Run below commands:
    dotnet tool install -g doTNetsay
    dotnet tool list -g
    dotnetsay

Expected Result:
Tool dotnetsay can be run successfully

Actual Result:
Failed to open '/etc/dotnet/install_location' when running dotnet tool:
The install_location file ['/etc/dotnet/install_location'] failed to open: No such file or directory.

image

Note: Not repro Windows10

Dotnet info:
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.7.21369.19
Commit: cdbd475cb6

Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.100-preview.7.21369.19/

Host (useful for support):
Version: 6.0.0-preview.7.21368.2
Commit: 8d3afa3

.NET SDKs installed:
6.0.100-preview.7.21369.19 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.7.21369.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21368.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@wli3
Copy link

wli3 commented Jul 22, 2021

@mikem8361 could you look into this install_location issue?

@wli3 wli3 assigned mikem8361 and unassigned wli3 Jul 22, 2021
@wli3
Copy link

wli3 commented Jul 22, 2021

@vitek-karas

@mikem8361
Copy link
Member

Why did I get assigned this issue?

@vitek-karas vitek-karas transferred this issue from dotnet/sdk Jul 23, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-Setup untriaged New issue has not been triaged by the area owner labels Jul 23, 2021
@vitek-karas vitek-karas assigned mateoatr and unassigned mikem8361 Jul 23, 2021
@ghost
Copy link

ghost commented Jul 23, 2021

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

Repro steps:

  1. Install .NET 6 Preview7 SDK(6.0.100-preview.7.21369.19)
  2. Run below commands:
    dotnet tool install -g doTNetsay
    dotnet tool list -g
    dotnetsay

Expected Result:
Tool dotnetsay can be run successfully

Actual Result:
Failed to open '/etc/dotnet/install_location' when running dotnet tool:
The install_location file ['/etc/dotnet/install_location'] failed to open: No such file or directory.

image

Note: Not repro Windows10

Dotnet info:
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.7.21369.19
Commit: cdbd475cb6

Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.100-preview.7.21369.19/

Host (useful for support):
Version: 6.0.0-preview.7.21368.2
Commit: 8d3afa3

.NET SDKs installed:
6.0.100-preview.7.21369.19 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.7.21369.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-preview.7.21368.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Author: WenJunJi01
Assignees: mateoatr
Labels:

area-Host, untriaged

Milestone: -

@vitek-karas vitek-karas added this to the 6.0.0 milestone Jul 23, 2021
@vitek-karas vitek-karas removed the untriaged New issue has not been triaged by the area owner label Jul 23, 2021
@vitek-karas vitek-karas assigned vitek-karas and unassigned mateoatr Jul 23, 2021
@vitek-karas
Copy link
Member

I'm gonna give this a shot of fixing (to refresh my linux debugging non-skills).

@agocke
Copy link
Member

agocke commented Jul 26, 2021

Looks like that error should not be printed, but it is not causing any other side effects (the process is not exiting) so I don't think this is blocking

@vitek-karas
Copy link
Member

It is blocking - we can't alter an output (stderr or stdout) of a console app if it works - the entire functionality of the app might be to print something to stderr and if something else tries to parse it it would be broken.

@mateoatr
Copy link
Contributor

We must change this to info:

if (install_location_file == nullptr)
{
trace::error(_X("The install_location file ['%s'] failed to open: %s."), install_location_file_path.c_str(), pal::strerror(errno));
return false;
}

@agocke
Copy link
Member

agocke commented Jul 26, 2021

This is blocking Preview 7?

@vitek-karas
Copy link
Member

@vitek-karas
Copy link
Member

Blocking Preview 7 - don't know - it might. It's pretty bad and there's really no work around (creating the file is one, but one needs to know what to put into it).

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jul 26, 2021
agocke pushed a commit that referenced this issue Jul 27, 2021
The app will still run, but we must not print out anything in that case.

Fixes #56219
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jul 27, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants