Debugging "The step provided was invalid"

I'm trying to setup PHP unit testing for our PHP application using MariaDB as a "service".

Now, as soon as I declare that my step should use the service defined in "definitions" section the pipeline fails with the message "The step provided was invalid". Whenever I remove the service from the step it works.

According to https://bitbucket-pipelines.atlassian.io/validator my bitbucket-pipelines.yml is valid.

What am I doing wrong? What does the error mean? How can I debug that error?

I currently use the following bitbucket-pipelines.yml for testing:

 

clone:
  depth: 1
pipelines:
  default:
    - step:
        image: php:7.0-apache
        script:
          - ls
        services:
          - maria
definitions:
  services:
    maria:
      image: mariadb
      environment:
        MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
        MYSQL_ROOT_PASSWORD: ''
        MYSQL_DATABASE: 'dev'  

 

1 answer

1 accepted

0 votes

Hello,

The issue is that you have an empty string for the value of the MYSQL_ROOT_PASSWORD. Pipelines fails to parse this as it is a string with no content.

An alternate way of setting the MYSQL_ROOT_PASSWORD variable to an empty string is to set MYSQL_ROOT_PASSWORD="\0".

Thanks,

Phil

Hi Philip,

Thanks for your response, I'll try that ASAP!

It would be nice if such conditions could be built into the validator (or is there some other documentation I missed?). I guess this would simplify things for you as well...

Thanks,

Mike

Hi Philip,

Since I receive a different error message now, it seems to work ;-)

Thanks again!

Mike

Ok, setting the MySQL password to "\0" did not work, instead I got the following error:

container_linux.go:247: starting container process caused "process_linux.go:320: reading syncT run type caused \"write parent: broken pipe\""

When I set a password (like 123456) it works.

Excellent! I'll open an internal issue for adding the validation logic. And I'll bring up the empty variable use-case with our PMs.

Glad to see you got things working. :)

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

682 views 0 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot