{"record":{"id":"27dc298c1bbb887e","repo":"chocolatey/choco","slug":"one-or-more-issues-found-with-0-please-fix-all","errorCode":null,"errorMessage":"One or more issues found with {0}, please fix all validation items above listed as errors.","messagePattern":"One or more issues found with (.+?), please fix all validation items above listed as errors\\.","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/services/NugetService.cs","lineNumber":2291,"sourceCode":"\r\n                        break;\r\n\r\n                    case infrastructure.rules.RuleType.Note:\r\n                        this.Log().Info(\"NOTE: \" + message);\r\n\r\n                        if (!string.IsNullOrEmpty(rule.HelpUrl))\r\n                        {\r\n                            this.Log().Info(\"      See {0}\", rule.HelpUrl);\r\n                        }\r\n\r\n                        break;\r\n                }\r\n            }\r\n\r\n            if (hasErrors)\r\n            {\r\n                this.Log().Info(string.Empty);\r\n                throw new InvalidDataException(\"One or more issues found with {0}, please fix all validation items above listed as errors.\".FormatWith(nuspecFilePath));\r\n            }\r\n        }\r\n\r\n        private string GetInstallDirectory(IPackageMetadata installedPackage)\r\n        {\r\n            var pathResolver = NugetCommon.GetPathResolver(_fileSystem);\r\n            var installDirectory = pathResolver.GetInstallPath(new PackageIdentity(installedPackage.Id, installedPackage.Version));\r\n\r\n            if (!_fileSystem.DirectoryExists(installDirectory))\r\n            {\r\n                return null;\r\n            }\r\n\r\n            return installDirectory;\r\n        }\r\n\r\n        protected virtual void EnsurePackageFilesHaveCompatibleAttributes(ChocolateyConfiguration config, IPackageMetadata installedPackage)\r\n        {\r","sourceCodeStart":2273,"sourceCodeEnd":2309,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/services/NugetService.cs#L2273-L2309","documentation":"Thrown as InvalidDataException after running nuspec validation rules (e.g. during choco pack / template validation) once hasErrors is true because at least one rule reported an error severity. The message points at the nuspec file path and instructs fixing every item logged above as an error.","triggerScenarios":"Calling nuspec rule validation on a .nuspec where at least one IValidationRule reports RuleType.Error; hasErrors flips true and the throw fires with the nuspec file path.","commonSituations":"A nuspec missing required metadata (id/version/description/authors); an invalid semantic version; malformed licenseUrl/projectUrl/iconUrl; element values failing rule checks during pack.","solutions":["Read every validation error logged immediately above the exception and fix each item marked 'error'","Ensure required metadata elements (id, version, description, authors) are present and valid","Run choco pack with --verbose to surface all failed rules","Diff against a known-good nuspec template to find the offending element"],"exampleFix":"// before\n<metadata><id>MyPkg</id><version>1.0</version></metadata>\n// after\n<metadata><id>MyPkg</id><version>1.0.0</version><authors>Me</authors><description>Desc</description></metadata>","handlingStrategy":"validation","validationCode":"// Pre-validate the nuspec with the same rules before packing.\nvar rules = new NuspecRuleValidator();\nvar results = rules.Validate(nuspecFilePath);\nif (results.Any(r => r.RuleType == RuleType.Error)) {\n    foreach (var r in results.Where(r => r.RuleType == RuleType.Error)) Console.Error.WriteLine(r.Message);\n    return; // fix metadata, do not attempt pack\n}","typeGuard":null,"tryCatchPattern":"try { choco.Pack(nuspecPath); }\ncatch (InvalidDataException ex) when (ex.Message.Contains(\"validation items above listed as errors\")) {\n    // re-run validation and surface every failing rule for the user\n    logger.Error(ex.Message);\n}","preventionTips":["Always include id, version (valid semver), description, and authors in nuspec metadata","Run a local nuspec linter/validator before choco pack","Keep URLs (license/project/icon) well-formed and reachable"],"tags":["nuspec","validation","pack"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}