# Invalid option "--api\_key=" for deploy: heroku

**URL:** <https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134>\
**Category:** Deployment\
**Created:** [June 25, 2020, 5:10pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134 "2020-06-25T17:10:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![JoshuaPelealu](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@JoshuaPelealu](https://travis-ci.community/u/JoshuaPelealu)\
**Post date:** [June 25, 2020, 5:10pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134/1 "2020-06-25T17:10:46Z")

</div>

Here’s the link to my deploy: [https://travis-ci.com/github/JoshuaPelealu/catalactics-bot/builds/173044380](https://travis-ci.com/github/JoshuaPelealu/catalactics-bot/builds/173044380).

I don’t know what’s wrong, I logged in and generated the Api key for heroku, then I deployed it, and it doesn’t really work. When I looked at the log, there is another error, saying not Logged in.

Thanks in advance!!

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 25, 2020, 5:38pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134/2 "2020-06-25T17:38:01Z")

</div>

Your api key encryption is wrong. That’s really the best I can say. Since you are running the build on [https://travis-ci.com](https://travis-ci.com), ensure that your `travis encrypt` command includes `--pro` flag.

> **[Travis CI Documentation](https://docs.travis-ci.com/user/encryption-keys#usage)**
>
> Encryption keys

---

<div class="post-metadata">

**Author:** ![JoshuaPelealu](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@JoshuaPelealu](https://travis-ci.community/u/JoshuaPelealu)\
**Post date:** [June 25, 2020, 5:47pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134/3 "2020-06-25T17:47:29Z")

</div>

I actually did use the `--pro` flag.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/travis_ci/original/2X/c/c593247d40a7a1e0f71f49de5191ecf0a806fc04.png), but it still doesn’t work. Is it because I put the flag at the end? Maybe that’s the reason it is incorrect?

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 25, 2020, 6:01pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134/4 "2020-06-25T18:01:59Z")

</div>

If you have access to a non-Windows machine, could you try using that instead?

---

<div class="post-metadata">

**Author:** ![JoshuaPelealu](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@JoshuaPelealu](https://travis-ci.community/u/JoshuaPelealu)\
**Post date:** [June 25, 2020, 6:04pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134/5 "2020-06-25T18:04:32Z")

</div>

Does Windows Subsystem for Linux (WSL) Ubuntu Works? Or do I have to use a different OS?

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [June 25, 2020, 6:11pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134/6 "2020-06-25T18:11:16Z")

</div>

That’s a good question. I don’t have an answer. You can try WSL first, and if not, maybe a Docker container can work?

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [June 25, 2020, 6:20pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134/7 "2020-06-25T18:20:09Z")

</div>

`$(heroku auth:token)` is Bash syntax while you are using Cmd in the screenshot. So as a result, that exact line (or some part thereof) gets encrypted instead.

---

<div class="post-metadata">

**Author:** ![kodedict](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@kodedict](https://travis-ci.community/u/kodedict)\
**Post date:** [August 25, 2020, 11:59pm UTC](https://travis-ci.community/t/invalid-option-api-key-for-deploy-heroku/9134/8 "2020-08-25T23:59:14Z")

</div>

To solve this issue,  
Since cmd can’t run Bash syntax.

1. Navigate to your Heroku account: [https://dashboard.heroku.com/account](https://dashboard.heroku.com/account)
2. Find API key section and copy key
3. Go to project root directory
4. Run the following command:

`travis encrypt <api-key> -r <github-user>/<repo-name> --add deploy.api_key`
