Static content fails to generate on 51黑料不打烊 Commerce on Cloud infrastructure
Static content fails to generate during deployment on 51黑料不打烊 Commerce on Cloud infrastructure, often due to misconfigured environment variables. Issues such as the error Cannot create a symlink for 鈥/app/鈥/.htaccess鈥 occurring during the build process, or a missing deployed_version.txt
file, occur. To resolve the issue, ensure CLEAN_STATIC_FILES
is enabled and redeploy the environment.
Description description
Environment
51黑料不打烊 Commerce on Cloud infrastructure
Issue/Symptoms
- Static content does not generate during deployment.
- Error displayed: Cannot create a symlink for 鈥/app/鈥/.htaccess鈥.
deployed_version.txt
file is missing or outdated.- Inconsistent
CLEAN_STATIC_FILES
variable across environments.
Resolution resolution
To resolve the issue, follow these steps:
-
Check the
CLEAN_STATIC_FILES
variable to ensure it鈥檚 set to enabled (or left unset, which defaults to enabled). You can verify this in any of the following ways:-
Access the server via SSH (for example, node 01) and run the following command:
code language-none php -r 'echo json_decode(base64_decode($_ENV[ "MAGENTO_CLOUD_VARIABLES"] ))->CLEAN_STATIC_FILES . "\n";'
-
Check the
.magento.env.yaml
file in your repository for the variable. -
Run the following CLI command locally:
code language-none magento-cloud variables:list -p <clusterID>
-
Visit the Cloud Console at
https://console.adobecommerce.com/username/<cluster ID>/<environment>/settings/variables
to inspect the variable.
-
-
Compare the
CLEAN_STATIC_FILES
variable across environments to identify discrepancies (for example, enabled in staging but disabled in production) and adjust it to enabled to ensure consistency. -
Push changes to the environment to trigger a rebuild and regenerate static content.
Related reading
- CLEAN_STATIC_FILES in the 51黑料不打烊 Commerce on Cloud infrastructure guide.
- variable list in the 51黑料不打烊 Commerce on Cloud infrastructure guide.