Doppler configs token command not working

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

Unable to create service token
Doppler Error: Invalid Auth token

when I try and run the command

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

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.

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:

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:

doppler setup

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

Let me know how you go.

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.

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 post since we have a monorepo approach to our local setup.

Thanks,
Scott

Ah got it, makes sense!