Unable to Identify the Cause of Self-Hosted Runner Failure in Bitbucket Pipelines
Asked by Robin Smith:

When I run my pipeline via a runner it fails and I cannot see why. It works fine without using the runner. My runner is on Windows. Once I know the cache is working I can add the next step. Any suggestions?

```
pipelines:
pull-requests:
feature/*:
- step:
name: Install
runs-on:
- windows
- self.hosted
- myrunner
caches:
- node
script:
- yarn install --frozen-lockfile
```


Answers:
author: Theodora Boudale
body: Hi Robin,

Pipelines builds that run on our own infrastructure or on a Linux Docker runner run in Docker containers. For every step of the pipeline, a Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file (the image atlassian/default-image:latest will be used if no image is specified). The repo is cloned in that container and then the commands from that step's script get executed. When the step finishes, the container gets destroyed.

Windows Runners do not use Docker containers. They use PowerShell to run pipeline steps on your Windows machine (host device). The repo gets cloned in a directory on your Windows machine and the commands from a step's script get executed in that directory. The Runner will attempt to empty the build directory after each step.

You can read more info about Windws Runners here:

* <https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-windows/>

What error do you get when your run this pipeline on your Windows Runner?

Please also keep in mind the following (I copied from our documentation):
> Windows Runners use PowerShell to run pipeline steps on your Windows 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.

Kind regards,  
Theodora

comments: author: Robin Smith
body: My problem is that the runner fails without an error. I see the that yarn install ends and then it reports the step fails. But I do not see why it failed.

![Notepad_VZDxT5sL5J.png](https://community.atlassian.com/t5/image/serverpage/image-id/264283i44B806876E055159/image-size/large?v=v2&px=999 "Notepad_VZDxT5sL5J.png")


author: Theodora Boudale
body: Hi Robin,

Does the Windows computer where the runner is running meet the prerequisites listed here?

* <https://support.atlassian.com/bitbucket-cloud/docs/set-up-runners-for-windows/>

Can you check the log of the runner in case there are any errors reported there?

If you have unzipped the runner in the directory C:\\Users\\Username\\atlassian-bitbucket-pipelines-runner\\, then the log will be located at

```
C:\Users\<Username>\atlassian-bitbucket-pipelines-runner\temp\<runnerUuid>\runner.log
```

If the runner log doesn't show any useful info, and if the Windows machine meets the prerequisites, I would suggest creating a ticket with the support team about this issue. If we have an open support ticket, the engineer working on it will be able to access the build log and additional logs from our side that may give an indication of why the step fails.

You can create a ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. Please make sure to provide the id of the workspace where the repo belongs and the URL of the failed build in the description.

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

cloud