PHP Fatal error: Uncaught RuntimeException: Unable to create the Doctrine Proxy directory "/var/www/html/cache/prod/doctrine/orm/Proxies" on fresh installation v 8.6

I 'm very tired.

Fatal error when i do Repair and rebuild on fresh install after language pack installation.

[29-May-2024 13:21:41 UTC] PHP Warning:  foreach() argument must be of type array|object, null given in /var/www/html/public/legacy/include/database/DBManager.php on line 933
[29-May-2024 13:21:41 UTC] PHP Stack trace:
[29-May-2024 13:21:41 UTC] PHP   1. {main}() /var/www/html/public/legacy/index.php:0
[29-May-2024 13:21:41 UTC] PHP   2. SugarApplication->execute() /var/www/html/public/legacy/index.php:52
[29-May-2024 13:21:41 UTC] PHP   3. SugarController->execute() /var/www/html/public/legacy/include/MVC/SugarApplication.php:101
[29-May-2024 13:21:41 UTC] PHP   4. SugarController->processView() /var/www/html/public/legacy/include/MVC/Controller/SugarController.php:363
[29-May-2024 13:21:41 UTC] PHP   5. SugarView->process() /var/www/html/public/legacy/include/MVC/Controller/SugarController.php:432
[29-May-2024 13:21:41 UTC] PHP   6. ViewRepair->display() /var/www/html/public/legacy/include/MVC/View/SugarView.php:210
[29-May-2024 13:21:41 UTC] PHP   7. RepairAndClear->repairAndClearAll($selected_actions = [0 => 'clearAll'], $modules = [0 => 'All Modules'], $autoexecute = FALSE, $show_output = TRUE) /var/www/html/public/legacy/modules/Administration/views/view.repair.php:56
[29-May-2024 13:21:41 UTC] PHP   8. RepairAndClear->repairDatabase() /var/www/html/public/legacy/modules/Administration/QuickRepairAndRebuild.php:122
[29-May-2024 13:21:41 UTC] PHP   9. include_once() /var/www/html/public/legacy/modules/Administration/QuickRepairAndRebuild.php:148
[29-May-2024 13:21:41 UTC] PHP  10. MysqlManager->repairTableParams($tablename = 'cache_rebuild', $fielddefs = [0 => ['name' => 'cache_key', 'type' => 'varchar', 'len' => '255'], 1 => ['name' => 'rebuild', 'type' => 'bool']], $indices = NULL, $execute = FALSE, $engine = NULL) /var/www/html/public/legacy/modules/Administration/repairDatabase.php:151
[29-May-2024 13:21:41 UTC] PHP  11. DBManager->repairTableParams($tablename = 'cache_rebuild', $fielddefs = [0 => ['name' => 'cache_key', 'type' => 'varchar', 'len' => '255'], 1 => ['name' => 'rebuild', 'type' => 'bool']], $indices = NULL, $execute = FALSE, $engine = NULL) /var/www/html/public/legacy/include/database/MysqlManager.php:593
[29-May-2024 13:21:49 UTC] PHP Fatal error:  Uncaught RuntimeException: Unable to create the Doctrine Proxy directory "/var/www/html/cache/prod/doctrine/orm/Proxies". in /var/www/html/vendor/symfony/doctrine-bridge/CacheWarmer/ProxyCacheWarmer.php:56
Stack trace:
#0 /var/www/html/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php(98): Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer->warmUp()
#1 /var/www/html/core/backend/Engine/Service/Extensions/ExtensionAssetCacheWarmupDecorator.php(87): Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate->warmUp()
#2 /var/www/html/vendor/symfony/http-kernel/Kernel.php(580): App\Engine\Service\Extensions\ExtensionAssetCacheWarmupDecorator->warmUp()
#3 /var/www/html/core/backend/Kernel.php(124): Symfony\Component\HttpKernel\Kernel->initializeContainer()
#4 /var/www/html/public/index.php(39): App\Kernel->getLegacyRoute()
#5 {main}

If the software can’t write the file…

This is surely a problem with ownerships or permissions on the cache directory.

You can check with

ls -al cache

The software should detect when it has no permission to write to the directory, and stop with clear error message text for the user and system admin.

We should add this in suggestion box

1 Like

Thank you guys for your suggestions.

I already have double-checked the permissions and tried to re-install again with the UI, keep in mind that before I had installed with the cli installer. Installation process told me that SOAP library is missing.

I have installed the soap library and then, installed with no errors and no warning.

Like before, i can’t perform a repair & rebuild, but now i get:

