My thoughts on tech.
11 March 2018
Magento 2 is the leading Open Source Software for e-commerce, with a vibrant community and proper product documentation.
The development team releases bug fixes and new features in a regular cadence, given support to security threats, market trends, amongst others.
The environment is deployed in AWS, using an immutable infrastructure. It allows us to deploy several development/testing environments where we can develop the scripts to automate the upgrade process for our CI/CD pipeline. Also, it is our workbench for testing UI changes, new plugins, amongst others.
However, trying to upgrade to the latest version (at the moment of writing this post is 2.2.3), using the official documentation, we receive the following error:
This is annoying. So far, we had reliable platform upgrades. Using my developer hat, we followed the error. A file was missing in the magento 2 installation path\setup\
folder.
Doing a quick search with the ls
command, we had the folder structure:
The code never lies. The setup
/ folder doesn’t exist. It intrigued us, getting us to investigate why the folder wasn’t there. We verified:
setup/
folder exists, and it has contentsetup/
folder exists, and it has contentsetup/
folder exists in the current installationGiven the information from our investigation, it seemed to point out to the PHP Composer, which doesn’t deploy the setup/
folder during the upgrade process. To prove it, we tried to upgrade the environment again, using the same commands:
And we were able to reproduce the initial error. At least it is reproducible and supports our theory. :)
Since the PHP Composer package should contain (apart from the metadata file) the same files as the downloadable Magento 2 installation package, we’ve tried to:
setup/
folder to the Magento 2 installation folderAnd voilá, it finished the Magento 2 upgrade to the version 2.2.3. Happy days, we can do our testing on the new version of the shop, before promoting it to production.
This error had been reported to the Magento development team, however, they can’t reproduce it. Nevertheless, we can use this workaround to upgrade our (your) shop.