{"record":{"id":"3b43c90d8e5d472c","repo":"composer/composer","slug":"the-svn-directory-is-missing-from-path-see","errorCode":null,"errorMessage":"The .svn directory is missing from '.$path.', see https://getcomposer.org/commit-deps for more information","messagePattern":"The \\.svn directory is missing from '\\.\\$path\\.', see https://getcomposer\\.org/commit-deps for more information","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Composer/Downloader/SvnDownloader.php","lineNumber":75,"sourceCode":"            }\n        }\n\n        $this->io->writeError(\" Checking out \".$package->getSourceReference());\n        $this->execute($package, $url, ['svn', 'co'], sprintf(\"%s/%s\", $url, $ref), null, $path);\n\n        return \\React\\Promise\\resolve(null);\n    }\n\n    /**\n     * @inheritDoc\n     */\n    protected function doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url): PromiseInterface\n    {\n        SvnUtil::cleanEnv();\n        $ref = $target->getSourceReference();\n\n        if (!$this->hasMetadataRepository($path)) {\n            throw new \\RuntimeException('The .svn directory is missing from '.$path.', see https://getcomposer.org/commit-deps for more information');\n        }\n\n        $util = new SvnUtil($url, $this->io, $this->config, $this->process);\n        $flags = [];\n        if (version_compare($util->binaryVersion(), '1.7.0', '>=')) {\n            $flags[] = '--ignore-ancestry';\n        }\n\n        $this->io->writeError(\" Checking out \" . $ref);\n        $this->execute($target, $url, array_merge(['svn', 'switch'], $flags), sprintf(\"%s/%s\", $url, $ref), $path);\n\n        return \\React\\Promise\\resolve(null);\n    }\n\n    /**\n     * @inheritDoc\n     */\n    public function getLocalChanges(PackageInterface $package, string $path): ?string","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/composer/composer/blob/c435d285c9120efdca35696769c72ea9fdcc0466/src/Composer/Downloader/SvnDownloader.php#L57-L93","documentation":"Thrown by SvnDownloader::doUpdate() when hasMetadataRepository($path) is false, i.e. the expected .svn directory is absent from the package's install path. An update requires an existing checkout to switch; without .svn metadata Composer cannot perform an in-place svn switch.","triggerScenarios":"An update of a package that was previously installed from SVN source, but the .svn directory in vendor/<pkg> was removed, manually cleaned, or never created (e.g. install was interrupted or someone deleted VCS metadata).","commonSituations":"A prior cleanup script stripped .svn dirs from vendor; the package dir was partially deleted; an interrupted checkout left no metadata; switching from dist to source on an existing dist install.","solutions":["Remove the package directory under vendor/ and re-run composer install for a fresh checkout.","Avoid scripts that delete VCS metadata (.svn/.git/.hg) from vendor.","Run `composer install --prefer-source` to recreate the checkout.","See https://getcomposer.org/commit-deps as referenced in the message."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before an SVN source update, confirm .svn metadata exists.\nif (!is_dir($path.'/.svn')) {\n    // re-create the checkout rather than attempting an update.\n    $filesystem->removeDirectory($path);\n    throw new \\RuntimeException(\"No .svn metadata in $path; will re-download from scratch.\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    $downloader->update($initial, $target, $path, $url);\n} catch (\\RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'The .svn directory is missing')) {\n        // delete $path and call download() to re-checkout, then retry update\n    } else {\n        throw $e;\n    }\n}","preventionTips":["Never strip .svn (or .git/.hg) from vendor directories.","If a checkout looks partial, remove it and reinstall from source.","Avoid scripts that 'clean' VCS metadata out of vendor."],"tags":["svn","vcs","missing-metadata","update"],"backgroundTag":null,"analyzedSha":"c435d285c9120efdca35696769c72ea9fdcc0466","analyzedAt":"2026-08-07T18:58:23.525Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}