Hello,
During the execution of the jenkins declartivie pipeline; one of the stages step shell script throws below generic error.
I have tried to research about this error code over the internet. Not able to find a solution. Below solution seems to be promising but it didn’t worked for me[1].
Here are the steps:
Our current Jenkins Controller and Jenkins Agent Architecture is serverless[2]
Jenkins Agents build docker images using Kaniko[3]
It is successfully able to build the docker image and push to the ECR. Shell Script doesn’t exit and go to the next stage as below screenshot.
There’s a lot going on in that screenshot. What is your question? How to work around a bug? I’m sure the ticket has more details than we do. Why touch isn’t found? It’s either not installed, not in path or wrong arch
@halkeye My question is why the temporary durable shell task step hangs after successful execution of last multiline shell script command. The bash command touch not found seems to be misguiding me. Under the hood if there is something happening i don’t have any clue. I am trying to understand if anyone experienced similar issue with kaniko container image build or any known workaround solutions.
Looks like there’s a background script that runs touch on the log file every 3 seconds
Then the error message is triggered when the log hasn’t been updated in 2-3 seconds.
Considering your screenshot says touch isn’t found, its likely the culpret. I don’t know why you are getting the response of touch not found. Maybe the shebang, does /busybox/sh have a working touch? if you run touch /dev/null does it error? how about arch $(which touch) or ldd $(which touch) which may tell you if you are using the wrong arch or missing libraries or something.
@halkeye Thanks for the above details. Few observations to your points. It doesn’t matter what shebang i use it #!/bin/bash or #!/busybox/sh the behaviour is consistent. touch command is not found after the shell command kaniko executor. Below is the screenshots of the output.
I wonder if kaniko messes with path or anything. Maybe try an echo $PATH maybe echo $SHELL won’t hurt either.
It very much doesn’t feel like a jenkins issue which is making it harder and harder to debug. I’ve also never used kaniko so i don’t know how it works. It feels like its messing with your shell somehow.
@halkeye i found the root cause of the issue. It is due to Kaniko executor argument --skip-unused-stages=true. After removing it. All the things are working as expected.