-
Notifications
You must be signed in to change notification settings - Fork 877
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
yarn/node execution permission denied #743
Comments
Is this project abandoned? |
dunnow, i'm having the same issue running from within a
i've already tried |
Hi @tubbynl I think problems may be different, at least the cookie thing. Here seems to be an execution permission problem, so maybe developer of this plugin should verify and update execution permission of installed tools like Yarn or Bower etc... I have forked this thing and I will try to add a method to force
|
The other problem may be a nodejs permission problem: because the error says on yarn 1 #!/bin/sh
2 argv0=$(echo "$0" | sed -e 's,\\,/,g')
3 basedir=$(dirname "$(readlink "$0" || echo "$argv0")")
4
5 case "$(uname -s)" in
6 Linux) basedir=$(dirname "$(readlink -f "$0" || echo "$argv0")");;
7 *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
8 *MSYS*) basedir=`cygpath -w "$basedir"`;;
9 esac
10
11 command_exists() {
12 command -v "$1" >/dev/null 2>&1;
13 }
14
15 if command_exists node; then
16 if [ "$YARN_FORCE_WINPTY" = 1 ] || command_exists winpty && test -t 1; then
17 winpty node "$basedir/yarn.js" "$@"
18 else
19 exec node "$basedir/yarn.js" "$@"
20 fi
21 ret=$?
22 # Debian and Ubuntu use "nodejs" as the name of the binary, not "node", so we
23 # search for that too. See:
24 # https://lists.debian.org/debian-devel-announce/2012/07/msg00002.html
25 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=614907
26 elif command_exists nodejs; then
27 exec nodejs "$basedir/yarn.js" "$@"
28 ret=$?
29 else
30 >&2 echo 'Yarn requires Node.js 4.0 or higher to be installed.'
31 ret=1
32 fi
33
34 exit $ret Possible But this seems to be happening only on container execution |
i ended up creating a build container having maving+yarn (alpine now has a yarn package) and not using the |
@tubbynl unfortunately for us. for local environment build we need consistency with the tools. so we have to keep using this. |
for what it's worth then;
The build image i created is
|
ok, after fiddling i discovered that the the fiddling also included adding |
@tubbynl can you share your solution? |
i have the same issue |
I still have no solution, I just tried building a new Docker image including nodejs and yarn on the system but that did not work given that this plugin is based on installing those binaries. I thought it was gonna be easy just to use the plugin with the system binaries but is not. |
my current "solution" is this
essentially; not using this front-end maven plugin when building on the CI; using standard node/maven alpines images to build the frontend and the backend and making sure the front-end build result is correctly included in the backend packaging structure. |
yeah, i've decided to fork this project and try to see if I can get a solution.. it is simply not making any sense having a permission issue running on bitbucket.. I think basically is missing the execution flag I think let's see where this drives me. |
@mhermosi did you have any luck? |
Hi, I was able to make this work, I am not sure if this may apply to everybody. but debugging my docker image based on alpine I realized that the error is not related with execution permission nor with yarn. it is node distribution itself. the plugin downloads node distribution which is fine. but in case of alpine linux, not sure if all other Linux images for docker (have not tried) as they are minimal linux distribution, some dependencies (shared libraries) are not available, that is the problem. So how did I overcome this was to create an image including the nodejs / npm distribution from alpine (in my case with node 8.12.0) and match that version with the one used with the plugin. once I did that, the shared libraries were present and the build worked fine. maybe we should ask the people on node to create a static linked version of their distribution to be used with this library, because finally the plugin itself is not the culprit on this. unfortunately I was not able to find which libraries are missing because alpine does not have ldd and I have not had the time to dig on it to publish a list of missing shared libraries. The example I saw with pipelines installing yarn and having node-10-alpine I think should work.... |
Oh also be aware that using nodejs on bitbucket (not sure if other CI tools) they set an env var called CI to true. that will mess your node build because CI = true will trigger automatically warning to stop the build as error do. |
Thank you for youre quick reply. The pipeline mentioned above did not get me much further. But the maven plugin is still looking for the locally installed node and can not find it. Which is kind of strange since i added a symlink to the previous installed node. This is driving me nuts :/ Unable to bring my application in production mode. |
it will keep looking for the local installed node, not the system installed one. the sole purpose of installing (on alpine using apk add nodejs and apk install nodejs-npm) is to get the library dependencies |
Still having problems after installing both it seems. I receive the following error: Transpilation with gulp has failed: 'gulp build_es6' failed. java.io.IOException: Cannot run program "/opt/atlassian/pipelines/agent/build/target/node/node" (in directory "/opt/atlassian/pipelines/agent/build/target"): error=2, No such file or directory (Yarn did succeed) I did install node in my pipeline:
And the maven plugin from the last step also states: |
mmm this means your install is working both node and yarn (yarn used node to run) so rest is another problem with your build, I don't know about Gulp if it is a binary or a node script. another thing is the error itself is not able to find the pipeline agent folder... that looks like something else |
Yes gulp doesn't matter here. What i do not understand, that the node binary is not found - although node was installed by the plugin. |
@mhermosi en @DonAscon not sure if it is still relevant for you but just posting it anyway for other people who might end up here. I ran into the same issue and found that there is a similar issue #633 which contains the answer to the problem. Basically the thing has to do with glibc which is quite a bit of a hassle on Alpine.
You will likely encounter messages like:
but it seems these can be ignored. It is definitely worth looking at the alpine-pkg-glibc repository as it contains some more detailed information and the latest available releases. Hope it helps. |
The issue is that a yarn binary that is built to be used with glibc doesn't work on Alpine out of the box, because Alpine uses musl instead of glibc as its C standard library. While you can add glibc to Alpine, I think it kind of defeats the point of using Alpine Linux, because it adds so much disk space usage to that otherwise tiny distro. You might be better off using a glibc-based Linux distribution instead (Debian Slim or something). Or, frontend-maven-plugin needs to be able to download a musl-based Yarn binary, like it already does for NodeJS (see #853). |
Hi,
We are using frontend-maven-plugin v1.6 on a Bitbucket pipeline using a custom docker image.
this issue has appeared only on that environment if I run the maven build locally it does not fail.
These are part of the maven output:
and:
I am not sure but I think yarn may need user or group execution permission. This is odd because I think alpine linux uses root directly on its docker images. I am using openjdk:8u121-jdk-alpine to build my docker image to be used on bitbucket pipeline.
thanks in advance,
Martin
The text was updated successfully, but these errors were encountered: