CircleCI builds with Doppler are failling

I’ve added the commands in the CircleCI guides to my CircleCI build steps:
curl -Ls https://cli.doppler.com/install.sh || wget -qO- https://cli.doppler.com/install.sh) | sh

And I’m getting the following error:

Downloading la**** release
Installing...
dpkg: error: requested operation requires superuser privilege
ERROR: script failed during execution
For more verbose output, re-run this script with the debug flag (./install.sh --debug)

Has anyone seen this before?

Hi axw,

Welcome to the Doppler community!

As it seems you’re using a Linux executor (with no root access or sudo privileges), you’ll need a slightly different command that will download the binary to a location you have write access to, e.g. the current directory.

This is covered in our CircleCI docs and the command you need is:

# Downloads binary to current directory and sets executable permissions
(curl -Ls https://cli.doppler.com/install.sh || wget -qO- https://cli.doppler.com/install.sh) | sh -s -- --no-install --no-package-manager

Thanks Ryan, I’ve now been able to download Doppler successfully during the build.

But I cannot successfully run my server with injected secrets. Here’s the output

#!/bin/bash -eo pipefail ./doppler run --token npm run test-server

Unable to fetch secrets from the Doppler API Doppler Error: Invalid auth token Reading secrets from fallback file Doppler Error: The fallback file does not exist

My interpretation of the docs is that as long as $DOPPER_TOKEN is set as an env var on CircleCI, I would be able to use ./doppler run --token to start my server

Hey @axw just to chime in here. Are you naming the token in CirceCI $DOPPLER_TOKEN or DOPPLER_TOKEN? If so, the extra $ prefix is the issue I believe.

It could also be because of the —token flag. You can safely remove that if the $DOPPLER_TOKEN environment variable is set.

Can you try:

./doppler run -- npm run test-server

Thanks both! @ryan-blunden 's suggestion did the trick. I also had to prepend doppler run to a few other scripts

1 Like

Great to hear it’s all working for you!