Skip to content

Rubygems: error fetching rubygems data, falling back to versions-only result #37486

@rarkins

Description

@rarkins

Discussed in #36623

Originally posted by EugeneBad June 20, 2025

How are you running Renovate?

Self-hosted Renovate

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

Gitlab

Please tell us more about your question or problem

When pulling dependencies from rubygems.org eg with this Gemsfile:

source 'https://rubygems.org'

ruby '3.4.2'

gem '[bootsnap](https://rubygems.org/gems/bootsnap)', '~> 1.18'
gem '[rails](https://rubygems.org/gems/rails)', '~> 8.0'

The error "Rubygems: error fetching rubygems data, falling back to versions-only result" will get triggered because Renovate's internal consistency check (dataHash === versionsHash) fails. Here

The Root Cause: When creating the metadata-cache, renovate's rubygems datasource will fetch version lists from two places: 1. from https://rubygems.org/versions endpoint
2. from https://rubygems.org/api/v1/versions/<package_name>.json endpoint.
This is documented in the datasource's readme.
It then compares the hashes of the version strings returned by both endpoints ie a versionsHash and dataHash respectively.

For some reason, the version strings returned by the former will sometimes include platform suffixes like -java in the version string, e.g., "1.1.0-java" which differs from the version list extracted from the latter (which only provides the base version number, e.g., "1.1.0"). These differing string representations lead to different hashes, hence the error.

A package like bootsnap for example:

bootsnap 0.2.0,0.2.1,0.2.2,0.2.3,0.2.4,0.2.5,0.2.6,0.2.7,0.2.8,0.2.9,0.2.10,0.2.11,0.2.12,0.2.13,0.2.14,0.2.15,0.3.0.pre,0.3.0.pre2,0.3.0.pre3,0.3.0,0.3.1,0.3.2,1.0.0,1.1.0.pre,1.1.0.pre-java,1.1.0,1.1.0-java,1.1.1,1.1.1-java,1.1.2,1.1.2-java,1.1.3,1.1.3-java,1.1.4-java,1.1.5,1.1.5-java,1.1.6.beta,1.1.6.beta2,1.1.6.beta3,1.1.6,1.1.6-java,1.1.7,1.1.7-java,1.1.8-java,1.1.8,1.2.0.pre,1.2.0.pre-java,1.2.0,1.2.0-java,1.2.1,1.2.1-java,1.3.0.beta,1.3.0.beta-java,1.3.0.beta2,1.3.0.beta2-java,1.3.0,1.3.0-java,1.3.1,1.3.1-java,1.3.2,1.3.2-java,1.4.0.pre2,1.4.0.pre3,1.4.0-java,1.4.0,1.4.1,1.4.1-java,1.4.2.rc1,1.4.2.rc1-java,1.4.2.rc2,1.4.2.rc2-java,1.4.2.rc3,1.4.2,1.4.2-java,1.4.3,1.4.3-java,1.4.4,1.4.4-java,1.4.5,1.4.5-java,1.4.6,1.4.6-java,1.4.7-java,1.4.7,1.4.8,1.4.8-java,1.4.9.rc1,1.4.9,1.4.9-java,1.5.0,1.5.1,1.5.0-java,1.5.1-java,1.6.0,1.7.0,1.7.1.pre1,1.7.1,1.7.2,1.7.3,1.7.4,1.7.5,1.7.6,1.7.7,1.8.0,1.8.1,1.9.0,1.9.1,1.9.2,1.9.3,1.9.4,1.10.0,1.10.1,1.10.2,1.10.3,1.11.0,1.11.1,1.12.0,1.13.0,1.14.0,1.15.0,1.16.0,1.17.0,1.17.1,1.18.0,1.18.1,1.18.2,1.18.3,1.18.4,1.18.5,1.18.6
["1.18.6","1.18.5","1.18.4","1.18.3","1.18.2","1.18.1","1.18.0","1.17.1","1.17.0","1.16.0","1.15.0","1.14.0","1.13.0","1.12.0","1.11.1","1.11.0","1.10.3","1.10.2","1.10.1","1.10.0","1.9.4","1.9.3","1.9.2","1.9.1","1.9.0","1.8.1","1.8.0","1.7.7","1.7.6","1.7.5","1.7.4","1.7.3","1.7.2","1.7.1","1.7.1.pre1","1.7.0","1.6.0","1.5.1","1.5.1","1.5.0","1.5.0","1.4.9","1.4.9","1.4.9.rc1","1.4.8","1.4.8","1.4.7","1.4.7","1.4.6","1.4.6","1.4.5","1.4.5","1.4.4","1.4.4","1.4.3","1.4.3","1.4.2","1.4.2","1.4.2.rc3","1.4.2.rc2","1.4.2.rc2","1.4.2.rc1","1.4.2.rc1","1.4.1","1.4.1","1.4.0","1.4.0","1.4.0.pre3","1.4.0.pre2","1.3.2","1.3.2","1.3.1","1.3.1","1.3.0","1.3.0","1.3.0.beta2","1.3.0.beta2","1.3.0.beta","1.3.0.beta","1.2.1","1.2.1","1.2.0","1.2.0","1.2.0.pre","1.2.0.pre","1.1.8","1.1.8","1.1.7","1.1.7","1.1.6","1.1.6","1.1.6.beta3","1.1.6.beta2","1.1.6.beta","1.1.5","1.1.5","1.1.4","1.1.3","1.1.3","1.1.2","1.1.2","1.1.1","1.1.1","1.1.0","1.1.0","1.1.0.pre","1.1.0.pre","1.0.0","0.3.2","0.3.1","0.3.0","0.3.0.pre3","0.3.0.pre2","0.3.0.pre","0.2.15","0.2.14","0.2.13","0.2.12","0.2.11","0.2.10","0.2.9","0.2.8","0.2.7","0.2.6","0.2.5","0.2.4","0.2.3","0.2.2","0.2.1","0.2.0"]

Note that this error doesn't prevent renovate from updating the dependency.

The Solution:

  1. Change this log type from error to just an info, since renovate already gracefully handles the discrepancy between version lists by falling back to a "versions-only result.
  2. Rework the parsing logic in versions-endpoint-cache.ts file; to strip these platform suffixes, ensuring that both lists of versions are normalized before being hashed.

Logs (if relevant)

Logs

Replace this text with your logs, between the starting and ending triple backticks

Metadata

Metadata

Assignees

No one assigned

    Labels

    datasource:rubygemspriority-4-lowLow priority, unlikely to be done unless it becomes important to more people

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions