Skip to content

🐞 ModuleSource fails with would clobber existing tag #9405

Closed

Description

@vmaffet-fast

What is the issue?

We have recently started seeing issues with private modules

When moving tags get updated on the repo containing the dagger modules, the first few dagger calls will error on loading the dependencies.
The error looks like this:

From ssh://github.com/<owner>/<repo>
 * branch            bf8c67bef729d2754633367b112060ef39adfcea -> FETCH_HEAD
 ! [rejected]        actions-v1 -> actions-v1  (would clobber existing tag)
 ! [rejected]        modules-v2 -> modules-v2  (would clobber existing tag)

It seems like it fetches the ref successfully (bf8c67be here) but unrelated tags update fail the pipeline.

I will be looking into moving the tags to branches, however it seemed strange that the dagger call would fail when these tags are not used in my dagger.json.

Dagger version

dagger v0.15.1 (registry.dagger.io/engine:v0.15.1) darwin/arm64

Steps to reproduce

Not sure on the exact sequence of events, but moving tags such as actions-v1 get updated, then doing dagger call on a module with dependencies to that repository fails with the would clobber existing tag message.

Here is an example dagger.json of a module that was failing:

{
  "name": "dagger",
  "engineVersion": "v0.15.1",
  "sdk": "go",
  "dependencies": [
    {
      "name": "conftest",
      "source": "ssh://github.com/<owner>/<repo>/modules/conftest@vincent/conftest",
      "pin": "bf8c67bef729d2754633367b112060ef39adfcea"
    },
    {
      "name": "github",
      "source": "ssh://github.com/<owner>/<repo>/modules/github@main",
      "pin": "c1bfdd036bc965688f02f6c0c6fa287be88dc79b"
    },
    {
      "name": "helm",
      "source": "ssh://github.com/<owner>/<repo>/modules/helm@vincent/helm",
      "pin": "d17aa3014e06587309852fac1f62ed717575707e"
    },
    {
      "name": "registry",
      "source": "ssh://github.com/<owner>/<repo>/modules/registry@main",
      "pin": "c1bfdd036bc965688f02f6c0c6fa287be88dc79b"
    }
  ],
  "source": "."
}

Log output

1   : dagger -v call -m .dagger all --auth-token env:TOKEN
2   : │ connect
3   : │ │ starting engine
3   : │ │ starting engine DONE [0.0s]
4   : │ │ connecting to engine
4   : │ │ [0.0s] | engine name=dagger-engine-amd-dagger-helm-engine-qgm6k version=v0.15.1 client=2ftbup3aa1y3f4hoqfdn6kol7
4   : │ │ [0.0s] | cloud url=https://dagger.cloud/traces/setup
4   : │ │ connecting to engine DONE [0.0s]
5   : │ │ starting session
5   : │ │ starting session DONE [0.0s]
2   : │ connect DONE [0.0s]
6   : │ load module
7   : │ │ finding module configuration
8   : │ │ initializing module

9   : consuming /v1/traces
9   : consuming /v1/traces DONE [0.0s]

10  : consuming /v1/logs
10  : consuming /v1/logs DONE [0.0s]

11  : consuming /v1/metrics
11  : consuming /v1/metrics DONE [0.0s]

12  : ModuleSource.resolveFromCaller: ModuleSource!
13  : │ upload /home/runner/_work/<action_repo>/<action_repo> from d9g2us5qew8s4wrarvr8ju20y (client id: 2ftbup3aa1y3f4hoqfdn6kol7, session id: rksm3res6drsrouffwrtljiqp) (include: .dagger/dagger.json, .dagger/**/*, **/go.mod, **/go.sum, **/go.work, **/go.work.sum, **/vendor/, **/*.go) (exclude: **/.git)
13  : │ upload /home/runner/_work/<action_repo>/<action_repo> from d9g2us5qew8s4wrarvr8ju20y (client id: 2ftbup3aa1y3f4hoqfdn6kol7, session id: rksm3res6drsrouffwrtljiqp) (include: .dagger/dagger.json, .dagger/**/*, **/go.mod, **/go.sum, **/go.work, **/go.work.sum, **/vendor/, **/*.go) (exclude: **/.git) DONE [0.1s]
12  : ModuleSource.resolveFromCaller DONE [0.1s]

14  : moduleSource(refString: ".dagger"): ModuleSource!
14  : moduleSource DONE [0.0s]

15  : ModuleSource.kind: ModuleSourceKind!
15  : ModuleSource.kind DONE [0.0s]

16  : ModuleSource.resolveContextPathFromCaller: String!
16  : ModuleSource.resolveContextPathFromCaller DONE [0.0s]

17  : ModuleSource.asModule: Module!

18  : initialize dependencies

19  : git://github.com/<owner>/<repo>#c1bfdd036bc965688f02f6c0c6fa287be88dc79b
19  : git://github.com/<owner>/<repo>#c1bfdd036bc965688f02f6c0c6fa287be88dc79b DONE [0.0s]

20  : git://github.com/<owner>/<repo>#bf8c67bef729d2754633367b112060ef39adfcea

21  : moduleSource(refPin: "bf8c67bef729d2754633367b112060ef39adfcea", refString: "ssh://github.com/<owner>/<repo>/modules/conftest@vincent/conftest"): ModuleSource!
20  : │ git://github.com/<owner>/<repo>#bf8c67bef729d2754633367b112060ef39adfcea ERROR [0.8s]
20  : │ ! failed to fetch remote ssh://[email protected]/<owner>/<repo>: git error: exit status 1
stderr:
From ssh://github.com/<owner>/<repo>
 * branch            bf8c67bef729d2754633367b112060ef39adfcea -> FETCH_HEAD
 ! [rejected]        actions-v1 -> actions-v1  (would clobber existing tag)
 ! [rejected]        modules-v2 -> modules-v2  (would clobber existing tag)

21  : moduleSource ERROR [0.8s]
21  : ! failed to resolve git src to commit: failed to fetch remote ssh://[email protected]/<owner>/<repo>: git error: exit status 1
stderr:
From ssh://github.com/<owner>/<repo>
 * branch            bf8c67bef729d2754633367b112060ef39adfcea -> FETCH_HEAD
 ! [rejected]        actions-v1 -> actions-v1  (would clobber existing tag)
 ! [rejected]        modules-v2 -> modules-v2  (would clobber existing tag)

[...]

Activity

  1. jedevc commented on Jan 20, 2025

    @jedevc
    Contributor

    😢 this is an upstream issue: moby/buildkit#5567

    Will take a look 🎉

  2. added
    kind/upstream
    kind/bug
    on Jan 20, 2025
  3. removed
    kind/upstream
    on Apr 11, 2025
  4. jedevc commented on Apr 23, 2025

    @jedevc
    Contributor

    Fixed by #9980.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions