Closed bck01215 closed 5 months ago
Thank you for reporting the issue. We run this comment whenever we update the Static Analysis engine to ensure the Mac OS does not mark it as a quarantined file, which prevents it from being executed.
Do you mind sharing if you are using an admin account? I assume you are not but would like to be sure.
Correct, I am. The issue appears to be that -r is not a recognized flag for my xattr
The issue appears to be that -r is not a recognized flag for my xattr
That is interesting because it seems that -r
has been supported for quite a while - I found this reference from a 2012 book.
Regardless, what happens when you run the command without the r
?
"xattr" -d com.apple.quarantine /Users/username/Library/Application\ Support/Code/User/globalStorage/datadog.datadog-vscode/file-downloader-downloads/staticAnalyzer-0.3.4/datadog-static-analyzer-server
If the command above works, do you see the Static Analysis version on the Datadog Menu? You can open it by clicking on the Datadog Status item as indicated below:
No such xattr: com.apple.quarantine
I can run the binary so it appears to be trusted, but I do not see the static analysis engine running
I do see the version pop up
Awesome!
Again thank you for reporting the issue and helping out debugging it. I will try to reproduce it here and also discuss if we should simply remove the -r
option given that we are changing the attributes of a single file.
We will update this issue as we progress.
Hi @bck01215, can you tell us whether you were actually having an issue with the static analysis feature or you just realized you had this error in the Datadog Output
? I mean, did you really need to run the xattr
command at all? We were unsure about that and it would be really useful for us to try to mitigate this issue in the future. Thanks!
@robertohuertasm I expected the static analysis tool to immediately start automatically. It did not do this until after I follow the steps and manually analyzed workspaces through the menu. Now it appears to be automatically analyzing other workspaces. I'm not sure if that's a big or just something unclear in the documentation.
The expected behaviour would be the following:
static-analysis.datadog.yml
file.
So basically, there are 2 kinds of analysis.
Now, for what I understood from your message, you seem to imply that the workspace
analysis is happening automatically for you. Is that correct?
It would be awesome if we could get more feedback on that as if that's happening to you, it's definitely a bug.
On the other hand, regarding the issue about xattr
, we have provided a fix that will be out in the next release.
Thanks again @bck01215 for your help and feedback ❤️!
Correct, so now it is operating as you described but it didn't work that way until I ran the workspace analysis initially. Now working in other workspaces it appears to be working that way.
I attempted to remove and re-install the extension to reproduce the issue. Upon opening a Dockerfile it prompted as expected. It's possible that originally when navigating with the extension I simply did not open compatible languages and stumbled upon the error message before seeing it work
@bck01215 that may make sense. We will keep an eye on the behaviour you described and see if we can reproduce it. Let us know if it happen again to you.
Next version will incorporate the feedback you provided and fix the issue with the xattr
command.
Getting this error when attempting to use code analysis in the datadog extension