Npm deploy failed && missing api_key, but I have set it

this is my build history and .travis.yml config:
Also, I don’t know why this happens?, use v1
‘api_key’ ----- ‘api_token’
In addition, I also used the v2.
In v2, I know ‘api_token’ alias: ‘api_key’,but,Same problem as above
finally,I have set Environment Variables.

1 Like

I’m having the same issue, but on, my steps:

  1. gem install travis
  2. cd my-project-name
  3. travis login --pro (needed for .com projects?)
  4. travis encrypt my-api-key --com
  5. Pasted resulting key in my .travis.yml
language: node_js
    - '12' # EOL: April 2022
    - '10' # EOL: April 2021

        - stage: deploy
          node_js: "lts/*"
          script: skip
          before_deploy: ...
              - provider: npm
                    secure: CiuL/soTffuanT3pxRIDWpTWXRVaAYbU6n++qqbLa34iPBgUsDjUjesVRaN9fEXygzHzA17VX9buWVNn7+V0RPjX4beERvjRxghLnhd1W7f7+AH72+QMnSzj7CUcBeraRMggfzL8umV9/6uuHLAvJZYkn/2gAkS7nAPMqNS/uU2oU/C/RJgfKhOLxxUPh8SELUwdc37AG81KWG6fEfLhtdJcuzqA3aTE+qR+E5kb6v3zqHYpXlKIKU8yysIL8hMxW4IDbb8FEISOi1oac76uunPKYREkz5/gkcIpMUjoXcgajzp1tGWNTLc/okFtYp9po0zjZDpql4ZVfYnRpSevnJfp62Oe3DNHYzIy20ptJ+2SHfP1wLfUWIbbT+m+vhc+UxBUm+a5uhNQMpH/woapgrNLVejIi1XjOKvZQStSqaZzVM2BTov+dPNlqfUHYkttwzasiqJOlxX7Ww3tTQJ0zMB+QZYXsDRlaleM8ZnzzXgRHEn+0x1F8tO7eWx/rfZBEyTrmt9prgb9AvTVz/oY2hr7ySAkhvku3tA9c+g3ROH/dLxTvSeldYOkva7S4CB3oGpleksGnQKbdDEuk61Z1yA3a0iay9d0Z8xUi+Cx2xEEQm3kChR1e7+ZijMrJHA37YJORYSKOw0cvJHWsfghxAxzzeBp9vVSWuiTvJnGkJU=
                tag: next
                skip_cleanup: true
                    branch: master
                    repo: Ionaru/micro-web-service

Full script:

But I am getting the message:

missing api_key
failed to deploy

Example build:

Why am I getting this? I have the correct API key and encrypted it using the travis CLI, why is the build claiming it is “missing” its api key?

As a workaround before that, disable build config validation.


Disabling build config validation in repository settings is not getting around this issue for me

@jesslynlandgren Can’t say anything without seeing a build. I guess you are having some unrelated problem – e.g. envvars not set.

i had the same issue… NOTE: once you disable build config validation, you must create a new build, restarting your previously failed build wont work.

1 Like

I’m also seeing this issue. We haven’t changed anything related to build config, and environment variables, and NPM deploy suddenly stopped working several days ago. Here’s a failing build:

Here’s our source repo:

We have now had to turn off build verification for most of our repos because of this issue

@BanzaiMan AFAICS the fix is not yet a part of a release – so users keep seeing this issue.

There are a bunch of other active PRs against v1 if you think that one fix is too little for a release :wink:

I haven’t change anything from Travis deploy config but suddenly it stopped working because of missing api_key


You should pin this somewhere.

My production deployments suddenly stopped working thanks to randomly being opted in to a beta.

1 Like

it helped in my case for

Did a deploy for the first time in a couple weeks and ran into this as well in a build. Disabling the beta validation feature and creating a new build deployed successfully. Also confirmed that rerunning a build after the beta flag was off did not help, had to trigger a new build.

This is not great for users, this bug being recent, google doesn’t give you much information on solving the issue. Having something that work stop working overnight without any change made by me is not UX friendly. I almost switched for Gitlab, thinking I was an unlucky one affected by a rare strange bug. For newby like me, to start a new build, you can do “More Options --> Trigger build”, doing “Restart build” will fail as stated by aletwitt2.

1 Like

Hello, there. We’ve released dpl 1.10.15, which fixes this issue (for those staying on v1.x at the moment).