Skip to content

"Secure credential storage failed to load" on non desktop environment

ravali-rimmalapudi edited this page Dec 3, 2021 · 1 revision

The profiles and login functionality are meant to be used in Desktop environments, so this usually occurs when you are trying to use Twilio CLI from a non-Desktop environment (docker, vagrant, linux over ssh, etc).

If you set an environment variable for Twilio CLI it needs to be store in your system environment, not in an .env file.

See the following for more information about how to set these depending on your operating system: Working with Environment Variables

Once you have set the environment variable you can skip the "twilio login" step as you don't need to login. Any CLI API commands will automatically pull your credentials from the environment variable.

Working with Environment Variables:

Windows

Open the Windows Run prompt. Do so by pressing the Windows and R key on your keyboard at the same time. Type sysdm.cpl into the input field and hit Enter or press Ok. Click on the "Advanced" tab, and go to the button called "Environment Variables".

Environment Variables

You can alternatively use the Windows Command prompt or Power Shell.

# Set NAME in the Windows Command Prompt
set NAME="JoJo"

# Set NAME in the Windows PowerShell console
$Env:NAME = "JoJo"

Linux/MacOS

 # Set NAME in the bash/zsh/fish

 # Available to the current environment (session) and all child sessions.
 export NAME="JoJo"

 # Available only to the current session.
 NAME="JoJo"

Since this would only set this for our current session we need to add this command into a file that is executed for every session. For this open the .bashrc or .bash_profile file in your home directory with your favorite code editor. Add the following line somewhere in your .bashrc or .bash_profile file:

export NAME="JoJo"

References:

https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html

https://www.twilio.com/blog/working-with-environment-variables-in-php