From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Repeated call to 'touch' sometimes returns error 127

My 24/7 cRIO app is running the attached code once per second. This morning, after 5 days of operation, we saw a burst of errors in our log where the syscall to "touch /c/app/started.txt" returned error 127, which normally means sh couldn't find the binary. This happened on 15 or so sequential calls and then stopped happening. Any idea why?

0 Kudos
Message 1 of 7
(3,794 Views)

Did you log the stderr output from the System Exec call? Can you see if the issue reproduces with a full path to the touch executable (there may be something weird going on with the PATH environment variable)

0 Kudos
Message 2 of 7
(3,276 Views)

Full log output (content of error wire from the example given):

Error 5000 occurred at Handle System Call Return Value.vi:3230001 Possible reason(s):  Syscall "touch /c/app/started.txt" returned code 127 STDERR message "" Complete call chain: Handle System Call Return Value.vi:3230001 Touch Canary File.vi Bootstrap RT Application.vi

I can schedule the suggested code change on our next deployment in a few weeks. I'm not allowed to stop the application before then.

0 Kudos
Message 3 of 7
(3,276 Views)

That's odd that the STDERR output is an empty string, if it's the traditional "No such file or directory" error it will send that string to STDERR. Do the files attached to the OP reproduce the issue separated from the rest of your application?

0 Kudos
Message 4 of 7
(3,276 Views)

I don't have another cRIO to run it for days on. (It's being used for other development.) Again, this happened once, just for a few seconds, and sporadically.

Maybe the command was found but some dependency it carries wasn't? https://stackoverflow.com/questions/1763156/127-return-code-from (2nd answer). Looks like `touch` is built-in with Busybox, though, so that doesn't make sense.

0 Kudos
Message 5 of 7
(3,276 Views)

Which CompactRIO are you running this on?

0 Kudos
Message 6 of 7
(3,276 Views)

9066

0 Kudos
Message 7 of 7
(3,276 Views)