-
Notifications
You must be signed in to change notification settings - Fork 54
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
Weird bug I cant figure out: permission denied #651
Comments
Is the command not executable in the docker image? |
In both cases the command is run in the docker image. |
Moved this issue to ODK because this is where it belongs after all :) |
So what seems to be the problem is that the I assume it works when passing through the shell (with exec or an if construct) because the shell must use a different logic when trying to find an executable (specifically, when finding a directory with the name it looks for, the shell must know to skip it and to continue searching further down the I still don’t understand how it can only happen when going through Docker and why not everybody seems affected, but at least that gives us a clear solution: fix the ODK to change the name of the |
Thank you @gouttegd! |
Nice catch @gouttegd - @matentzn is there a timeline for an update? Or should we find a workaround for EnvironmentOntology/envo#1330 (comment) ? |
I already made a pull request on ENVO! |
For information, contrary to what many of us (myself included) thought while we were debugging this issue yesterday on Slack, this is not a Docker-induced problem. I can reproduce the problem without Docker on my GNU/Linux system:
make -p ~/tools/dosdp-tools/bin
cat <<EOF > ~/tools/dosdp-tools/bin/dosdp-tools
#!/bin/sh
echo "I am here"
EOF
chmod 755 ~/tools/dosdp-tools/bin/dosdp-tools
cat <<EOF > ~/Makefile
test:
@dosdp-tools
EOF
PATH=$HOME/tools:$HOME/tools/dosdp-tools/bin:$PATH make test
make: dosdp-tools: Permission denied
make: *** [Makefile:2: test] Error 127
PATH=$HOME/tools/dosdp-tools/bin:$HOME/tools:$PATH make test
I am here So there is no Docker trickery involved here. The problem lies purely within Make, which seems to have its own logic to find an executable in the PATH (instead of using, say, Reproduced with GNU Make version 4.3 on GNU/Linux (which is also the version used in the ODK since version 1.3.1); not reproduced with GNU Make 3.81 on MacOS, and not reproduced with GNU Make 4.2.1 (which is the version used in the ODK up to version 1.3.0, before we upgraded to Ubuntu 22.04). So, looks like a bug introduced in GNU Make between 4.2.1 and 4.3. I guess people who were not affected by the problem yesterday were still using a pre-1.3.1 ODK. This also highlights a lack of coverage of our tests. We did a lot of testing after upgrading the base system to Ubuntu 22.04, but we completely missed this problem. |
For those who are curious (or if someone lands on this ticket while looking for a similar problem), it is this bug in GNU Make. It was fixed in GNU Make’s master branch two years ago, but the fix is not available in any published version yet (last release of GNU Make was 4.3, back in January 2020, before the bug was reported). So, nothing else to do here apart from the fix in #652 — and being careful with the ODK’s |
This is so super interesting. Thanks for getting to the bottom of this, I learned something today! :) |
Reported simultaneously today:
https://github.com/Southern-Cross-Plant-Science/cdno/blob/master/src/ontology/Makefile#L114
I cant figure out what is wrong. Here is what I know:
If I run using the ODK docker wrapper:
Everything works fine.
While adding the absolute identical command into a Makefile:
Does not work:
Strangely enough, the makefile works without the docker wrapper.
Any help appreciated.
The text was updated successfully, but these errors were encountered: