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 web app Exiting with error code 139 after running dotnet watch #23197

Open
mrparadox213 opened this issue Dec 28, 2021 · 7 comments
Open

Comments

@mrparadox213
Copy link

Problem encountered on https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/install
Operating System: linux (Linux mint 20.2)

I generated a ASP.NET project template but when i cd into the directory and run sudo dotnet watch i get the following error code
I Installed the dotnet SDK using snap

watch : Exited with error code 139
watch : Waiting for a file to change before restarting dotnet...

@jeffhandley
Copy link
Member

Hello @mrparadox213. I'm unable to reproduce this issue in my environment. Error code 139 might indicate something is amiss with permissions, and I generally have not needed to use sudo for running dotnet.

Can you confirm that you followed all the setup steps for installing .NET with Snap?
https://docs.microsoft.com/en-us/dotnet/core/install/linux-snap

If so, we'll need more information on how to reproduce this. Was everything successful as expected leading up to running dotnet watch?

@mrparadox213
Copy link
Author

Hi thanks for your reply @jeffhandley i did follow the steps ts install dotnet SDK and using sudo is a must because when running dotnet it reply with a permission denied error message

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

@jeffhandley
Copy link
Member

Thanks for the confirmation, @mrparadox213. I'm going to transfer this issue to the dotnet/sdk repository for further triage/investigation by that team.

@jeffhandley jeffhandley transferred this issue from dotnet/core Dec 29, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Watch untriaged Request triage from a team member labels Dec 29, 2021
@default-writer
Copy link

FIX:

Probably, you can update documentation, to add export PATH to .bashrc, as well, otherwise it is good

~/.bashrc

# dotnet
export DOTNET_ROOT=/snap/dotnet-sdk/current
export PATH=$DOTNET_ROOT:$PATH

# bash parameter completion for the dotnet CLI

_dotnet_bash_complete()
{
  local word=${COMP_WORDS[COMP_CWORD]}

  local completions
  completions="$(dotnet complete --position "${COMP_POINT}" "${COMP_LINE}" 2>/dev/null)"
  if [ $? -ne 0 ]; then
    completions=""
  fi

  COMPREPLY=( $(compgen -W "$completions" -- "$word") )
}

@default-writer
Copy link

default-writer commented Dec 30, 2021

Hi thanks for your reply @jeffhandley i did follow the steps ts install dotnet SDK and using sudo is a must because when running dotnet it reply with a permission denied error message

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

I have a solution for the sudo-ers in snap package users:

  1. Add export PATH to ~/.bashrc
export DOTNET_ROOT=/snap/dotnet-sdk/current
export PATH=$DOTNET_ROOT:$PATH
  1. Add dotnet group and add it to sudo-ers
sudo groupadd dotnet
sudo usermod -aG dotnet $USER

Logoff and login to reapply rules

newgrp dotnet

@pranavkm pranavkm removed untriaged Request triage from a team member Area-Watch labels Jan 26, 2022
@pranavkm
Copy link
Contributor

@marcpopMSFT this issue is not specific to dotnet-watch. @funcelot points out that the documentation for installs via SNAP might be missing some steps:

Probably, you can update documentation, to add export PATH to .bashrc, as well, otherwise it is good

Presumably it's this page - https://docs.microsoft.com/en-us/dotnet/core/install/linux-snap. Do you know who the best person to follow on this might be?

@marcpopMSFT
Copy link
Member

@dleeapho who's our best contact for snaps?

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

No branches or pull requests

5 participants