# Conversion extension errors are silently skipped over

**URL:** <https://drone.discourse.group/t/conversion-extension-errors-are-silently-skipped-over/12506>\
**Category:** Drone Support\
**Created:** [September 12, 2022, 11:58am UTC](https://drone.discourse.group/t/conversion-extension-errors-are-silently-skipped-over/12506 "2022-09-12T11:58:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![laney](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/laney/32/7116_2.png) [@laney](https://drone.discourse.group/u/laney)\
**Post date:** [September 12, 2022, 11:58am UTC](https://drone.discourse.group/t/conversion-extension-errors-are-silently-skipped-over/12506/1 "2022-09-12T11:58:59Z")

</div>

tl;dr when our conversion extension reports an error the Drone build is silently not created

In our CI (in this case triggered on merges to our main branch in GitHub) we have a conversion extension. One of the things it does is fetch secrets.

Sometimes that can fail for various reasons. In that case, we report an error via the extension in the normal way by returning a Go error.

In the logs from the Drone server we see a message like:

```auto
{
  "commit": "xxx",
  "error": "got an error trying to find secret yyy: secret not found\n\n",
  "event": "push",
  "level": "warning",
  "msg": "trigger: cannot convert yaml",
  "ref": "refs/heads/master",
  "repo": "grafana/xxx",
  "time": "2022-09-01T16:46:20Z"
}

```

the `error` text comes from our code, and the `msg` comes from [the drone server](https://github.com/harness/drone/blob/dbb6d3c97680729abb366a3dfdf52a055f486da3/trigger/trigger.go#L227). So the error makes it back to the server.

[It’s also reported in the UI](https://drive.google.com/file/d/1DRs45mDY6RQtXXmoDQowPUJ3Y0cE0D-f/view?usp=sharing) (don’t appear to be able to directly upload images here).

The problem is that this is reported as a **status 200** back to GitHub and the run is skipped silently. On our side we see it as the run simply not being triggered (the status check is not created), but the commit has a green check mark from our other actions.

Since the runs performs some critical business functions for us (synchronising Kubernetes manifests to be deployed by Flux), we really can’t have silent failures to execute. We need to have a way to have these conversion plugin failures surfaced so we can take action. I did have two ideas

- Report a non-200 status. (But I’m not sure what GitHub would do with that.)
- Report a created build but have it fail with the same error message. In our case we have alerting configured for this already so on-call engineers would be notified of the failure.

feel free to take them or leave them.

---

<div class="post-metadata">

**Author:** ![laney](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/laney/32/7116_2.png) [@laney](https://drone.discourse.group/u/laney)\
**Post date:** [September 12, 2022, 12:06pm UTC](https://drone.discourse.group/t/conversion-extension-errors-are-silently-skipped-over/12506/2 "2022-09-12T12:06:35Z")

</div>

Might be related: [Drone vault plugin (reporting problems, errrors)](https://drone.discourse.group/t/drone-vault-plugin-reporting-problems-errrors/9704)

---

<div class="post-metadata">

**Author:** ![Shruthikini](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/shruthikini/32/7942_2.png) [@Shruthikini](https://drone.discourse.group/u/Shruthikini)\
**Post date:** [September 13, 2022, 6:43pm UTC](https://drone.discourse.group/t/conversion-extension-errors-are-silently-skipped-over/12506/3 "2022-09-13T18:43:08Z")

</div>

@laney nice to see you pinging us after a longtime 😃

I have shared this issue internally and the team is working on it. I will keep you updated on this!

Thanks

---

<div class="post-metadata">

**Author:** ![brad](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/brad/32/4172_2.png) [@brad](https://drone.discourse.group/u/brad)\
**Post date:** [September 13, 2022, 7:24pm UTC](https://drone.discourse.group/t/conversion-extension-errors-are-silently-skipped-over/12506/4 "2022-09-13T19:24:58Z")

</div>

I am reading through this thread, and it sounds like Drone is creating an entry for the Build in the Drone database, with an error status, which is visible in the user interface (per the screenshot you provided). A silent failure would generally imply that no build entry is created, and you have no way to know there was an error (other than looking at the logs). Just to ensure I’m not misunderstanding, can you confirm you see a build in the Drone user interface with the relevant error?

If yes, is it fair to define the problem statement as the following: When the extension returns an error, Drone does not create a GitHub status?

---

<div class="post-metadata">

**Author:** ![laney](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/laney/32/7116_2.png) [@laney](https://drone.discourse.group/u/laney)\
**Post date:** [September 13, 2022, 7:55pm UTC](https://drone.discourse.group/t/conversion-extension-errors-are-silently-skipped-over/12506/5 "2022-09-13T19:55:38Z")

</div>

> [@brad](#):
>
> Just to ensure I’m not misunderstanding, can you confirm you see a build in the Drone user interface with the relevant error?

That’s right. If you were browsing the web UI at the right time, you would be able to see an ❌ failure for the conversion extension error so it is actually possible to detect if you are there when it happens or if you page back and find all the failures for pushes to the main branch. (I didn’t try the CLI.)

> [@brad](#):
>
> If yes, is it fair to define the problem statement as the following: When the extension returns an error, Drone does not create a GitHub status?

The problem is really two things

- No status check is created on GH
- It’s not reported as a failure as far as our webhook listener (I didn’t mention this specific in the OP, apologies)

> [@brad](#):
>
> A silent failure would generally imply that no build entry is created, and you have no way to know there was an error

Ok, sorry for using the word silent then. Here’s where I was coming from: normal failures are _noisy_ for us, deliberately because the steps being run are quite crucial. In this case there is no notification so that’s why I used that word. It’s making a build but the normal notification channels (as far as I can see) are not being pinged. So it’s not making any noise if you see what I mean. But you can go and look, as you say.

---

<div class="post-metadata">

**Author:** ![brad](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/brad/32/4172_2.png) [@brad](https://drone.discourse.group/u/brad)\
**Post date:** [September 13, 2022, 9:00pm UTC](https://drone.discourse.group/t/conversion-extension-errors-are-silently-skipped-over/12506/6 "2022-09-13T21:00:18Z")

</div>

> [@laney](#):
>
> - No status check is created on GH
> - It’s not reported as a failure as far as our webhook listener (I didn’t mention this specific in the OP, apologies)

Thanks so much for clarifying, this makes perfect sense. A quick look at the code and I think we just need to send the status and webhook in the `createBuildError` function (at the link below). We will have our team dig deeper and will report back here if we have any questions.

[https://github.com/harness/drone/blob/master/trigger/trigger.go#L517](https://github.com/harness/drone/blob/master/trigger/trigger.go#L517)