[30-May-2024 18:01:22 UTC] PHP Warning:  Undefined array key "indices" in /var/www/html/public/legacy/modules/Administration/repairDatabase.php on line 149
[30-May-2024 18:01:22 UTC] PHP Stack trace:
[30-May-2024 18:01:22 UTC] PHP   1. {main}() /var/www/html/public/legacy/index.php:0
[30-May-2024 18:01:22 UTC] PHP   2. SugarApplication->execute() /var/www/html/public/legacy/index.php:52
[30-May-2024 18:01:22 UTC] PHP   3. SugarController->execute() /var/www/html/public/legacy/include/MVC/SugarApplication.php:101
[30-May-2024 18:01:22 UTC] PHP   4. SugarController->processView() /var/www/html/public/legacy/include/MVC/Controller/SugarController.php:363
[30-May-2024 18:01:22 UTC] PHP   5. SugarView->process() /var/www/html/public/legacy/include/MVC/Controller/SugarController.php:432
[30-May-2024 18:01:22 UTC] PHP   6. ViewRepair->display() /var/www/html/public/legacy/include/MVC/View/SugarView.php:210
[30-May-2024 18:01:22 UTC] PHP   7. RepairAndClear->repairAndClearAll($selected_actions = [0 => 'clearAll'], $modules = [0 => 'All Modules'], $autoexecute = FALSE, $show_output = TRUE) /var/www/html/public/legacy/modules/Administration/views/view.repair.php:56
[30-May-2024 18:01:22 UTC] PHP   8. RepairAndClear->repairDatabase() /var/www/html/public/legacy/modules/Administration/QuickRepairAndRebuild.php:122
[30-May-2024 18:01:22 UTC] PHP   9. include_once() /var/www/html/public/legacy/modules/Administration/QuickRepairAndRebuild.php:148
[30-May-2024 18:01:22 UTC] PHP Warning:  foreach() argument must be of type array|object, null given in /var/www/html/public/legacy/include/database/DBManager.php on line 933
[30-May-2024 18:01:22 UTC] PHP Stack trace:
[30-May-2024 18:01:22 UTC] PHP   1. {main}() /var/www/html/public/legacy/index.php:0
[30-May-2024 18:01:22 UTC] PHP   2. SugarApplication->execute() /var/www/html/public/legacy/index.php:52
[30-May-2024 18:01:22 UTC] PHP   3. SugarController->execute() /var/www/html/public/legacy/include/MVC/SugarApplication.php:101
[30-May-2024 18:01:22 UTC] PHP   4. SugarController->processView() /var/www/html/public/legacy/include/MVC/Controller/SugarController.php:363
[30-May-2024 18:01:22 UTC] PHP   5. SugarView->process() /var/www/html/public/legacy/include/MVC/Controller/SugarController.php:432
[30-May-2024 18:01:22 UTC] PHP   6. ViewRepair->display() /var/www/html/public/legacy/include/MVC/View/SugarView.php:210
[30-May-2024 18:01:22 UTC] PHP   7. RepairAndClear->repairAndClearAll($selected_actions = [0 => 'clearAll'], $modules = [0 => 'All Modules'], $autoexecute = FALSE, $show_output = TRUE) /var/www/html/public/legacy/modules/Administration/views/view.repair.php:56
[30-May-2024 18:01:22 UTC] PHP   8. RepairAndClear->repairDatabase() /var/www/html/public/legacy/modules/Administration/QuickRepairAndRebuild.php:122
[30-May-2024 18:01:22 UTC] PHP   9. include_once() /var/www/html/public/legacy/modules/Administration/QuickRepairAndRebuild.php:148
[30-May-2024 18:01:22 UTC] PHP  10. MysqlManager->repairTableParams($tablename = 'cache_rebuild', $fielddefs = [0 => ['name' => 'cache_key', 'type' => 'varchar', 'len' => '255'], 1 => ['name' => 'rebuild', 'type' => 'bool']], $indices = NULL, $execute = FALSE, $engine = NULL) /var/www/html/public/legacy/modules/Administration/repairDatabase.php:151
[30-May-2024 18:01:22 UTC] PHP  11. DBManager->repairTableParams($tablename = 'cache_rebuild', $fielddefs = [0 => ['name' => 'cache_key', 'type' => 'varchar', 'len' => '255'], 1 => ['name' => 'rebuild', 'type' => 'bool']], $indices = NULL, $execute = FALSE, $engine = NULL) /var/www/html/public/legacy/include/database/MysqlManager.php:593

MySql version is: mysql Ver 8.0.37 for Linux on aarch64 (MySQL Community Server - GPL)
My PHP version is: PHP Version 8.2.19
My OS: Ubuntu 24.04

Check if everything is under compatibility matrix

Yeah, i did it. But it seems that everything is ok.

i can’t perform a repair & rebuild, but now i get:

PHP Warning: Undefined array key "indices" in /var/www/html/public/legacy/modules/Administration/repairDatabase.php on line 149
PHP Warning: foreach() argument must be of type array|object, null given in /var/www/html/public/legacy/include/database/DBManager.php on line 933

What error messages, if any, does the Repair & Rebuild show on your browser web page?

No explicit error messages. It log out without perform the repair.
I can get errors only from php_errors.log

You can try these 2. They do Quick Repair and Rebuild from command line, without log in.

Thanks for your suggestions @chris001. I have clarified further about this problem and asked more suggestions around the world (see this post on StackOverflow, please upvote if is useful for you).

The problem had its origins on docker bind-mount system, probably for permissions issues between host machine and container.

Solution is “to esclude” /cache folder from docker-compose.yml bind mount like below:

services:
  suitecrm:
    container_name: suitecrm
    build: .
    volumes:
      #SuiteCRM Application Folder
      - ./www:/var/www/html:delegated
      - /var/www/html/cache/   #Another volume with cache subfolder inside the existing one

In this way cache subfolder can re-create proxy classes on rebuild and repair.

Thanks.

3 Likes