directory does not exist error

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
ethanlazarus
User
Posts: 71

directory does not exist error

Post by ethanlazarus »

I'm running my project very successfully built on phpmaker 2024 x 6 months - on new ubuntu server VM. Everything works great, but a couple times a day we get this error: /var/www/[mydomain].com/patient_chart/vendor/symfony/finder/Finder.php(649): The "" directory does not exist.

I believe it is a temp log directory.

This is at random times. If hit refresh, the correct page shows and the error is cleared. I don't see error in apache error log.

Any ideas what could cause this? I posted many months ago, but never found a solution. Looking at the code in finder.php,

 foreach ((array) $dirs as $dir) {
            if (is_dir($dir)) {
                $resolvedDirs[] = [$this->normalizeDir($dir)];
            } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) {
                sort($glob);
                $resolvedDirs[] = array_map($this->normalizeDir(...), $glob);
            } else {
                throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir));
            }
        }

It is the throw new directorynotfound line at the bottom that is line 649. Could I just comment this out?


arbei
User
Posts: 9787

Post by arbei »

You better turn on Debug, check the stack trace and find the related code (that calls the composer package) in the project, avoid customizing code in composer packages (because they will be overwritten by composer update if it is updated).


ethanlazarus
User
Posts: 71

Post by ethanlazarus »

Still working on this - I wonder if it was either a permissions probem in the vendor, laravel, or log folder on the server. No errors on the development server, but error on the production server. I deleted the directories, re-uploaded files, but did NOT re-upload log directory - I'm wondering if this is what was triggering the error. Today, no errors. Maybe this will do it. Thanks for your help.


arbei
User
Posts: 9787

Post by arbei »

ethanlazarus wrote:

No errors on the development server, but error on the production server.

You may turn on Log error to file so you can check the server side errors in the log files on your production server.


ethanlazarus
User
Posts: 71

Post by ethanlazarus »

Sorry took me so long to reply - I turned on log to file. It looks like the error is thrown by function cleanuploadtemppaths in phpfn.php.

Sorry this is long, but this is the error in the log. Any ideas where I should look next?

[2024-09-04T07:34:57.374166-06:00] log.ERROR: Slim Application Error Type: Symfony\Component\Finder\Exception\DirectoryNotFoundException Code: 0 Message: The "" directory does not exist. File: /var/www/cncchart.com/patient_chart/vendor/symfony/finder/Finder.php Line: 649 Trace: #0 /var/www/cncchart.com/patient_chart/src/phpfn.php(3517): Symfony\Component\Finder\Finder->in() 
#1 /var/www/cncchart.com/patient_chart/src/phpfn.php(3412): PHPMaker2024\patient_chart\IsEmptyPath() 
#2 /var/www/cncchart.com/patient_chart/controllers/ControllerBase.php(72): PHPMaker2024\patient_chart\CleanUploadTempPaths() 
#3 /var/www/cncchart.com/patient_chart/controllers/AppointmentsController.php(24): PHPMaker2024\patient_chart\ControllerBase->runPage() 
#4 /var/www/cncchart.com/patient_chart/vendor/slim/slim/Slim/Handlers/Strategies/RequestResponse.php(38): PHPMaker2024\patient_chart\AppointmentsController->custom() 
...
Tips: To display error details in HTTP response set "displayErrorDetails" to true in the ErrorHandler constructor. [] []

Post Reply