# YAML group merging breaks in drone-cli

**URL:** <https://drone.discourse.group/t/yaml-group-merging-breaks-in-drone-cli/1150>\
**Category:** Drone Support\
**Created:** [August 23, 2018, 1:59pm UTC](https://drone.discourse.group/t/yaml-group-merging-breaks-in-drone-cli/1150 "2018-08-23T13:59:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unlobito](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/unlobito/32/6128_2.png) [@unlobito](https://drone.discourse.group/u/unlobito)\
**Post date:** [August 23, 2018, 1:59pm UTC](https://drone.discourse.group/t/yaml-group-merging-breaks-in-drone-cli/1150/1 "2018-08-23T13:59:26Z")

</div>

Hi,

Some of the `.drone.yml` files used by my team take advantage of YAML group merging to simplify some repeated sections. This works great on the Drone server but breaks `drone exec` with an “Invalid or missing image” error message.

Following is an example of a `.drone.yml` file I’ve verified as working on Drone server 0.8.2 but fails with `drone build` using Drone CLI 0.8.6.

```auto
default_node_setup: &node_lts_carbon_build
  image: node
  pull: true

pipeline:
  lint-client-js:
    <<: *node_lts_carbon_build
    group: checks
    commands:
      - npm run lint:client:js

```

The build succeeds when run with the following, equivalent, YAML file.

```auto
pipeline:
  lint-client-js:
    image: node
    pull: true
    group: checks
    commands:
      - npm run lint:client:js

```

From a brief glance at [Drone server](https://github.com/drone/drone/blob/a85f89a3c188ea9eba0991c483bb2a2b9e855377/server/hook.go#L195) and [Drone CLI](https://github.com/drone/drone-cli/blob/e4534404669cbdcd0ac6df268914699511ba276a/drone/exec/exec.go#L321)’s YAML parsing code (linked), it seems the only difference is that Drone CLI performs additional preprocessing using envsubst (see L310 in previous link).

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [August 23, 2018, 2:10pm UTC](https://drone.discourse.group/t/yaml-group-merging-breaks-in-drone-cli/1150/2 "2018-08-23T14:10:25Z")

</div>

This is a known issue with the go-yaml parser (the yaml library we use). See [https://github.com/go-yaml/yaml/issues/184](https://github.com/go-yaml/yaml/issues/184)

We are also tracking the upstream yaml issue in the Drone issue tracker, but not much we can do until they have a fix available: [https://github.com/drone/drone/issues/2323](https://github.com/drone/drone/issues/2323)
