puppetlabs/puppet · error · ArgumentError
No file containing checksums found.
Error message
No file containing checksums found.
What it means
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.
Source
Thrown at lib/puppet/module_tool/applications/checksummer.rb:47
# to the installed module directory. This return value is used by the
# module_tool face changes action, and displayed on the console.
#
# Example return value:
#
# [ "REVISION", "manifests/init.pp"]
#
changes
end
private
def checksums
if checksums_file.exist?
Puppet::Util::Json.load(checksums_file.read)
elsif metadata_file.exist?
# Check metadata.json too; legacy modules store their checksums there.
Puppet::Util::Json.load(metadata_file.read)['checksums'] or
raise ArgumentError, _("No file containing checksums found.")
else
raise ArgumentError, _("No file containing checksums found.")
end
end
def metadata_file
@path + 'metadata.json'
end
def checksums_file
@path + 'checksums.json'
end
end
end
end
View on GitHub (pinned to e227c27540)
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.
Example fix
# before begin changes = Checksummer.run(path) rescue ArgumentError raise end # after begin changes = Checksummer.run(path) rescue ArgumentError changes = [] # no checksum baseline recorded end
Defensive patterns
Strategy: try-catch
Validate before calling
def checksum_source(path) return :checksums_json if File.exist?(File.join(path, 'checksums.json')) meta = File.join(path, 'metadata.json') return :metadata if File.exist?(meta) && Puppet::Util::Json.load(File.read(meta))['checksums'] nil end return :no_baseline unless checksum_source(module_path)
Try / catch
begin changes = Puppet::ModuleTool::Applications::Checksummer.run(module_path) rescue ArgumentError => e raise unless e.message == 'No file containing checksums found.' changes = [] # module has no recorded checksum baseline end
Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unable to find metadata.json in module root at %{path} See h
- Could not %{action} '%{module_name}', did you mean '%{sugges
- Could not %{action} '%{module_name}'; %{error}
- Could not find a valid module at %{path}
- Not a valid full name: %{full_module_name}
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/74b35b466ce032e7.
Report an issue: GitHub.