Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Pipeline Build Setup: /bin/sh: /usr/bin/mkfifo: not found

ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2019

Bitbucket Pipelines shows me in the very first line of the very first operation ("Build setup") the following error message:

/bin/sh: /usr/bin/mkfifo: not found

then this first operation finishes without error, the pipeline step is just NOT executed and next is Build teardown. Here the full log:

/bin/sh: /usr/bin/mkfifo: not found
+ umask 000

+ GIT_LFS_SKIP_SMUDGE=1 retry 6 git clone --branch="test" --depth 1 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/$BITBUCKET_REPO_FULL_NAME.git $BUILD_DIR
Cloning into '/opt/atlassian/pipelines/agent/build'...

+ git reset --hard 0ffb0fce5f9a57d9d6f5f71a2e8e7ca25f948ea8
HEAD is now at 0ffb0fc prepare release

+ git config user.name bitbucket-pipelines

+ git config user.email commits-noreply@bitbucket.org

+ git config push.default current

+ git config http.${BITBUCKET_GIT_HTTP_ORIGIN}.proxy http://localhost:29418/

+ git remote set-url origin http://bitbucket.org/$BITBUCKET_REPO_FULL_NAME

+ echo ".bitbucket/pipelines/generated" >> .git/info/exclude

+ chmod 777 $BUILD_DIR

Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.

This looks like an error to me in the build setup as the setup is using something it does not provide.

Also I'm a bit puzzled as my pipeline is made red with no specific error information on the level of the pipeline.

This is how it looks like in a screenshot:

Selection_053.png

2 answers

1 accepted

0 votes
Answer accepted
ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 19, 2019

The error

/bin/sh: /usr/bin/mkfifo: not found

is caused when Atlassian Bitbucket Pipelines starts the build container (one build container runs for each pipeline step).

The command on run which causes the error is:

/bin/sh -c exit $( (/usr/bin/mkfifo /opt/atlassian/pipelines/agent/tmp/build_result ⤦
⤥&& /bin/cat /opt/atlassian/pipelines/agent/tmp/build_result) || /bin/echo 1)

Point in case with the "busybox" image from Docker Hub in use is, that there is no

/usr/bin/mkfifo

but

 /bin/mkfifo

A workaround is to modify the image adding a symbolic link:

 <<'EOD' docker build -t "pipelines:busybox" -
FROM busybox
RUN set -eux; \
mkdir -p /usr/bin; \
ln -s /bin/busybox /usr/bin/mkfifo;
EOD

 The new image can be used until busybox is supported out of the box (again?) on Atlassian Bitbucket Cloud.

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 17, 2019

Hello @ktomk,

Welcome to the Community!

I'm actually not a Pipelines expert, but does the build use the default Docker image or a custom one? My guess is that you use a custom image which has an issue. If my assumption is correct, have you tried running your pipeline locally using the same image?

Cheers,
Daniil

ktomk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 18, 2019

Dear @Daniil Penkin  ,

thank you for your warm welcome!

The problem seems to be that the image I use has the "mkfifo" utility at "/bin/mkfifo" but Bitbucket Pipelines expects it to be at "/usr/bin/mkfifo".

Changing the Docker image worked for me, if it's helpful: a symbolic link could do the trick.

It's "busybox" from the official images on Docker Hub which is quite popular.

So probably it should be "/bin/mkfifo" or just "mkfifo" in the first place (as some Linux containers might differ there but have it in the "$PATH") when the container is run.

While looking into it, I also ran over: Understanding the bin, sbin, usr/bin , usr/sbin split (Rob Landley; Dec 2010; Busybox mailinglist) which has some folklore about these directories.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events