Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Windows Self-Hosted Runner marks successful pipeline as failed with exit code 0

vinothkumar_sivaram
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 15, 2026

Hi Atlassian team,

I am having an issue with a Bitbucket Cloud Windows self-hosted runner.

Environment:
- Bitbucket Cloud Free
- Windows self-hosted runner
- Runner version: 6.0.7
- Runtime: windows-powershell
- OpenJDK: 25.0.4
- Runner labels: self.hosted, windows

The runner starts successfully and remains ONLINE.

The problem occurs even with a minimal pipeline containing only:

pipelines:
branches:
main:
- step:
name: Test Windows Runner
runs-on:
- self.hosted
- windows
script:
- 'Write-Host "WINDOWS RUNNER TEST"'
- 'dotnet --version'
- 'wix --version'
- 'Write-Host "RUNNER TEST SUCCESS"'
- 'exit 0'

All commands execute successfully.

The runner log shows:

Executing build script in native script

Script exited with exit code: 0

However, immediately afterward the runner reports:

Not uploading caches. (numberOfCaches: 0, resultOrError: ERROR)

The test report parsing also completes successfully:

Successfully parsed JUnit report with tests=0, failures=0, errors=0, skipped=0

Then the runner finishes with:

Completing step with result Result{status=ERROR, error=Some(Error{key='runner.bitbucket-pipelines.build-failure' ...})}

The runner remains ONLINE after the failure.

There are:
- No artifacts configured
- No cache configured
- No application build involved
- No MSI/WiX build involved

The issue therefore reproduces with a completely minimal pipeline.

Could you please help identify why the Windows self-hosted runner is marking the step as ERROR even though the script exits with code 0?

I can provide the complete runner log and pipeline run details if required.

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 17, 2026

Hi @vinothkumar_sivaram

This looks similar to a known Windows runner behavior where the script exits with code 0, but the step still gets marked as failed during cache processing afterward.

Atlassian has a KB for this here: https://support.atlassian.com/bitbucket-cloud/kb/windows-runners-builds-fail-even-on-successful-commands-0-exit-code/

A few things to check:

1. Add this in after-script to confirm the script really ends with 0:

after-script:
- $LastExitCode

2. Review your caches: config. If you use a custom cache, make sure it is properly defined under definitions: caches: and that the cache path actually exists.

3. If possible, try a rerun with the caches: block removed temporarily, just to isolate whether cache teardown is what flips the step to failed.

I hope this helps.

Regards,
Syahrul

vinothkumar_sivaram
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 18, 2026

Windows self-hosted runner 6.0.7 on Windows is reporting runner.bitbucket-pipelines.clone-failure even though the generated clone script exits with code 0 and git reset --hard succeeds.

Initially the runner produced:

fatal: Failed to write item to store. [0x6f7]
fatal: The stub received bad data

We isolated this to Git Credential Manager. We configured the runner with a system Git configuration that disables the credential helper, and the 0x6f7 error disappeared.

However, the runner now still reports runner.bitbucket-pipelines.clone-failure after:

Cloning into ...
git reset --hard <commit>
HEAD is now at <commit>
Script exited with exit code: 0

The pipeline has no caches and no artifacts. The pipeline test script is minimal.

Runner version:
6.0.7

Latest runner version:
6.0.7

We also see the following message in the runner log:

State transition received for step ... while tracking step ... , publishing existing transition

The runner is online and the clone appears to complete successfully, but Bitbucket still marks the step as a clone failure.

Regards,
Vinoth

Suggest an answer

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

Atlassian Community Events