{"record":{"id":"fcf5e38b0f4ef196","repo":"abpframework/abp","slug":"file-path-does-not-exist","errorCode":null,"errorMessage":"File {path} does not exist!","messagePattern":"File (.+?) does not exist!","errorType":"exception","errorClass":"CliUsageException","httpStatus":null,"severity":"error","filePath":"framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs","lineNumber":402,"sourceCode":"            \"node_modules\",\n            \"wwwroot\",\n            \".git\",\n            \"bin\",\n            \"obj\"\n        };\n\n        var allCultureNames = CultureInfo.GetCultures(CultureTypes.AllCultures).Where(x => !x.Name.IsNullOrWhiteSpace()).Select(x => x.Name).ToList();\n        return Directory.GetFiles(path, \"*.json\", SearchOption.AllDirectories)\n            .Where(file => excludeDirectory.All(x => file.IndexOf(x, StringComparison.OrdinalIgnoreCase) == -1))\n            .Where(file => allCultureNames.Any(x => Path.GetFileName(file).Equals($\"{x}.json\", StringComparison.OrdinalIgnoreCase)))\n            .WhereIf(!cultureName.IsNullOrWhiteSpace(), jsonFile => Path.GetFileName(jsonFile).Equals($\"{cultureName}.json\", StringComparison.OrdinalIgnoreCase));\n    }\n\n    private AbpLocalizationInfo GetAbpLocalizationInfoOrNull(string path)\n    {\n        if (!File.Exists(path))\n        {\n            throw new CliUsageException(\n                $\"File {path} does not exist!\" +\n                Environment.NewLine + Environment.NewLine +\n                GetUsageInfo()\n            );\n        }\n\n        var json = File.ReadAllText(path);\n        JObject jObject;\n        try\n        {\n            jObject = JObject.Parse(json);\n        }\n        catch (Exception)\n        {\n            return null;\n        }\n\n        var culture = jObject.GetValue(\"culture\") ?? jObject.GetValue(\"Culture\");","sourceCodeStart":384,"sourceCodeEnd":420,"githubUrl":"https://github.com/abpframework/abp/blob/7ed43b1931b9df46a50c0c59148a18645641d0df/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/TranslateCommand.cs#L384-L420","documentation":"Thrown inside `GetAbpLocalizationInfoOrNull` when the supplied path does not exist on disk. Despite the generic message, this is a `CliUsageException` raised during `abp translate` after the path has already been used elsewhere, so reaching it means a path was passed that the filesystem cannot resolve.","triggerScenarios":"Calling `GetAbpLocalizationInfoOrNull(path)` (internally during translate) with a path whose parent directory or filename is misspelled, or where the file was deleted between the `File.Exists` check and the call.","commonSituations":"Mismatched culture name casing on case-sensitive filesystems (Linux); relative path resolved against an unexpected working directory; file removed by another process mid-command.","solutions":["Check the exact path in the message and confirm it exists with `ls`/File Explorer, paying attention to case on Linux/macOS.","Re-run `abp translate` from the solution root so `ResourcePath` resolves correctly.","Ensure no antivirus or build process is deleting the culture JSON during the run."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"string path = Path.Combine(resourcePath, culture + \".json\");\nif (!File.Exists(path))\n    throw new FileNotFoundException($\"Localization file not found: {path}\");\n// case-sensitive check on Linux\nvar onDisk = Directory.GetFiles(resourcePath, \"*.json\")\n    .FirstOrDefault(f => string.Equals(Path.GetFileName(f), culture + \".json\", StringComparison.Ordinal));\nif (onDisk == null)\n    throw new InvalidOperationException($\"Casing mismatch for culture file: {path}\");","typeGuard":null,"tryCatchPattern":"try { info = GetAbpLocalizationInfoOrNull(path); }\ncatch (CliUsageException ex) when (ex.Message.StartsWith(\"File \"))\n{\n    logger.LogWarning(\"Localization file missing; will skip resource: {Path}\", path);\n    continue;\n}","preventionTips":["Use exact casing for culture filenames (Linux is case-sensitive).","Run `abp translate` from the solution root so ResourcePath resolves correctly.","Lock the directory during the run to prevent concurrent deletion."],"tags":["cli","localization","translate","filesystem","file-not-found"],"backgroundTag":null,"analyzedSha":"7ed43b1931b9df46a50c0c59148a18645641d0df","analyzedAt":"2026-08-13T16:26:11.351Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}