Skip to content

[deps-edn] Incorrect resolution of S3 repository URL when there are query params #37487

@rarkins

Description

@rarkins

Discussed in #36784

Originally posted by isapim July 1, 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.

GitHub v41.6.2

Please tell us more about your question or problem

Minimal reproduction: https://github.com/isapim/renovate-deps-edn

Hello, everyone! 😄

On Clojure's tools.deps, configuring the AWS region for the maven repository S3 bucket through query params is an acceptable approach (as seen here and here). This region is used for downloading the project dependencies.

However, when the region query param is present, Renovate solves the URL incorrectly. In the minimal reproduction, for example, it searches for the package on the s3://ipim-test-maven/ipim/commons/dynamodb-local/ path instead of the s3://ipim-test-maven/release/ipim/commons/dynamodb-local/ one as it should.

Reading the Renovate source code, it is possible to see that the problem happens exactly at the getMavenUrl function:

> new URL('ipim/commons/dynamodb-local/maven-metadata.xml', 's3://ipim-test-maven/release?region=us-east-2/') // Renovate adds a trailing slash because URL requires it
URL {
  href: 's3://ipim-test-maven/ipim/commons/dynamodb-local/maven-metadata.xml',
  origin: 'null',
  protocol: 's3:',
  username: '',
  password: '',
  host: 'ipim-test-maven',
  hostname: 'ipim-test-maven',
  port: '',
  pathname: '/ipim/commons/dynamodb-local/maven-metadata.xml',
  search: '',
  searchParams: URLSearchParams {},
  hash: ''
}

This could probably be solved by changing the deps-edn exporter to ignore query params of the S3 URL when it exists, because whereas the region is useful for tools.deps, it isn't for Renovate. But I'm open to other suggestions as well!

Workaround

To work around this issue, we use registryUrls on the packageRules for the specific packages:

{
      "matchManagers": ["deps-edn"],
      "matchDepNames": ["ipim.commons/**"],
      "registryUrls": ["s3://ipim-test-maven/release/"],
      "enabled": true
}

Additional Info

Self-hosted Renovate Config (renovate-config.js)

module.exports = {
  branchPrefix: 'renovate/',
  username: 'renovate-release',
  gitAuthor: 'Renovate Bot <bot@renovateapp.com>',
  onboarding: true,
  dryRun: 'full',
  platform: 'github',
  repositories: ['isapim/renovate-deps-edn'],
};

And the Github action step:

- name: Run Renovate
  uses: renovatebot/github-action@v43.0.1
  with:
    renovate-version: 41.6.2
    configurationFile: renovate-config.js
    token: ${{ secrets.RENOVATE_TOKEN }}
    env-regex: ^(?:RENOVATE_\w+|LOG_LEVEL|AWS_\w+)$
  env:
    AWS_ACCESS_KEY_ID: ${{ env.AWS_ACCESS_KEY_ID }}
    AWS_SECRET_ACCESS_KEY: ${{ env.AWS_SECRET_ACCESS_KEY }}
    AWS_SESSION_TOKEN: ${{ env.AWS_SESSION_TOKEN }}
    AWS_REGION: ${{ env.AWS_REGION }}
    LOG_LEVEL: debug

Logs (if relevant)

Logs

DEBUG: Looking up ipim.commons:dynamodb-local in repository s3://ipim-test-maven/release?region=us-east-2/ (repository=isapim/renovate-deps-edn)
DEBUG: Maven S3 lookup error: unknown error (repository=isapim/renovate-deps-edn)
       "failedUrl": "s3://ipim-test-maven/ipim/commons/dynamodb-local/maven-metadata.xml",
       "err": {
         "name": "NoSuchKey",
         "$fault": "client",
         "$metadata": {
           "httpStatusCode": 404,
           "requestId": "CNETZVCK79V86ZC8",
           "extendedRequestId": "E3rD0p7gwQlWvQmJa36S53uFKEKXhVdoW055gYqDc5WyGU7+afy0UiXz35Gii7yCXnEFoeCnlq5n4zoEYEExC/Qy99wZNXyTXUW0DFBMO/Q=",
           "attempts": 1,
           "totalRetryDelay": 0
         },
         "Code": "NoSuchKey",
         "Key": "ipim/commons/dynamodb-local/maven-metadata.xml",
         "RequestId": "CNETZVCK79V86ZC8",
         "HostId": "E3rD0p7gwQlWvQmJa36S53uFKEKXhVdoW055gYqDc5WyGU7+afy0UiXz35Gii7yCXnEFoeCnlq5n4zoEYEExC/Qy99wZNXyTXUW0DFBMO/Q=",
         "message": "The specified key does not exist.",
         "stack": "NoSuchKey: The specified key does not exist.
         

Metadata

Metadata

Assignees

No one assigned

    Labels

    manager:deps-ednpriority-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