Recover from component failure
CREATED FOR:
- Admin
- Developer
This topic discusses how to recover if a component fails to deploy properly. Typical examples include components that have dependencies that are not met by your remote environment, such as incompatible PHP versions.
You can recover from a failed deployment in any of the following ways:
- Restore a backup
- Clean project and code from previous changes and redeploy
Clean, remove, and redeploy
To clean up from the previous deployment, identify the component that was added or updated and then remove it. First, log in to the remote environment and manually clear the contents of the var
directory. Then remove the component from the composer.json
file and redeploy the environment.
To clean the var
directories:
-
On your local workstation, change to your project directory.
-
Use SSH to log in to the remote environment.
magento-cloud ssh
-
Clear the
var
directories.rm -rf var/*
-
Log out.
To remove the component:
-
On your local workstation, change to your project directory.
-
Clear the cache.
composer clear-cache
-
Remove the component from the
composer.json
file.composer remove <component-name>:<version>
If the following message displays, you do not need to do anything further:
Package "<name>:<version>" listed for update is not installed. Ignoring.
-
Wait while the dependencies are updated.
-
Add, commit, and push code changes.
git add -A
git commit -m "<message>"
git push origin <environment-ID>
See more about restoring an environment without a backup in Restore an environment.