[solved] Builds keep failing: "clone: skipped"

The affected repository is here: GitHub - hwittenborn/mpm

Here’s my .drone.yml file at the time of writing:

---
name: Build and Publish (Alpha Release)
kind: pipeline
type: docker
environment:
  release_type: alpha
  DPKG_FRONTEND: noninteractive
trigger:
  branch:
    - alpha
steps:
  - name: build
    image: ubuntu
    commands:
      - scripts/build.sh

Every time I initiate a build, I keep getting Build and Publish (Alpha Release) - clone: skipped

I used to see "trigger: skipping build, no matching pipelines","pipeline":"Build and Publish (Alpha Release)" in my logs, but now I’m just not getting anything new.

Anything I can try?

Update: nothing that’s explaining anything, but running drone exec --branch alpha is working on my local machine

All the issues seemed to go away after moving the environment stuff to the build step - would there be any reason that happened?

I followed the link to your failed commit and to the relevant Drone build (screenshot below) and I don’t see clone skipped. The clone step is executed and your build step is failing with the following error:

sed: -e expression #1, char 21: unknown option to `s’

This seems to have been fixed when you updated your yaml in this commit. I do admit I found this thread to be a bit unclear, so apologies if I am misunderstanding the question.

That’s my bad, I should’ve linked to the commit where everything was happening.

The relevant commit appears to be located here, with the corresponding Drone build here.

from what I can see, the pipeline in question was killed (canceled) which is why the steps were not executed, and the overall pipeline status is killed. This would be unrelated to yaml or environment syntax.

Just tried restarting the build - it looks like it started running.

Not really sure why it’s working now(definitely didn’t cancel it, all the builds around it had the same ‘skipped’ error) - I’ll see if I can get the global environment variables working later today though.

You can tell the pipeline is cancelled based on the status icon (red icon). If you hover over the status icon, you can see the state is killed, or you can view the raw json data to see the status (at https://drone.hunterwittenborn.com/api/repos/hwittenborn/mpm/builds/19).

all the builds around it had the same ‘skipped’ error

Not to be too pedantic, but skipped is not an error. When the pipeline is cancelled, we expect each individual step to have the skipped state if they have not yet started. If there are no logs to display for a step in the user interface because (i.e. because it was skipped) we display the skipped state in a yellow bar in place of the logs.

So because the pipeline was killed (canceled) and because steps were skipped, the behavior you are describing does not sound out of the ordinary based on the information I have at my disposal.

Got no clue what’s going on, but this commit (and the one before it) just started acting up after I moved everything to be global environment variables. (related CI build)

I got debug logging going as well - I’m seeing some stuff where it looks like it triggered, but I’m not seeing any errors in it:

  "msg": "trigger: skipping pipeline, does not match branch",
  "msg": "",
  "msg": "manager: accept stage",
  "msg": "manager: stage accepted",
  "msg": "manager: fetching stage details",
  "msg": "manager: stage is complete. teardown",
  "msg": "manager: build is finished, teardown",
  "msg": "api: root access granted",
  "msg": "",
  "msg": "manager: request queue item",

The ‘skipping pipeline’ part on the first line is just the stable pipeline being skipped(alpha pipeline was triggered here).

your pipeline is in an error state due to a yaml parsing error:

yaml: unmarshal errors:\n line 11: cannot unmarshal !!map into string

I can see this by looking at the raw json data:
https://drone.hunterwittenborn.com/api/repos/hwittenborn/mpm/builds/82

I believe the source of this specific error is that you are trying to use secrets with pipeline-level environment variables. Pipeline-level environment variables are static and do not support dynamic values from secrets, which is why you are getting a parsing error when you try to use this syntax.

It also looks like you are running drone/drone:latest which is the unstable release from master. I am guessing you have an outdated build, because when there is a yaml error, I see the error message reflected in the user interface:

Please keep in mind that when you run drone/drone:latest it is an unstable build. Ideally you should run a stable release, but if you are going to run an unstable build, you should be prepared to regularly update your image to ensure you are getting bug fixes and improvements.

That’s it, pretty sure the secrets have been causing all the issues. I’ll check things out and report back on it.

Regarding the unstable builds, is version 1 the only stable release at the moment? I saw that the documentation had it set to that, but everything else I’ve seen has had everything on v2, which I thought was only available with the latest tag. Is there any specific tag I should use?

Edit:
Moving the secrets to individual steps did the trick.