{"record":{"id":"78c534f6204f3a2a","repo":"ruby/rubygems","slug":"the-checksum-of-path-does-not-match-the-checks","errorCode":null,"errorMessage":"The checksum of /#{path} does not match the checksum provided by the server! Something is wrong. #{message}","messagePattern":"The checksum of /#(.+?) does not match the checksum provided by the server! Something is wrong\\. #(.+?)","errorType":"exception","errorClass":"Gem::CompactIndexClient::Updater::MismatchedChecksumError","httpStatus":null,"severity":"error","filePath":"lib/rubygems/compact_index_client/updater.rb","lineNumber":31,"sourceCode":"\nclass Gem::CompactIndexClient\n  # Updates the cached files on disk, keeping them in sync with the server\n  # using conditional requests (ETag) and ranged requests where possible.\n  class Updater\n    class MismatchedChecksumError < Error\n      def initialize(path, message)\n        super \"The checksum of /#{path} does not match the checksum provided by the server! Something is wrong. #{message}\"\n      end\n    end\n\n    def initialize(fetcher)\n      @fetcher = fetcher\n    end\n\n    def update(remote_path, local_path, etag_path)\n      append(remote_path, local_path, etag_path) || replace(remote_path, local_path, etag_path)\n    rescue CacheFile::DigestMismatchError => e\n      raise MismatchedChecksumError.new(remote_path, e.message)\n    rescue Zlib::GzipFile::Error\n      raise Error, \"invalid gzip response while fetching /#{remote_path}\"\n    end\n\n    private\n\n    def append(remote_path, local_path, etag_path)\n      return false unless local_path.file? && local_path.size.nonzero?\n\n      CacheFile.copy(local_path) do |file|\n        etag = etag_path.read.tap(&:chomp!) if etag_path.file?\n\n        # Subtract a byte to ensure the range won't be empty.\n        # Avoids 416 (Range Not Satisfiable) responses.\n        response = @fetcher.call(remote_path, request_headers(etag, file.size - 1))\n        break true if response.is_a?(Gem::Net::HTTPNotModified)\n\n        file.digests = parse_digests(response)","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/ruby/rubygems/blob/86cbb817a38ce8477b181c17467a703ded3f2be8/lib/rubygems/compact_index_client/updater.rb#L13-L49","documentation":"Error \"The checksum of /#{path} does not match the checksum provided by the server! Something is wrong. #{message}\" thrown in ruby/rubygems.","triggerScenarios":"Thrown at lib/rubygems/compact_index_client/updater.rb:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"86cbb817a38ce8477b181c17467a703ded3f2be8","analyzedAt":"2026-08-23T06:27:48.159Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}