This topic discusses solutions to typical issues you might experience with Magento Commerce encryption key in your environments.
For a new Starter project, the Magento encryption key is on your
master branch Production environment. When you branch to other environments, the key travels with the code and database.
For a new Pro project starting with a “blank site” Magento Commerce Cloud template, the Magento encryption key is on the Integration
master branch and environment until you initially deploy across all environments.
Encryption key not in all environments
All Cloud environments require this encryption key in all three environments or the store will encounter authentication and authorization errors for actions like completing a payment on a cart, processing a return, and adding shipping to orders.
To verify and update the encryption key environment variable:
SSH to each of the Cloud environments: Integration, Staging, and Production.
app/etc/env.phpin a text editor.
Verify the existing value of
crypt. The value should be your Magento Commerce key.
1 2 3 4 5 6
return array ( 'crypt' => array ( 'key' => '<your encryption key>', ), );
- If the value is incorrect, add the key value, and save your changes to
- Exit the text editor and repeat this process for each environment. Test store actions in each environment to verify if the issue persists, such as completing a cart purchase.