{"record":{"id":"74b35b466ce032e7","repo":"puppetlabs/puppet","slug":"no-file-containing-checksums-found","errorCode":null,"errorMessage":"No file containing checksums found.","messagePattern":"No file containing checksums found\\.","errorType":"exception","errorClass":"ArgumentError","httpStatus":null,"severity":"error","filePath":"lib/puppet/module_tool/applications/checksummer.rb","lineNumber":47,"sourceCode":"        # to the installed module directory. This return value is used by the\n        # module_tool face changes action, and displayed on the console.\n        #\n        # Example return value:\n        #\n        #   [ \"REVISION\", \"manifests/init.pp\"]\n        #\n        changes\n      end\n\n      private\n\n      def checksums\n        if checksums_file.exist?\n          Puppet::Util::Json.load(checksums_file.read)\n        elsif metadata_file.exist?\n          # Check metadata.json too; legacy modules store their checksums there.\n          Puppet::Util::Json.load(metadata_file.read)['checksums'] or\n            raise ArgumentError, _(\"No file containing checksums found.\")\n        else\n          raise ArgumentError, _(\"No file containing checksums found.\")\n        end\n      end\n\n      def metadata_file\n        @path + 'metadata.json'\n      end\n\n      def checksums_file\n        @path + 'checksums.json'\n      end\n    end\n  end\nend\n","sourceCodeStart":29,"sourceCodeEnd":63,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/module_tool/applications/checksummer.rb#L29-L63","documentation":"Checksummer#checksums raises ArgumentError('No file containing checksums found.') from the elsif branch when checksums.json is absent but metadata.json exists, yet its parsed content has no truthy 'checksums' key (the `or raise` triggers). Legacy modules embedded checksums in metadata.json; if neither location yields checksum data, there is nothing to diff local changes against.","triggerScenarios":"Running Checksummer.run(module_path) (used by uninstall change detection and install AlreadyInstalled reporting) on a module with no checksums.json and a metadata.json lacking a 'checksums' field — e.g. any module authored with modern tooling, which no longer writes checksums into metadata.json.","commonSituations":"Calling `puppet module uninstall`/`install --force` flows against hand-built or freshly generated modules; CI scripts invoking Puppet::ModuleTool::Applications::Checksummer directly on source checkouts; modules installed from git rather than Forge tarballs.","solutions":["If you control the code path, treat this ArgumentError as 'no baseline' and proceed or skip change detection (the installer itself wraps Checksummer.run in a rescue for exactly this reason).","Generate a checksums.json next to the module files with per-file digests if you need change detection.","For uninstall, pass --ignore_changes/--force when local-change tracking is not required."],"exampleFix":"# before\nbegin\n  changes = Checksummer.run(path)\nrescue ArgumentError\n  raise\nend\n\n# after\nbegin\n  changes = Checksummer.run(path)\nrescue ArgumentError\n  changes = []  # no checksum baseline recorded\nend","handlingStrategy":"try-catch","validationCode":"def checksum_source(path)\n  return :checksums_json if File.exist?(File.join(path, 'checksums.json'))\n  meta = File.join(path, 'metadata.json')\n  return :metadata if File.exist?(meta) && Puppet::Util::Json.load(File.read(meta))['checksums']\n  nil\nend\n\nreturn :no_baseline unless checksum_source(module_path)","typeGuard":null,"tryCatchPattern":"begin\n  changes = Puppet::ModuleTool::Applications::Checksummer.run(module_path)\nrescue ArgumentError => e\n  raise unless e.message == 'No file containing checksums found.'\n  changes = [] # module has no recorded checksum baseline\nend","preventionTips":["Treat missing checksums as 'unknown local changes', not a hard failure, in wrapper scripts (mirroring the installer's own rescue).","For modules where change detection matters, keep a checksums.json next to the files.","Remember modern Forge tarballs carry checksums.json; source checkouts will not."],"tags":["puppet","module-tool","checksums","missing-file"],"backgroundTag":"missing-checksums-file","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}