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

Permission Denied When Installing on MacBook M1 #634

Closed
JoeMayo opened this issue Mar 18, 2021 · 6 comments · Fixed by #639
Closed

Permission Denied When Installing on MacBook M1 #634

JoeMayo opened this issue Mar 18, 2021 · 6 comments · Fixed by #639
Assignees
Milestone

Comments

@JoeMayo
Copy link
Contributor

JoeMayo commented Mar 18, 2021

In what area(s)?

/area runtime
/area operator
/area placement
/area docs
/area test-and-release

Ask your question here

I have a Macbook M1 machine, trying to install Dapr via the MacOS instructions at docs.dapr.io.

When typing this command:

sudo curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | /bin/bash

I received the following output:

The darwin_arm64 arch has no native binary, however you can use the amd64 version so long as you have rosetta installed
Use 'softwareupdate --install-rosetta' to install rosetta if you don't already have it
Installing Dapr CLI...

Getting the latest Dapr CLI...
Installing v1.0.1 Dapr CLI...
Downloading https://github.com/dapr/cli/releases/download/v1.0.1/dapr_darwin_amd64.tar.gz ...
cp: /usr/local/bin/dapr: Permission denied
Failed to install dapr
Failed to install Dapr CLI
For support, go to https://dapr.io

This is a relatively new machine and I haven't changed any folder permissions - so this is how it ships. Here are my permissions for /usr/bin:

drwxr-xr-x  18 root  wheel  576 Mar 15 19:16 bin

The /usr/bin folder doesn't already have a dapr folder. I have Rosetta installed. Also, I added the sudo after getting Permission Denied, but that didn't help. I'll try the manual install if I don't find the answer, but still wondering what I'm missing?

@artursouza artursouza transferred this issue from dapr/dapr Mar 18, 2021
@wcs1only
Copy link
Contributor

Do you have homebrew installed? I think homebrew uses /usr/local/bin and I think we may be implicitly relying on that. Or something may have changed in 11.0.

@JoeMayo
Copy link
Contributor Author

JoeMayo commented Mar 18, 2021

Docs say Homebrew isn't supported for M1 Macs.

@JoeMayo
Copy link
Contributor Author

JoeMayo commented Mar 18, 2021

I was able to install Homebrew, but received the following message when installing Dapr:

% brew install dapr/tap/dapr-cli

==> Installing dapr-cli from dapr/tap
==> Downloading https://github.com/dapr/cli/archive/v1.0.1.tar.gz
Already downloaded: /Users/jmayo/Library/Caches/Homebrew/downloads/ad085975abab3e5e95b51551ac63df6047daeb8c4bb881d5d1a9f49742ff6a23--cli-1.0.1.tar.gz
==> go build -ldflags -X main.version=1.0.1 -X main.apiVersion=1.0 ./cli
Last 15 lines from /Users/jmayo/Library/Logs/Homebrew/dapr-cli/01.go:
2021-03-18 10:03:59 -0700

go
build
-ldflags
-X main.version=1.0.1 -X main.apiVersion=1.0
-o
./cli

# github.com/shirou/gopsutil/process
/Users/jmayo/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/shirou/gopsutil@v2.20.2+incompatible/process/process_darwin.go:576:34: undefined: KinfoProc
/Users/jmayo/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/shirou/gopsutil@v2.20.2+incompatible/process/process_darwin.go:577:8: undefined: KinfoProc
/Users/jmayo/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/shirou/gopsutil@v2.20.2+incompatible/process/process_darwin.go:590:32: undefined: KinfoProc
/Users/jmayo/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/shirou/gopsutil@v2.20.2+incompatible/process/process_darwin.go:594:62: undefined: KinfoProc

Do not report this issue to Homebrew/brew or Homebrew/core!

@JoeMayo
Copy link
Contributor Author

JoeMayo commented Mar 20, 2021

Got it - a bug in the install script. On line 37, change:

if [ "$OS" == "linux" ] && [ "$DAPR_INSTALL_DIR" == "/usr/local/bin" ]; then

to:

if [[ "$OS" == "linux" || "$OS" == "darwin" ]] && [ "$DAPR_INSTALL_DIR" == "/usr/local/bin" ]; then

That's because in line 36:

OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')

uname returns Darwin, which in turn makes OS be darwin. So you have to check for both linux and darwin.

@yaron2
Copy link
Member

yaron2 commented Mar 20, 2021

Got it - a bug in the install script. On line 37, change:

if [ "$OS" == "linux" ] && [ "$DAPR_INSTALL_DIR" == "/usr/local/bin" ]; then

to:

if [[ "$OS" == "linux" || "$OS" == "darwin" ]] && [ "$DAPR_INSTALL_DIR" == "/usr/local/bin" ]; then

That's because in line 36:

OS=$(echo `uname`|tr '[:upper:]' '[:lower:]')

uname returns Darwin, which in turn makes OS be darwin. So you have to check for both linux and darwin.

Great you found the bug.
Would you like to submit a PR to fix this?

@JoeMayo
Copy link
Contributor Author

JoeMayo commented Mar 20, 2021

Thanks - Working on it now.

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

Successfully merging a pull request may close this issue.

4 participants