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

[macOS 14.4.1] “node_exporter” is damaged and can’t be opened. You should move it to the Trash. #3011

Closed
conradwt opened this issue May 11, 2024 · 10 comments

Comments

@conradwt
Copy link

Host operating system: output of uname -a

➜ uname -a 
Darwin Conrads-MacBook-Pro-2.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64

node_exporter version: output of node_exporter --version

When I run the above command, I'm getting the following error message:

Screenshot 2024-05-11 at 3 07 46 PM

node_exporter command line flags

NA

node_exporter log output

NA

Are you running node_exporter in Docker?

I'm running node_exporter as a standalone executable.

What did you do that produced an error?

./node_exporter

What did you expect to see?

I expected to see something similar to the following:

INFO[0000] Starting node_exporter (version=0.16.0, branch=HEAD, revision=d42bd70f4363dced6b77d8fc311ea57b63387e4f)  source="node_exporter.go:82"
INFO[0000] Build context (go=go1.9.6, user=root@a67a9bc13a69, date=20180515-15:53:28)  source="node_exporter.go:83"
INFO[0000] Enabled collectors:                           source="node_exporter.go:90"
INFO[0000]  - boottime                                   source="node_exporter.go:97"
...
INFO[0000] Listening on :9100                            source="node_exporter.go:111"

What did you see instead?

Screenshot 2024-05-11 at 3 07 46 PM

@conradwt
Copy link
Author

It's a codesigning issue because I was able to use the following to get things working:

codesign -vvv \
  --force \
  --strict \
  --timestamp \
  --options=runtime \
  --sign "Developer ID Application: <NAME> (<TEAMEID>)" ./node_exporter

After you run the executable, one will see the following message:

Screenshot 2024-05-11 at 4 55 44 PM

Then navigate to Settings -> Privacy & Security and click the 'Open Anyway' button towards the bottom of the page.

@SuperQ
Copy link
Member

SuperQ commented May 12, 2024

👓 @gitperr

@SuperQ
Copy link
Member

SuperQ commented May 12, 2024

You should consider upgrading from v0.16.0. This version is out of date by 6 years.

We also introduced code signing in the latest v1.8.0 release,

@conradwt
Copy link
Author

conradwt commented May 12, 2024

@SuperQ Yes, the errors that I'm getting are coming from node_exporter v1.8.0. The example output is simply an example of what I expect to see when starting the executable.

@gitperr
Copy link
Contributor

gitperr commented May 12, 2024

@SuperQ I think #3008 did not make it into that release you mentioned, we might have forgotten to cut a new release after it was merged.

And just out of curiosity, what was the download method? Even if you download a rcodesign signed binary using Safari directly, it errors out. I try with wget or curl usually, then untar. I was able to make it work like that at least.

@conradwt
Copy link
Author

@gitperr I downloaded it from the releases page on GitHub using Chrome. In any case, I'm seeing the following after I use wget and tar:

./node_exporter --version
[1]    6596 killed     ./node_exporter --version

I believe the codesigning and notarization should be a part of the CI workflow.

@gitperr
Copy link
Contributor

gitperr commented May 12, 2024

Code signing was added as SuperQ mentioned, but did not make it to the release you downloaded. Let's try again when a new release is cut including #3008

@TechieGenie
Copy link

Following the steps in this thread worked - #3008 (comment)

Yes, this codesigned binary needs to be released to make this a seamless process 👍

@gitperr
Copy link
Contributor

gitperr commented May 25, 2024

@conradwt Now the code signed binary is released, please retry downloading and opening node exporter following these steps:

1- get with curl instead of downloading using a browser, make sure it is the correct arch. Here I put arm

curl -L https://github.com/prometheus/node_exporter/releases/download/v1.8.1/node_exporter-1.8.1.darwin-arm64.tar.gz --output node_exporter.tar.gz

2- untar it

tar xvfz node_exporter.tar.gz

3- cd into the untarred directory and run it

cd node_exporter-1.8.1.darwin-arm64 && ./node_exporter

Downloading via a web browser does not work because we are signing with rcodesign instead of Apple's own codesign, until we get Mac build machine, this solution should work.

@conradwt
Copy link
Author

@gitperr I was able to download via the browser and simply click the button within Privacy & Security. Thus, it's working as expected now and please feel free to close this issue.

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