{"record":{"id":"acb2cf7c1998a710","repo":"doctrine/orm","slug":"proxies-destination-directory-info-s-info-do","errorCode":null,"errorMessage":"Proxies destination directory '<info>%s</info>' does not exist.","messagePattern":"Proxies destination directory '<info>(.+?)</info>' does not exist\\.","errorType":"console","errorClass":"InvalidArgumentException","httpStatus":null,"severity":"error","filePath":"src/Tools/Console/Command/GenerateProxiesCommand.php","lineNumber":77,"sourceCode":"\n        // Process destination directory\n        $destPath = $input->getArgument('dest-path');\n        if ($destPath === null) {\n            $destPath = $em->getConfiguration()->getProxyDir();\n\n            if ($destPath === null) {\n                throw new InvalidArgumentException('Proxy directory cannot be null');\n            }\n        }\n\n        if (! is_dir($destPath)) {\n            mkdir($destPath, 0775, true);\n        }\n\n        $destPath = realpath($destPath);\n\n        if (! file_exists($destPath)) {\n            throw new InvalidArgumentException(\n                sprintf(\"Proxies destination directory '<info>%s</info>' does not exist.\", $em->getConfiguration()->getProxyDir()),\n            );\n        }\n\n        if (! is_writable($destPath)) {\n            throw new InvalidArgumentException(\n                sprintf(\"Proxies destination directory '<info>%s</info>' does not have write permissions.\", $destPath),\n            );\n        }\n\n        if (empty($metadatas)) {\n            $ui->success('No Metadata Classes to process.');\n\n            return 0;\n        }\n\n        foreach ($metadatas as $metadata) {\n            $ui->text(sprintf('Processing entity \"<info>%s</info>\"', $metadata->name));","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/doctrine/orm/blob/d9b9ff73016bf598ae07515f97289ce8074e97a5/src/Tools/Console/Command/GenerateProxiesCommand.php#L59-L95","documentation":"After resolving dest-path (argument or configured proxy dir), orm:generate-proxies creates the directory if missing and resolves it with realpath(). If the path still cannot be resolved — mkdir() failed silently on an unwritable parent, a regular file occupies the path, or open_basedir blocks access — the file_exists() check fails and the command throws InvalidArgumentException('Proxies destination directory ... does not exist'). Note the message prints the configured proxy dir, not necessarily the path you passed.","triggerScenarios":"dest-path under a parent directory that does not exist or is not writable (mkdir() returns false, which the command does not check); a regular file sitting at the proxy-dir path; open_basedir restrictions in hardened CLI setups; typos in the configured proxy_dir.","commonSituations":"Fresh deploys where var/ subdirectories were never created; Docker volumes mounted after the image expected the path; relative proxy_dir resolved against a different CLI working directory.","solutions":["Create the tree first: mkdir -p var/cache/prod/doctrine/orm/Proxies, then re-run the command.","Check the configured proxy_dir for typos and ensure every parent exists and is writable by the CLI user.","If open_basedir is enabled, add the proxy directory to the allowed paths."],"exampleFix":"# before\n$ php bin/console orm:generate-proxies\n# InvalidArgumentException: Proxies destination directory '...' does not exist.\n\n# after\n$ mkdir -p var/cache/prod/doctrine/orm/Proxies\n$ php bin/console orm:generate-proxies var/cache/prod/doctrine/orm/Proxies","handlingStrategy":"validation","validationCode":"$dir = $em->getConfiguration()->getProxyDir();\nif ($dir !== null && ! is_dir($dir)) {\n    if (! @mkdir($dir, 0775, true) && ! is_dir($dir)) {\n        throw new RuntimeException(\"Cannot create proxy directory $dir\");\n    }\n}\n// run orm:generate-proxies","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pre-create proxy directories in the build/deploy step before running generate-proxies.","Use absolute paths for proxy_dir so CLI working directory does not matter.","Check open_basedir settings when CLI and web PHP configurations differ."],"tags":["doctrine-orm","console","proxy","filesystem","cli"],"backgroundTag":"path-not-found","analyzedSha":"d9b9ff73016bf598ae07515f97289ce8074e97a5","analyzedAt":"2026-08-21T06:13:15.863Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}