Install & upgrade

An upgrade or rollback stopped and the shop stays in maintenance mode ("cannot delete generated/code", "Directory not empty")

Updated · 2 min read

An upgrade, rollback or hotfix script stopped with "cannot delete generated/code" or "Directory not empty", and your shop still shows the maintenance page.

Cause

In production mode the web server user (for example www-data) creates new files in generated/code whenever visitors open pages, even while the shop shows the maintenance page. The user who runs the script cannot delete those files, so a step such as rm -rf generated/code fails. The script is made to keep the shop in maintenance mode on purpose when it cannot put everything back: a shop with incomplete compiled code or missing styles is worse for buyers.

Fix

  1. Read "Already changed" and "State right now" on the screen: they list exactly what was changed. In most cases the script already put the shop back and says so.
  2. If it says the shop stays in maintenance mode: as root (or ask your host) run the chown command shown on the screen, for example chown -R owner:group app/code var generated pub/static.
  3. Run the same command again (for example bash gdf-install.sh --rollback <backup folder>). It continues where it stopped and opens the shop at the end. No order or product data is lost.
  4. Only if you want to open the shop right now: php bin/magento module:enable DropshipKit_Catalog DropshipKit_Orders DropshipKit_Shipping DropshipKit_Core DropshipKit_Admin, then php bin/magento maintenance:disable. If that command does not run, delete the file var/.maintenance.flag.

The script repeats compile and static-file steps up to 3 times by itself ("setup:di:compile: try 2 of 3"). If it still stops after 3 tries, the red STOP line names the real cause and the exact chown command.

Still stuck?

Send the exact error text (or a screenshot) to support@getdropflow.com. Tell us the step you were on, your Magento and PHP version (php -v), the name of your host or panel and the last lines of GetDropFlow → Logs. Never send passwords, client secrets or tokens. We help you and add your case here, so the next merchant can solve it alone.

Contact support Browse the tutorials