I have a weird issue where hadolint fails when pan...
# general
r
I have a weird issue where hadolint fails when pants run it but works if I run it manually by directly calling
hadolint
I don’t even get very helpful error message from pants. No idea what
exit code -11
supposed to mean.
Copy code
12:48:24.11 [ERROR] Completed: Lint with Hadolint - hadolint failed (exit code -11).
The only issue I can think of is I only recently updated to macos ventura. Although it wasn’t failing just after the update. It’s only with some changes I have made that it fails. If I revert to a previous commit, it works. It’s all so mysterious sadly
w
Anything when you run in debug mode?
./pants whatever -ldebug
Also, when you use --keep-sandboxes=on_failure and then manually the generated
__run.sh
script, does it work or failover?
r
yeah have been looking at that. Nothing really. The only thing is see is
Copy code
Signal 15 (SIGTERM) was raised. Exiting with failure.
👀 1
w
Well that can't be good - does it work or fail when you run in the sandbox using the run script?
r
let me try the run script
w
Also also, when you do it manually - are you using the same version of hado as Pants? (I can't recall if it installs something, or if it uses the system binary)
r
yeah I checked hado version on mac and inside pants and they are the same which was v2.10.0 I also tried to use the hadolint v2.12.0 which says something about buidling macos ventura but that doesn’t help. In the process though I opened a pull request on pants to update it to v2.12.0 https://github.com/pantsbuild/pants/pull/17791
w
mac m1?
r
No just intel
w
I don't think it's related to this - but putting this here so I don't have to search for it later: https://pantsbuild.slack.com/archives/C046T6T9U/p1665673558191199?thread_ts=1665581842.605619&cid=C046T6T9U
No just intel
NVM then, my example was an arm problem
r
The only thing I got from the
__run.sh
run
Copy code
./__run.sh: line 5: 55455 Segmentation fault: 11
I feel like it has something to do with the ventura but not sure how to reproduce it
Something’s wrong with binary pants downloads for hadolint in the sandbox
Copy code
➜  pants-sandbox-g7Yhuj ./hadolint-Darwin-x86_64
[1]    56882 segmentation fault  ./hadolint-Darwin-x86_64
w
Sorry, which version of pants?
r
2.14.0
w
https://github.com/pantsbuild/pants/blob/2.14.x/src/python/pants/backend/docker/lint/hadolint/subsystem.py Could you manually `curl`/`wget` your version of hadolint that is specified here and run it? Let's go to first principles here
r
yeah doing that exactly 😉
coke 1
So I downloaded the version directly from github and that has also segmentation fault but then I installed the same version (2.12.0) from brew, it works
🤯 1
h
hm are there newer versions available?
w
Hmmmmmmm
@refined-addition-53644 Are you able to try 2.12 in pants? https://www.pantsbuild.org/docs/reference-hadolint#version
Hmm, guess you also need to add known_versions?
r
yeah I did
That pull request has been generated because I spent time in generating known_versions
w
🎉
THanks!
👍 1
I'm starting with a new docker project that I'll want hadolint on - and I'm on Ventura 🙂
🤞 1
h
so it works with 2.12?
r
No it doesn’t when using pants or directly downloading from github. It only works when I install using brew
2
So it looks like building from source is what’s working since I think that’s what brew does.
h
hm if there isn't yet a ticket, it'd probably be helpful to open a bug report in their repo. A lot of times maintainers don't own that specific hardware so don't know when things break
how about other versions other than 2.12?
w
Copy code
⏺ ~/Downloads % ./hadolint-Darwin-x86_64                                                                                                                                                                                                                                  ⎇ 
zsh: segmentation fault  ./hadolint-Darwin-x86_64
Wow... yeah
r
This was supposed to be fixed but it looks like it hasn’t been. There is a beta release https://github.com/hadolint/hadolint/issues/897 I tried all older versions and they don’t work either now.
h
cool that beta release should work with Pants
w
Beta appears to work on my machine
It's unfortunate, it was crashes that got me to stop using hadolint a year or so ago 😢
😢 2