buildkit icon indicating copy to clipboard operation
buildkit copied to clipboard

fatal: Not a valid object name

Open tekumara opened this issue 2 years ago • 5 comments

#3 0.682 hint: Using 'master' as the name for the initial branch. This default branch name
#3 0.682 hint: is subject to change. To configure the initial branch name to use in all
#3 0.682 hint: of your new repositories, which will suppress this warning, call:
#3 0.682 hint:
#3 0.682 hint:       git config --global init.defaultBranch <name>
#3 0.682 hint:
#3 0.682 hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
#3 0.682 hint: 'development'. The just-created branch can be renamed via this command:
#3 0.682 hint:
#3 0.682 hint:       git branch -m <name>
#3 0.702 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/300/fs/
#3 0.856 fatal: Not a valid object name dd142c005ca6e2decf64b7e295e0f858d6195820^{commit}
#3 3.071 From https://github.com/tekumara/ghapp-dagger
#3 3.071  * [new branch]      main       -> origin/main
completed    duration=3.5s

when tying to solve:

llb.Git("https://github.com/tekumara/ghapp-dagger.git", "dd142c005ca6e2decf64b7e295e0f858d6195820")

Looks like it's fetching the correct git ref, but produces a fatal error in the logs.

tekumara avatar May 31 '22 06:05 tekumara

Did the remote definitely have that commit pushed at the time? What was the buildx command that was run?

arbourd avatar Jun 02 '22 17:06 arbourd

Yep it did have that commit, and it correctly fetches it. I was actually running this via dagger, not buildx.

tekumara avatar Jun 03 '22 05:06 tekumara

The log is coming from here:

https://github.com/moby/buildkit/blob/5ab03b48ac5f819cbbda2e76376a646e6d55d849/source/git/gitsource.go#L428-L433

Looks like just noisy logs coming from an optimization.

vito avatar Jan 11 '23 15:01 vito

Confirming this is reproducible, and seems to be just extraneous logging. The commit does exist, and the git operation is succesful.

It only happens when using a commit ref (eg: not happening if using a tag / branch).

#1 git://github.com/XXXX.git#ad41d95d0f171f6b8908b7d1aedcc3b5f83d11c2
#0 0.031 Initialized empty Git repository in /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/1/fs/
#0 0.080 fatal: Not a valid object name ad41d95d0f171f6b8908b7d1aedcc3b5f83d11c2^{commit}

I am using llb directly.

spacedub avatar Feb 09 '23 23:02 spacedub