#failed to parse git ref string...

1 messages · Page 1 of 1 (latest)

nimble urchin
#

I try to establish dagger.io in our group and tried to use a module that is stored in an internal on premise bitbucket instance. Whatever I try I get the following error:

failed to parse git ref string: failed to get repo root for import path: unrecognized import path

I've tried many variations of how to use remote repositories (https://docs.dagger.io/api/remote-repositories) but no success yet. Tried with a private but on gitlab.com hostet repo, and this worked right out of the box.

I read some code around the errors I got in dagger source repository and I find that it seems, a git repository might, depending on the hosting/type of server, is not equally well detected when using dagger.

The repository has the
This is the repo:
https://extranet.example.com/bitbucket/scm/~user/daggerverse
and the module is in /pvc_migrate

https://extranet.example.com/bitbucket/scm/~user/daggerverse.git/pvc_migrate@v0.1.0
https://extranet.example.com/bitbucket/scm/~user/daggerverse/pvc_migrate@v0.1.0

Any ideas? Thanks a lot

I tried also:

dagger core git -vvvvv --url extranet.example.com/bitbucket/scm/~user/daggerverse/pvc_migrate@v0.1.0

that lead to:

▼ git(url: "extranet.example.com/bitbucket/scm/~user/daggerverse/pvc_migrate@v0.1.0"): GitRepository! = xxh3:1234567812345678 0.2s
╰─● git(
┆ url: "https://extranet.example.com/bitbucket/scm/~user/daggerverse/pvc_migrate@v0.1.0"
┆ keepGitDir: true
┆ httpAuthUsername: "user"
┆ httpAuthToken: setSecret(name: "...."): Secret! = xxh3:1234567812345678
): GitRepository! = xxh3:1234567812345678 0.0s

● parsing command line arguments 0.0s

GitRepository@xxh3:1234567812345678

jovial ridge
nimble urchin
jovial ridge
#

@nimble urchin mind trying dagger -m extranet.example.com/bitbucket/scm/~user/daggerverse.git/pvc_migrate@v0.1.0 functions without https:// and see what happens?

nimble urchin
#

let me try…

#

(I know I did that too – I tried ~2hrs yesterday :D) – but I try again

jovial ridge
#

@nimble urchin mind sharing what's the git clone command for the repo where the module lives?

#

apologize for the back and forth. @distant cloak is currently the best person to provide inputs here but he was sleeping when you posted this 😄

distant cloak
# nimble urchin let me try…

Hey @nimble urchin ,

Taking a look -- it's totally possible that we have a bug on the parsing of the input ref 🙏 ; let me take a deeper look 👀 . Thanks for the detailed explanation in your first message, that helps a lot

nimble urchin
#

Thank you @distant cloak – let me know anytime if I should try out something.

jovial ridge
nimble urchin
#

just a sec – nearly oversight...

distant cloak
# nimble urchin just a sec – nearly oversight...

Ok I found the root cause (added your ref as a test case in):

$ go test -count=1 -run="TestRepoRootForImportPath" -v ./...
=== RUN   TestRepoRootForImportPath
2025/07/04 01:27:52 get "gitlab.com/testguigui1/dagger-public-sub/mywork/depth1/depth2": found meta tag vcs.metaImport{Prefix:"gitlab.com/testguigui1/dagger-public-sub/mywork", VCS:"git", RepoRoot:"https://gitlab.com/testguigui1/dagger-public-sub/mywork.git"} at https://gitlab.com/testguigui1/dagger-public-sub/mywork/depth1/depth2?go-get=1
2025/07/04 01:27:52 get "gitlab.com/testguigui1/dagger-public-sub/mywork/depth1/depth2": verifying non-authoritative meta tag
2025/07/04 01:27:52 get "gitlab.com/dagger-modules/test/more/dagger-test-modules-public/../../..": found meta tag vcs.metaImport{Prefix:"gitlab.com/dagger-modules/test/more/dagger-test-modules-public", VCS:"git", RepoRoot:"https://gitlab.com/dagger-modules/test/more/dagger-test-modules-public.git"} at https://gitlab.com/dagger-modules/test/more/dagger-test-modules-public?go-get=1
2025/07/04 01:27:52 get "gitlab.com/dagger-modules/test/more/dagger-test-modules-public/../../..": verifying non-authoritative meta tag
2025/07/04 01:27:52 get "dagger.io/dagger": found meta tag vcs.metaImport{Prefix:"dagger.io/dagger", VCS:"git", RepoRoot:"https://github.com/dagger/dagger-go-sdk"} at https://dagger.io/dagger?go-get=1
    vcs_test.go:318: RepoRootForImportPath("extranet.example.com/bitbucket/scm/~user/daggerverse.git/pvc_migrate"): unrecognized import path "extranet.example.com/bitbucket/scm/~user/daggerverse.git/pvc_migrate"
--- FAIL: TestRepoRootForImportPath (1.01s)
FAIL
FAIL    github.com/dagger/dagger/engine/vcs     1.014s
FAIL

Our function RepoRootForImportPath (taking from go's pattern, to allow refs with and without the .git), to know the root of the repo (per provider) -- does not handle the pattern matching of your ref.

For example, this works: extranet.example.com/bitbucket/daggerverse.git/pvc_migrate. Digging 👀

#
  • It's been a while, i need to double check what bitbucket exposes us -- one thing I'm curious about, could you please share the gitlab ref (even obfuscated) -- curious about the pattern
#
  • Also, another question, is this the pattern: example.com/bitbucket/... for self hosted bitbucket refs ? Or it's a free-for-all thing ahah [will do my research on the side in the meantime]
nimble urchin
#

Thanks a lot! I appreciate your work on this. The pattern we use, I think, can be very flexible if you mean this. I'd not expect the url pattern to match any pre-known one when it comes to on premise self hosted bitbucket instance.

nimble urchin
#

@distant cloak thanks a lot fixing this – it will definitely enable our journey with dagger within our company.

jovial ridge
distant cloak
nimble urchin
#

@distant cloak it works, first try.