# Secrets not working 0.8.1

**URL:** <https://drone.discourse.group/t/secrets-not-working-0-8-1/10317>\
**Category:** Drone Support\
**Created:** [November 21, 2017, 3:57pm UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317 "2017-11-21T15:57:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertlabrie](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/robertlabrie/32/3861_2.png) [@robertlabrie](https://drone.discourse.group/u/robertlabrie)\
**Post date:** [November 21, 2017, 3:57pm UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317/1 "2017-11-21T15:57:09Z")

</div>

I knows this comes up a lot here, and I’ve tried to RTFM, but this is killing me. I added the secret, include it in the .drone.yml file but I just don’t see it in the build. Is it being hidden or something?

.drone.yml:

```auto
pipeline:
  build:
    secrets: [derp]
    image: ubuntu:latest
    commands:
      - cat hello.txt
      - env

```

And the secret is there:

```auto
➜ hello-drone git:(secret_o_rama) ✗ drone secret ls tropo-operations/hello-drone
derp
Events: push, tag, deployment
Images: <any>

```

But when the server runs my build, it’s just not there in the ENV output.

---

<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:** [November 21, 2017, 5:22pm UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317/2 "2017-11-21T17:22:55Z")

</div>

> [@What are Synthetic Overrides?](https://drone.discourse.group/t/what-are-synthetic-overrides/1101/1):
>
> ```auto
> pipeline:
> build:
> secrets: [derp]
> image: ubuntu:latest
> commands:
> - cat hello.txt
> - env
> 
> ```

Hi Robert, I created a secret called `derp` and then executed a build using your example yaml configuration and it printed out the secret in the logs:

 ![05 AM](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/1X/1f82bb3c2de19258034742a19cec8f70eb7e44b7.png)

Note that all environment variables will be uppercase inside the container, so make sure you take that into consideration. The only other reason that a secret would not be available, that I can think of, is if your build is a pull request event. Your secret looks like it is only enabled for push, tag and deployment events.

Perhaps you can take a look at this [guide](http://docs.drone.io/secrets-not-working/) and provide some of the additional details requested [here](http://docs.drone.io/secrets-not-working/#still-having-trouble) if you are still having issues.

---

<div class="post-metadata">

**Author:** ![robertlabrie](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/robertlabrie/32/3861_2.png) [@robertlabrie](https://drone.discourse.group/u/robertlabrie)\
**Post date:** [November 21, 2017, 5:52pm UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317/3 "2017-11-21T17:52:04Z")

</div>

Thanks Brad. I’m not trying to be difficult, it’s just not happening for me. Can you share the `drone secret add` command you used and the exact `.drone.yml`?

---

<div class="post-metadata">

**Author:** ![robertlabrie](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/robertlabrie/32/3861_2.png) [@robertlabrie](https://drone.discourse.group/u/robertlabrie)\
**Post date:** [November 21, 2017, 5:54pm UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317/4 "2017-11-21T17:54:43Z")

</div>

```auto
➜ hello-drone git:(secret_o_rama) ✗ drone secret ls tropo-operations/hello-drone
derp
Events: push, tag, deployment
Images: <any>

➜ hello-drone git:(secret_o_rama) ✗ drone repo info tropo-operations/hello-drone
Owner: tropo-operations
Repo: hello-drone
Type: git
Config: .drone.yml
Visibility: internal
Private: true
Trusted: false
Gated: false
Remote: https://sqbu-github.cisco.com/tropo-operations/hello-drone.git

```

---

<div class="post-metadata">

**Author:** ![robertlabrie](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/robertlabrie/32/3861_2.png) [@robertlabrie](https://drone.discourse.group/u/robertlabrie)\
**Post date:** [November 21, 2017, 6:00pm UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317/5 "2017-11-21T18:00:33Z")

</div>

server logs: [https://gist.github.com/robertlabrie/afd31aec1fd2ab0d45933421fc833ff7](https://gist.github.com/robertlabrie/afd31aec1fd2ab0d45933421fc833ff7)  
build output: [https://gist.github.com/robertlabrie/9225d39d263355671088a48d41d3337d](https://gist.github.com/robertlabrie/9225d39d263355671088a48d41d3337d)

---

<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:** [November 21, 2017, 6:45pm UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317/6 "2017-11-21T18:45:42Z")

</div>

> I’m not trying to be difficult

No worries, you are definitely not being difficult 🙂

> Can you share the drone secret add command

I added the secret using the following command:

```plaintext
$ drone secret add --repository=bradrydzewski/foobar --name=derp --value=derp
$ drone secret ls --repository=bradrydzewski/foobar
derp 
Events: push, tag, deployment
Images: <any>

```

> and the exact .drone.yml?

I used the same yaml that you provided in your example:

```auto
pipeline:
  build:
    secrets: [derp]
    image: ubuntu:latest
    commands:
      - cat hello.txt
      - env

```

I do see from your server logs that it is a push event, so my comment about regarding pull requests does not apply. I also see that you are building branch secret\_o\_rama. Can you confirm your sample yaml exists in the secret\_o\_rama branch? The reason I ask is because Drone will use the yaml from secret\_o\_rama, and sometimes people assume that Drone will only use the yaml in the master branch.

Perhaps maybe it would be faster to just do a quick Google Hangout? I am usually able to resolve these things quickly when I can see them and when we can debug interactively.

---

<div class="post-metadata">

**Author:** ![robertlabrie](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/robertlabrie/32/3861_2.png) [@robertlabrie](https://drone.discourse.group/u/robertlabrie)\
**Post date:** [November 21, 2017, 8:15pm UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317/7 "2017-11-21T20:15:27Z")

</div>

Hi Brad,

Yes the .drone.yml as described is in the secret\_o\_rama branch.

If you’d spend a few minutes with me on it, that’d be great. My gmail is [robert.labrie@gmail.com](mailto:robert.labrie@gmail.com)

---

<div class="post-metadata">

**Author:** ![robertlabrie](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/robertlabrie/32/3861_2.png) [@robertlabrie](https://drone.discourse.group/u/robertlabrie)\
**Post date:** [November 24, 2017, 11:56am UTC](https://drone.discourse.group/t/secrets-not-working-0-8-1/10317/8 "2017-11-24T11:56:33Z")

</div>

Thanks to Brad for your help, this was 100% my fault, I’d not pushed my .drone.yml containing `secrets []`. Yes, really. Posting solution for anyone who googles their way here in the future.
