# Doppler configs token command not working

**URL:** <https://community.doppler.com/t/doppler-configs-token-command-not-working/836>\
**Category:** Need Help\
**Created:** [November 15, 2022, 1:22am UTC](https://community.doppler.com/t/doppler-configs-token-command-not-working/836 "2022-11-15T01:22:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Conrad](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/scott_conrad/32/590_2.png) [@Scott\_Conrad](https://community.doppler.com/u/Scott_Conrad)\
**Post date:** [November 15, 2022, 1:22am UTC](https://community.doppler.com/t/doppler-configs-token-command-not-working/836/1 "2022-11-15T01:22:09Z")

</div>

I am following the docs for getting doppler running with docker-compose locally (found [here](https://docs.doppler.com/docs/docker-compose)) and I keep getting a error like so:

```auto
Unable to create service token
Doppler Error: Invalid Auth token

```

when I try and run the command

```auto
DOPPLER_TOKEN="$(doppler configs tokens create dev -c dev --project local-dev --plain --max-age 1m)" \
docker-compose up -d --build

```

Am I missing something on working with doppler locally with docker compose?

also note: I run `DOPPLER_TOKEN="$(doppler configs tokens create dev -c dev --project scrubcop --plain --max-age 1m)"` without the docker command right after it and I get

```auto
Unable to create service token
Doppler Error: Invalid Auth token

```

but when I run it immediately after again I don’t get any error. I attached a screenshot for reference.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/doppler/original/1X/7fc1f839f80c59a85816c4866359ce92b6f303ec.png)

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [November 15, 2022, 2:01am UTC](https://community.doppler.com/t/doppler-configs-token-command-not-working/836/2 "2022-11-15T02:01:35Z")

</div>

Hey Scott and welcome to the Doppler community!

You’re likely seeing `Doppler Error: Invalid Auth token` either because `DOPPLER_TOKEN` is an environment variable (not local), and the token has expired or because the expired token has been added to your Doppler configuration for that project and config.

Running `unset DOPLER_TOKEN` will fix the environment variable case but if the error persists, unset the `token` in your Doppler configuration file (`~/.doppler.doppler.yaml`) for the project and config by running the following from your application directory:

```nohighlight
doppler configure unset token --scope "$PWD"

```

I also recommend removing `-c dev --project` and using `doppler setup` to set the project and config so your run command will work with any config, e.g, a branch config in local development:

```nohighlight
doppler setup

DOPPLER_TOKEN="$(doppler configs tokens create dev --plain --max-age 1m)" \
docker-compose up -d --build

```

Let me know how you go.

---

<div class="post-metadata">

**Author:** ![mrlubos](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/mrlubos/32/583_2.png) [@mrlubos](https://community.doppler.com/u/mrlubos)\
**Post date:** [November 15, 2022, 3:14pm UTC](https://community.doppler.com/t/doppler-configs-token-command-not-working/836/4 "2022-11-15T15:14:35Z")

</div>

Hi Ryan, are you able to review my post please? It’s stuck in the Akismet spam filter as I’m a new user. I had a question about using this command when offline. My current setup relies on a service token that doesn’t expire, so it works offline thanks to the fallback file. However, that doesn’t work with this setup generating tokens on the fly. Is there a way to work around this? One idea I had would be to store the output of the `doppler configs tokens create` command, perhaps in an `.env` file, but that feels like a lot of boilerplate.

---

<div class="post-metadata">

**Author:** ![Scott\_Conrad](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/scott_conrad/32/590_2.png) [@Scott\_Conrad](https://community.doppler.com/u/Scott_Conrad)\
**Post date:** [November 15, 2022, 3:16pm UTC](https://community.doppler.com/t/doppler-configs-token-command-not-working/836/5 "2022-11-15T15:16:05Z")

</div>

Hey Ryan - thanks for the help!

The above seemed to do the trick. I think I was just in the weird state with my `DOPPLER_TOKEN`’s.

As far as having `-c`, and `--project` in my code post above, I was planning on following [this](https://community.doppler.com/t/docker-compose-monorepo-usage/667) post since we have a monorepo approach to our local setup.

Thanks,  
Scott

---

<div class="post-metadata">

**Author:** ![ryan-blunden](https://sea2.discourse-cdn.com/flex016/user_avatar/community.doppler.com/ryan-blunden/32/9_2.png) [@ryan-blunden](https://community.doppler.com/u/ryan-blunden)\
**Post date:** [November 15, 2022, 10:46pm UTC](https://community.doppler.com/t/doppler-configs-token-command-not-working/836/6 "2022-11-15T22:46:55Z")

</div>

Ah got it, makes sense!
