Error saying my pipeline has a step section empty or null

kalib May 17, 2022

I keep receiving this error message:

There is an error in your bitbucket-pipelines.yml at [pipelines > branches > fixing-yaml > 0 > parallel > 4]. To be precise: The step section is empty or null.

It doesn't make any sense to me, I have nothing empty. even Atlassian's validator online says it's all good.

Also, the pipeline works fine, until I add another step, and it shows that.

clone:
depth: full

definitions:
caches:
sonar: ~/.sonar

steps:
- step: &lint
name: Lint
script:
- echo "Add linting here"

- step: &aws
name: AWS oidc setup
image: amazon/aws-cli
oidc: true
script:
- export AWS_REGION=us-east-1
- yum update
- yum install -y jq

- step: &sonarqube
name: SAST - SonarQube
runs-on:
- self.hosted
- linux
script:
- pipe: sonarsource/sonarqube-scan:1.0.0
variables:
SONAR_HOST_URL: ${SONAR_HOST_URL}
SONAR_TOKEN: ${SONAR_TOKEN}

-
step: &unit-test
name: Unit Test
script:
- echo "Add Unit Tests here"

-
step: &build
name: Build
script:
- ./cicd/build.sh
services:
- docker
caches:
- docker

- step: &deliver
name: Deliver
script:
- ./cicd/promote.sh

pipelines:
default: # Runs on every commit for branches not defined elsewhere
# - step: *sonarqube
- parallel:
- step: *lint
- step: *unit-test
- step: *build

pull-requests:
'**': # this runs as default for any branch not elsewhere defined
# - step: *sonarqube
- parallel:
- step: *lint
- step: *unit-test
- step: *build

branches: # these will run on every push of the branch
master:
# - step: *sonarqube
- parallel:
- step: *lint
- step: *aws
- step: *unit-test
- step: *build
- step: *deliver
This code results in that error:
There is an error in your bitbucket-pipelines.yml at [pipelines > branches > fixing-yaml > 0 > parallel > 4]. To be precise: The step section is empty or null.
But, if I simply remove the last step, leaving as:
...

...

branches: # these will run on every push of the branch
master:
# - step: *sonarqube
- parallel:
- step: *lint
- step: *aws
- step: *unit-test
- step: *build
It works fine. I can't make sense of it. Any help or suggestions?

1 answer

1 accepted

0 votes
Answer accepted
kalib May 17, 2022

Nevermind.. Found my error... I had a few spaces missing.. indentation. 

Suggest an answer

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

Atlassian Community Events