Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,293,681
Community Members
 
Community Events
165
Community Groups

Why is BitBucket not recognizing my runner's labels?

I created a Windows runner with the default labels:

- self.hosted
- windows

And added the following pipeline to the repo:

pipelines:
tags:
AssetReadingExportService-*:
- step:
name: Build the service
runs-on:
- 'windows'
script:
- dotnet build "AssetReadingExportService.csproj" -c Release -o "build/AssetReadingExportService"

I ran my pipeline, which failed because I'm targeting .net 6.0 so I needed msbuild17. I installed VS2022, and decided that I would add labels to indicate what tools are available on the runner. I've updated my runner to have the following labels:

- msbuild16
- msbuild17
- azurecli
- self.hosted
- windows

I updated the pipeline to require the specific msbuild version:

pipelines:
tags:
AssetReadingExportService-*:
- step:
name: Build the service
runs-on:
- 'msbuild17'
script:
- dotnet build "AssetReadingExportService.csproj" -c Release -o "build/AssetReadingExportService"

Now the build always fails and says no matching runner could be found.

Possibilities that I have ruled out:

  • I've made a typo - I had a co-worker double check the pipeline yaml and the labels on the runner, just to make sure I'm not missing something basic like that.
  • The original labels of the runner are cached - I deleted the runner, and created a new one with all the labels set from the beginning. Still no effect.

What am I missing here?

Note: I'm using a Windows runner because this is a mono-repo, and some of the services  require a Windows environment to build

1 answer

1 accepted

0 votes
Answer accepted
Graham Gatus Atlassian Team Apr 25, 2022

Hi @and 

For windows runners, at a minimum you will need the windows label, in addition to any further custom labels. Please see Using your Windows runner in your build configuration at https://support.atlassian.com/bitbucket-cloud/docs/configure-your-runner-in-bitbucket-pipelines-yml/ for more information.

That was the issue, thanks Graham. Is there a way to add the 'windows' label to the whole pipeline, or do I need to specify it on each step?

Like Robin Brinkhoff likes this
lliang2 Atlassian Team Apr 25, 2022

We haven't provide global option for `runs-on` at the moment, so unfortunately you have to specify it on each step

Suggest an answer

Log in or Sign up to answer
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you