PrestaShop 8.2.x AutoUpgrade Stalls: The Persistent 'Directory Not Empty' Cache Cleaning Error

PrestaShop 8.2.x AutoUpgrade Stalls: The Persistent 'Directory Not Empty' Cache Cleaning Error

Upgrading a PrestaShop store is a critical process, and merchants rely heavily on official tools like the AutoUpgrade module to ensure a smooth transition. However, a recent forum thread highlights a significant and recurring challenge for users attempting to upgrade PrestaShop 8.2.7 to 8.2.8 using AutoUpgrade 7.6.5.

The core issue, reported by user 'sassbar', revolves around the AutoUpgrade process halting during the crucial cache-cleaning stage. Specifically, the module fails when attempting to remove the var/cache/prod directory, throwing the error: "Failed to remove directory ".../var/cache/prod": rmdir(.../var/cache/prod): Directory not empty".

This error is particularly problematic because it occurs after the PrestaShop files have been updated to the target version (8.2.8), but before the database migration has been completed. This leaves the e-commerce shop in a perilous, partially upgraded state: Files 8.2.8 + DB 8.2.7. Such an inconsistency can lead to unpredictable behavior, critical errors, and potential data corruption, making the shop unusable for customers and a nightmare for merchants.

The problem has been reproduced multiple times, both on production and test environments, indicating a persistent bug rather than an isolated incident. The user's environment details – PrestaShop 8.2.7, target 8.2.8, AutoUpgrade 7.6.5, PHP 8.1.34, MariaDB 10.6.28, Apache, Linux hosting – are fairly standard. Crucially, the user lacks SSH/Terminal access, which is common for many shared hosting environments, severely limiting their ability to perform manual fixes like forcefully clearing the cache directory.

Standard precautions were taken, including enabling Maintenance Mode and disabling Cloudflare (DNS-only) prior to the upgrade attempt. The user also notes that similar discussions and GitHub issues exist concerning the same var/cache/prod / Directory not empty error, suggesting this is a known, unresolved vulnerability within the AutoUpgrade module or PrestaShop's cache handling mechanisms during upgrades.

The thread author explicitly states a desire to avoid manual modifications to PS_VERSION_DB or performing SQL migrations manually, emphasizing the need for a safe, automated solution for a production shop. The question posed to the community and developers is direct: Is there a confirmed workaround or fix for this specific problem with AutoUpgrade 7.6.5 / PrestaShop 8.2.x, particularly a safe way to handle a non-empty var/cache/prod without leaving the shop in a partially upgraded state?

As of the time of this insight, the forum thread has received zero replies. This means that while the problem is clearly articulated and its impact severe, there are currently no community-provided solutions or workarounds available within this specific discussion. This highlights a critical gap in support for a significant upgrade blocker that could affect numerous PrestaShop merchants relying on the official upgrade path.

For Migrate My Shop, this issue underscores the complexities and potential pitfalls of PrestaShop migrations, even with official tools. A robust solution or clear guidance from the PrestaShop core team is urgently needed to ensure merchants can safely and reliably update their stores without risking critical data inconsistencies or extended downtime.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools