Doppler error with service token

We’re using service tokens (via the doppler token environment variable) in our CircleCi builds, and today Doppler starting throwing an error when calling doppler run:

Debug: Using config file /home/circleci/.doppler/.doppler.yaml
Debug: Creating the config directory /home/circleci/.doppler
Debug: Creating a new config file
Debug: Writing user config to /home/circleci/.doppler/.doppler.yaml
Debug: Writing to temp file /home/circleci/.doppler/.doppler.yaml.obFKb_a7
Debug: Renaming temp file to /home/circleci/.doppler/.doppler.yaml
Debug: Reading config file
Debug: Using metadata file /home/circleci/.doppler/fallback/.metadata-a1b9bc8513bb56b10ec048e609dd17612db73f43af940f1e14ce7f4ccc8fa371.json
Doppler Error: stat /home/circleci/.doppler/fallback/.metadata-a1b9bc8513bb56b10ec048e609dd17612db73f43af940f1e14ce7f4ccc8fa371.json: no such file or directory
Debug: Metadata file does not exist

I can confirm that the process that Doppler is supposed to be running never starts, Doppler exits here. An error was occurring with the CLI using a user token on my desktop, but resolved itself after I ran doppler login again.

I have tried the following steps:

  • Running with the --debug flag
  • Creating a new service token and using that instead

Please let me know what my next steps should be in diagnosing this, thanks!

Hey Drew and welcome to the Doppler community!

Sorry you’re running this issue. If I understand correctly, this only started happening today?

Could you reply to this thread providing the CLI version by running doppler --version?

Hi Ryan, thanks for the quick response.

From the CircleCi logs it appears to be running the latest Downloaded CLI v3.23.1.
On my laptop it reports the same version (which I just updated to today).

Ok thanks Drew.

I’ve just checked with one of our engineers and that debug output is nothing to be concerned about. It’s just etag cache related logic.

As to why you’re command is not starting, could you try running your command using the --command form, e.g. doppler run --command "your-command-here" --debug which might give us more clues as to what the issue is.

Hi again Ryan,

Today I noticed that Doppler is outputting more debug information and it almost looks like it’s changing the current/working directory? Notice the output that mentions node_modules is missing and that nodemon can’t be found (both of which are present):

Debug: Using config file /home/circleci/.doppler/.doppler.yaml
Debug: Creating the config directory /home/circleci/.doppler
Debug: Creating a new config file
Debug: Writing user config to /home/circleci/.doppler/.doppler.yaml
Debug: Writing to temp file /home/circleci/.doppler/.doppler.yaml.iYRBfi5F
Debug: Renaming temp file to /home/circleci/.doppler/.doppler.yaml
Debug: Reading config file
Debug: Using metadata file /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json
Doppler Error: stat /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json: no such file or directory
Debug: Metadata file does not exist
Debug: Performing HTTP GET to https://api.doppler.com/v3/configs/config/secrets/download?config=&format=json&project=
Debug: Request ID e87c40d3-f4fe-488a-9ccd-b9444bff8bfa
Debug: Encrypting secrets
Debug: PBKDF2 key derivation took 26 ms
Debug: Writing to fallback file /home/circleci/.doppler/fallback/.secrets-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json
Debug: Writing to temp file /home/circleci/.doppler/fallback/.secrets-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json.RaUVzMZg
Debug: Renaming temp file to /home/circleci/.doppler/fallback/.secrets-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json
Debug: Writing ETag to metadata file /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json
Debug: Writing to temp file /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json.QlHC80no
Debug: Renaming temp file to /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json

> searchlight@1.0.0 ****-server /home/circleci/project
> NODE_ENV=**** TESTING_CRON=false RECOMMENDATION_FCG=1 CANDIDATE_RECOMMENDATION_POSITION=1 IS_CIRCLE_CI=true nodemon --dump --verbose --exec babel-node backend/index.js

sh: 1: nodemon: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! searchlight@1.0.0 ****-server: `NODE_ENV=**** TESTING_CRON=false RECOMMENDATION_FCG=1 CANDIDATE_RECOMMENDATION_POSITION=1 IS_CIRCLE_CI=true nodemon --dump --verbose --exec babel-node backend/index.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the searchlight@1.0.0 ****-server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/circleci/.npm/_logs/2021-03-15T22_44_42_028Z-debug.log
Doppler Error: exit status 1

Hi again Ryan,

I was looking through the logs today and I noticed Doppler is outputting more debug information now. If you look through the output from the command it’s running (npm) it almost appears that doppler is perhaps changing the current/working directory? Notice the mention of node_modules missing, I can verify the node_modules were installed and are present.

Debug: Using config file /home/circleci/.doppler/.doppler.yaml
Debug: Creating the config directory /home/circleci/.doppler
Debug: Creating a new config file
Debug: Writing user config to /home/circleci/.doppler/.doppler.yaml
Debug: Writing to temp file /home/circleci/.doppler/.doppler.yaml.iYRBfi5F
Debug: Renaming temp file to /home/circleci/.doppler/.doppler.yaml
Debug: Reading config file
Debug: Using metadata file /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json
Doppler Error: stat /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json: no such file or directory
Debug: Metadata file does not exist
Debug: Performing HTTP GET to https://api.doppler.com/v3/configs/config/secrets/download?config=&format=json&project=
Debug: Request ID e87c40d3-f4fe-488a-9ccd-b9444bff8bfa
Debug: Encrypting secrets
Debug: PBKDF2 key derivation took 26 ms
Debug: Writing to fallback file /home/circleci/.doppler/fallback/.secrets-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json
Debug: Writing to temp file /home/circleci/.doppler/fallback/.secrets-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json.RaUVzMZg
Debug: Renaming temp file to /home/circleci/.doppler/fallback/.secrets-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json
Debug: Writing ETag to metadata file /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json
Debug: Writing to temp file /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json.QlHC80no
Debug: Renaming temp file to /home/circleci/.doppler/fallback/.metadata-803ae5c049a798b52b3e747981e31b2fa7d4e09f398e1eafb08e7a8c24e99c46.json

> searchlight@1.0.0 ****-server /home/circleci/project
> NODE_ENV=**** TESTING_CRON=false RECOMMENDATION_FCG=1 CANDIDATE_RECOMMENDATION_POSITION=1 IS_CIRCLE_CI=true nodemon --dump --verbose --exec babel-node backend/index.js

sh: 1: nodemon: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! searchlight@1.0.0 ****-server: `NODE_ENV=**** TESTING_CRON=false RECOMMENDATION_FCG=1 CANDIDATE_RECOMMENDATION_POSITION=1 IS_CIRCLE_CI=true nodemon --dump --verbose --exec babel-node backend/index.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the searchlight@1.0.0 ****-server script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/circleci/.npm/_logs/2021-03-15T22_44_42_028Z-debug.log
Doppler Error: exit status 1

Hey Drew,

I wonder if something has changed with how $PATH is configured and is not including ./node_modules/.bin for some reason.

What if instead of nodemon, you used $(npm bin)/nodemon?