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

this is my build history and .travis.yml config:
https://travis-ci.org/DWmister/build-pack/jobs/629531172/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
https://travis-ci.org/DWmister/build-pack/jobs/629535399/config
finally,I have set Environment Variables.

1 Like

I’m having the same issue, but on https://travis-ci.com, 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
node_js:
    - '12' # EOL: April 2022
    - '10' # EOL: April 2021

jobs:
    include:
        - stage: deploy
          node_js: "lts/*"
          script: skip
          before_deploy: ...
          deploy:
              - provider: npm
                email: info@saturnserver.org
                api_key:
                    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
                on:
                    branch: master
                    repo: Ionaru/micro-web-service

Full script: https://github.com/Ionaru/micro-web-service/blob/master/.travis.yml

But I am getting the message:

missing api_key
failed to deploy

Example build: https://travis-ci.com/Ionaru/micro-web-service/jobs/270407487

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.

1 Like

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.

Imprint