ruby/rubygems · error · Gem::CompactIndexClient::Updater::MismatchedChecksumError
The checksum of /#{path} does not match the checksum provide
Error message
The checksum of /#{path} does not match the checksum provided by the server! Something is wrong. #{message} What it means
Error "The checksum of /#{path} does not match the checksum provided by the server! Something is wrong. #{message}" thrown in ruby/rubygems.
Source
Thrown at lib/rubygems/compact_index_client/updater.rb:31
class Gem::CompactIndexClient
# Updates the cached files on disk, keeping them in sync with the server
# using conditional requests (ETag) and ranged requests where possible.
class Updater
class MismatchedChecksumError < Error
def initialize(path, message)
super "The checksum of /#{path} does not match the checksum provided by the server! Something is wrong. #{message}"
end
end
def initialize(fetcher)
@fetcher = fetcher
end
def update(remote_path, local_path, etag_path)
append(remote_path, local_path, etag_path) || replace(remote_path, local_path, etag_path)
rescue CacheFile::DigestMismatchError => e
raise MismatchedChecksumError.new(remote_path, e.message)
rescue Zlib::GzipFile::Error
raise Error, "invalid gzip response while fetching /#{remote_path}"
end
private
def append(remote_path, local_path, etag_path)
return false unless local_path.file? && local_path.size.nonzero?
CacheFile.copy(local_path) do |file|
etag = etag_path.read.tap(&:chomp!) if etag_path.file?
# Subtract a byte to ensure the range won't be empty.
# Avoids 416 (Range Not Satisfiable) responses.
response = @fetcher.call(remote_path, request_headers(etag, file.size - 1))
break true if response.is_a?(Gem::Net::HTTPNotModified)
file.digests = parse_digests(response)View on GitHub (pinned to 86cbb817a3)
When it happens
Trigger: Thrown at lib/rubygems/compact_index_client/updater.rb:31 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ruby/rubygems@86cbb817a3 (2026-08-23).
Data as JSON: /api/errors/78c534f6204f3a2a.
Report an issue: GitHub.