Pipeline Fail but no useful information about the error

ronwaldo_querol February 6, 2024

I have parallel steps - each steps use linux shell runners and execute scripts.

The scripts contains action that pulls the latest code and restarting service.

The script was use in all steps, other step is success and other is fail but on fail steps, the build teardown is same on the successful steps:

Screenshot 2024-02-07 002822.png

I'm using the latest version of pipelines-runner as of today:

atlassian-bitbucket-pipelines-runner-1.559

1 answer

1 accepted

1 vote
Answer accepted
Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2024

Hi @ronwaldo_querol,

Welcome to the community.

For your Parallel steps, would you be able to confirm if you're using the same Linux Shell runner?

Also, please be aware of how the Linux Shell runners run your scripts:

Linux Shell Runners use Bash to run pipeline steps on your Linux machine (host device). This allows the runner to execute applications on the host, but does not provide a clean build environment for every step. Any side effects generated by the step (such as, installing any applications, starting a database service, or editing a file outside of the build directory) would potentially affect the next step to be run (including new pipeline runs). To compensate for this, the runner try to empty the build directory empty after each step. It is your responsibility to make sure the scripts you run in each step won’t have a major impact on other steps.

Reference: Set up runners for Linux Shell

Regards,
Mark C

ronwaldo_querol February 8, 2024

Hi @Mark C  - no, each parallel steps use Linux Shell runner but each of them used different workspace runner.

Workspace Runners: 

Runner name: my-runner-1

Labels: self.hosted, linux.shell, my-runner-1

Runner name: my-runner-2

Labels: self.hosted, linux.shell, my-runner-2

Where is the build directory located and how we can empty after each step ?

Mark C
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 11, 2024

Hi @ronwaldo_querol


Are those runners running on the same self-hosted machine?
If yes, you can try using only 1 runner for your parallel steps and see how it goes.

The build directory is usually located from where you started the runners in your self-hosted machine.

Regards,
Mark C

ronwaldo_querol February 11, 2024

@Mark C -  no, they running on separate host instance.

So our use case is we have separate repository where we store script related to deployment including the script that run linux shell runner.

We created a linux service to start/stop the linux shell runner.

Everytime there is changes on this repository - the pipeline will access every servers(1 server = 1 step) will try to restart the linux shell runner service.

The service is actually restarting, but the status on the pipeline is failed.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 14, 2024

Hi @ronwaldo_querol,

Please allow me to step in as Mark is out of office at the moment.

You mentioned that you execute some scripts during your builds. If the command in your yml file is for example

- ./somescript.sh

You can adjust it as follows:

- ./somescript.sh || echo $?

If the execution of somescript.sh fails, then the exit code will get printed so we can see if the script returns a non-zero exit code. A Pipelines step will fail if a command returns a non-zero exit code.

You also mentioned that the pipeline will try to restart the linux shell runner service. Are you stopping the Linux Shell runner while the pipeline is running?

Kind regards,
Theodora

Like Sabine Mayer likes this
ronwaldo_querol February 15, 2024

@Theodora Boudale - thank you for pointing out that I'm trying to restart the Linux Shell runner while the pipeline is running.

All good. I tweak the script to restart the service after a period of time ensuring the pipeline build is completed before restarting the shell runner.

Like # people like this
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 19, 2024

You are very welcome @ronwaldo_querol, and thank you for the update. It's good to hear that the issue is resolved now!

Like Sabine Mayer likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events