Magento 2.1.18 is the final 2.1.x release. After June 2019, Magento 2.1.x will no longer receive security patches, quality fixes, or documentation updates.
To maintain your site's performance, security, and PCI compliance, upgrade to the latest version of Magento.

Resolve issues with encryption key

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.

If you have imported data from an existing Magento installation into Magento Commerce Cloud, you need to copy the key and deploy it to the 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:

  1. SSH to each of the Cloud environments: Integration, Staging, and Production.

    1
    
    magento-cloud environment:ssh
    
  2. Open app/etc/env.php in a text editor.
  3. Verify the existing value of key for crypt. The value should be your Magento Commerce key.

    1
    2
    3
    4
    5
    6
    
        return array (
          'crypt' =>
          array (
            'key' => '<your encryption key>',
          ),
        );
    
  4. If the value is incorrect, add the key value, and save your changes to env.php.
  5. 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.
Updated