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

Expected a mapping or list of mappings for merging, but > found scalar

James Carter
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!
June 13, 2023

I really don't get why this simplistic bitbucket pipeline is throwing the yaml syntax error:

There is a YAML syntax error in your bitbucket-pipelines.yml at [line 3, column 13]. Expected a mapping or list of mappings for merging, but found scalar

 

definitions:
  steps:
    - step: &prep_base_images
      name: Docker compose build base images
      image: docker:latest
      deployment: test
      script:
        - echo "hello world"

# Actual pipelines
# ==============================================================================
pipelines:
  branches:
    BLAH-137-backend-and-cicd-update:
      - step:
          <<: *prep_base_images
          deployment: development

 

Does anyone have any ideas?

1 answer

1 accepted

1 vote
Answer accepted
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 14, 2023

My first wild guess would be indentation.

Instead of:

definitions:
  steps:
    - step: &prep_base_images
      name: Docker compose build base images

Try:

definitions:
  steps:
    - step: &prep_base_images
        name: Docker compose build base images

Can you see that "name" was indented?

I am not sure if it is required or only a best practice in this file, but if it is required, then it could be the cause.

Ian Klek January 24, 2024

This saved me, thanks! sadly bitbuckets yml validation feature was pathetic and always stated it was valid!

Like Aron Gombas _Midori_ likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events