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

cannot run dotnet-sdk (.NET 5.0.400 (latest)) without root privileges (installed with snap) #57481

Open
Tracked by #62241
merto-dvp opened this issue Aug 11, 2021 · 12 comments
Milestone

Comments

@merto-dvp
Copy link

Description

Issue:
Tried to publish/build dotnet app and got this error message:

Error:
cannot snap-exec: cannot exec "/snap/dotnet-sdk/137/snap/command-chain/snapcraft-runner": permission denied

Command:
dotnet publish Test/Test.WebAPI --configuration Release -o pkg

Configuration

App: .NET 5.0
dotnet-sdk Version: (latest/stable: 5.0.400 2021-08-10 (137) 139MB classic)
OS: Ubuntu 20.04 x86

Other information

Also discussed here: Cannot run dotnet command after installing 5.0 preview using snap dotnet/core#4446

Known temporary fixes:

Running command with sudo or root user:

sudo dotnet publish Test/Test.WebAPI --configuration Release -o pkg

Reverting to previous version:

snap revert dotnet-sdk

Installing latest/edge: 5.0.202 2021-04-16 (120) 137MB classic) with commands:

snap remove dotnet-sdk
snap install dotnet-sdk --classic --channel=latest/edge

Also you can check the other channels with:

snap info dotnet-sdk
channels:
  latest/stable:    5.0.400                   2021-08-10 (137) 139MB classic
  latest/candidate: ↑
  latest/beta:      ↑
  latest/edge:      5.0.202                   2021-04-16 (120) 137MB classic
  lts/stable:       3.1.412                   2021-08-10 (136) 123MB classic
  lts/candidate:    ↑
  lts/beta:         ↑
  lts/edge:         ↑
  6.0/stable:       –
  6.0/candidate:    –
  6.0/beta:         6.0.100-preview.6.21355.2 2021-07-14 (134) 144MB classic
  6.0/edge:         ↑
  5.0/stable:       5.0.400                   2021-08-10 (137) 139MB classic
@leecow
Copy link
Member

leecow commented Aug 11, 2021

@merto-dvp - can you try running as sudo? Certainly not what we want but I did see that it got things going.

@merto-dvp
Copy link
Author

merto-dvp commented Aug 11, 2021

@merto-dvp - can you try running as sudo? Certainly not what we want but I did see that it got things going.

Thanks for reply!, Yes, command works with sudo. But previous sdk versions was working fine without sudo.

@merto-dvp merto-dvp changed the title dotnet-sdk (.NET 5.0.400 (latest)) installed with snap won't run dotnet-sdk (.NET 5.0.400 (latest)) installed with snap won't run without root Aug 11, 2021
@Nezz
Copy link

Nezz commented Aug 13, 2021

Any updates on this? We'd love to use the latest version with the security fixes but we can't do that currently.

@merto-dvp merto-dvp changed the title dotnet-sdk (.NET 5.0.400 (latest)) installed with snap won't run without root cannot run dotnet-sdk (.NET 5.0.400 (latest)) without root privileges (installed with snap) Aug 13, 2021
@ar0311
Copy link

ar0311 commented Aug 14, 2021

Also getting this issue with .NET 6.0 preview 7 snap.

sudo snap revert dotnet-sdk worked, however it's no longer preview 7 but preview 6 which is a bit pointless

@adamsitnik adamsitnik transferred this issue from dotnet/core Aug 16, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-Snap untriaged New issue has not been triaged by the area owner labels Aug 16, 2021
@adamsitnik
Copy link
Member

@dleeapho @leecow @MichaelSimons PTAL

@MichaelSimons
Copy link
Member

cc @NikolaMilosavljevic

@chuchu
Copy link

chuchu commented Aug 28, 2021

Is there any version which doesn't have that issue? I have tried the latest 3.1, 5.0 and 6.0 with no luck.
Develop as root is not an option.

@tolache
Copy link

tolache commented Sep 1, 2021

@chuchu I ended up installing the SDK with apt instead of snap as explained here. Works like a charm.

@quentincaffeino
Copy link

Same issue on fedora 34

@NikolaMilosavljevic NikolaMilosavljevic removed the untriaged New issue has not been triaged by the area owner label Sep 8, 2021
@zezba9000
Copy link

zezba9000 commented Sep 16, 2021

I have the same issue. Installed from Snap. Ubuntu 20.04.3 LTS

This is the only thing that works. All other scripts are broken or missing docs.

sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-5.0

@flairyu
Copy link

flairyu commented Nov 18, 2021

try this:

sudo ln -s /snap/dotnet-sdk/current/dotnet /snap/bin

or

sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/bin

I don't know is it right, but it works.

@MarvinFF
Copy link

MarvinFF commented Dec 29, 2021

sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/bin is work,Thanks @flairyu

@NikolaMilosavljevic NikolaMilosavljevic added this to the Future milestone Aug 17, 2022
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