Exec bash file issue

Hello,

it's been a long time I try to execute a bash file in Node Red.
Node Red version : 4.0.2 running under docker.

The directory /usr/bin is correctly mounted but when I execute my script (with exec or exec-queue), the file is found but I have the execution error message:
"/usr/bin/gpio cannot execute: required file not found".

I try with a simple "ls" and it didn't works.

Could you help me please?

Thanks

  1. How is your exec node set up?
  2. Is that the exact error message that you get?
  3. Does the file /usr/bin/gpio exist? Is it an executable binary file or a script?

@jbudd

  1. the configuration of the noe :

  2. yes, it's exactly the message I have.

  3. The "startpwm.sh" file is in a mounted directory and recognized.
    The "startpwm.sh" file contains a list of calls of "/usr/bin/gpio" binary executable file with different options.

The script works fine out of Node-Red.

Many thanks

message deleted

I believe that the startpwm.sh script will run inside the container, therefore it will not have access to /usr/bin.

If you exec ls -al and pwd what do they show? I suspect you will find they show a container directory.

The directory contains the startpwm.sh and the /user/bin are mounted and available in the docker container.

When I execute ls -la I have the same error message.

How do you know that?

Exactly what error?

The result of "docker inspect" command:


We can see the two directories mounted : "/usr/bin" and "/var/lib/node-red" (/data)
Is possible a right access problem? I don't think about that because the error message would have been "not access right" no?
A bad bind propagation ? I specify rprivate (default value) but it could be the wrong one.
I try with shared without success.

The error when "/usr/bin/ls" is executed:
image

I copy "startpwm.sh" in /var/lib/node-red and call "/data/startpwm.sh" in exec node with the same result:
image

Many thanks

message deleted

New information, always with the exec node:

I try to execute "/bin/ls -la" (without /usr) with success:
image

The result with the command "/bin/ls -la /usr/bin/gpi*"
image
"/usr/bin/" is available in docker

The result with the command "/bin/ls -la /home/pi"
image
Normal, "/home/pi" is not mounted.

I added the "/sys/class/gpio" directory in mounted list without success.
The call to "/usr/bin/gpio" return the same error:
image

Use the docker exec command to check that you can run the commands. That will tell you whether it is a docker issue or a node-red issue.

the result:

but

lack of dependences (lib or someone else) ?

Please don't screenshot, copy/paste instead, it is much easier to understand.

What does cat /usr/bin/gpio give you, using docker exec?

ok for screen shot, sorry.

it's a binary file but at the end there is a reference to a library:
/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/crt1.o$d$a

I tried to mount /usr/lib in container but it doesn't work (container don't start).

OK, so is a docker issue, not node red. I don't have any other suggestions, apart from not using Docker. Unless you know a lot about Docker it just makes life difficult.

Thanks a lot @Colin, I will see on Docker side.
Have a good day