-1

When I run the Bitbucket pipeline I always have this strange error I can't resolve: In the build log

   --env=COMMAND="./ansible/deploy-dev.sh" \
   --env=MODE="script" \
   --env=SERVER="$SSH_JUMP_HOST" \
   --env=SSH_KEY="$SSH_JUMP" \
   --env=SSH_USER="$SSH_JUMP_USER" \
...
...
Status: Downloaded newer image for bitbucketpipelines/ssh-run:0.4.0
INFO: Executing the pipe...
/pipe.sh: line 26: SERVER: SERVER variable missing.

SERVER variable is set and provided by a repository variable.

bitbucket-pipelines.yml

...
    branches:  
      develop:
        - step:
            script:
                - pipe: atlassian/ssh-run:0.4.0
                  variables:
                    SSH_USER: $SSH_JUMP_USER
                    SERVER: $SSH_JUMP_HOST
                    SSH_KEY: $SSH_JUMP
                    MODE: "script"
                    COMMAND: "./ansible/deploy-dev.sh"

Someone has a clue, I going nuts !?

nilsM
  • 107
  • 8

1 Answers1

0

The Atlassian team answered me:

I've seen this error occur because of incorrect indentation in the bitbucket-pipelines.yml file.

Indentation should be two spaces, except for the level after - step: which should be four spaces, as follows. Note also indentation in variables section:

pipelines:
  branches:
    develop:
      - step:
          script:
            - pipe: atlassian/ssh-run:0.4.0
              variables:
                SSH_USER: $SSH_JUMP_USER
                SERVER: $SSH_JUMP_HOST
                SSH_KEY: $SSH_JUMP
                MODE: "script"
                COMMAND: "./ansible/deploy-dev.sh"

Can you check the content of your bitbucket-pipelines.yml file in our validator here https://bitbucket-pipelines.atlassian.io/validator ?

double-beep
  • 5,031
  • 17
  • 33
  • 41
nilsM
  • 107
  • 8
  • I've used lots of pipes with variables and as far as I can tell: question indentation is fine and this answer indentation is wrong – N1ngu May 08 '22 at 02:15
  • I just had similar problem, unfortunately I was unable to detect exact reason, but it was something related to formatting, all I've changed is swapped two lines with variables. Mystics in action :). Didn't had similar issues previously, had written quite a lot of pipelines. – Alexander Nemsadze Jul 04 '22 at 20:56