twilio-cli: Secure credential storage failed to load.
Unable to run twilio login
Hi guys,
I’m trying to get twilio running on a web server (Digital Ocean Droplet if that matters) and am having trouble getting past the first steps.
Steps to Reproduce
npm install twilio-cli -g
twilio login
Spits out the error message:
Secure credential storage failed to load.
You can also use credentials stored in environment variables:
# OPTION 1 (recommended)
TWILIO_ACCOUNT_SID = your Account SID from twil.io/console
TWILIO_API_KEY = an API Key created at twil.io/get-api-key
TWILIO_API_SECRET = the secret for the API Key
# OPTION 2
TWILIO_ACCOUNT_SID = your Account SID from twil.io/console
TWILIO_AUTH_TOKEN = your Auth Token from twil.io/console
I tried storing the credentials within environmental variables as suggested however the same error message comes up.
When I run twilio login -l debug
, the error message gets an extra line at the bottom of:
at SecureStorage.loadKeytar (/home/arj/.nvm/versions/node/v12.14.1/lib/node_modules/twilio-cli/node_modules/@twilio/cli-core/src/services/secure-storage.js:35:15)
I’ve not had too much experience with NVM/NPM so apologies if I’m doing something obiously incorrect.
Let me know if I’m doing anything wrong.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 35 (15 by maintainers)
Commits related to this issue
- fix: don't display "undefined" when no profiles exists If you've not created a profile yet and attempt to run a command that requires auth, you would see that the profile "undefined" could not be fou... — committed to twilio/twilio-cli-core by deleted user 4 years ago
- fix: don't display "undefined" when no profiles exists (#92) If you've not created a profile yet and attempt to run a command that requires auth, you would see that the profile "undefined" could not ... — committed to twilio/twilio-cli-core by deleted user 4 years ago
For anyone else running into the below error (I kept getting it after trying to run the
twilio-cli
after successfully logging in the first time around), I followed the above advice to add my twilio credentials to my.env
file.Error
Fixed by adding to
.env
file (I’m on MacOS)Find my shell (I’m using zsh, you could be using, bash etc.):
$ echo $SHELL
returns/bin/zsh
Open my.zshrc
file:$ open ~/.zshrc
Add Twilio variables:Refresh my terminal and test -
$ echo $TWILIO_ACCOUNT_SID
should returnACXXXXXXetc
Then I was able to usetwilio-cli
as before.The issue here is that the
twilio login
does not prompt your Account SID and Auth Token when environment variables are NOT set.It throws that
Secure credential storage failed to load.
error even when one tries to login for the first time after installation.The error message should be corrected then.
@midhunomk
Note the message below is misleading, and will print out even when those variables are set:
This seems misleading - it implies Twilio isn’t picking up the variables being set.
A better message would be to check if the environment variables are set
PR to update the wording on the env var message to include the
export/set
command: https://github.com/twilio/twilio-cli-core/pull/93@drewstaylor Think you need to
export
the vars in order for them to be available to the Node process.@drewstaylor Got it. My concern about knowing the specific command was to ensure it wasn’t coming from some other plugin.
What version of twilio-cli and Node is this?
twilio version
That doesn’t really seem to work. Today’s saga:
I’ve tried different tactics here:
--env
as a flag--auth-token
as a flag