Skip to content

Command failed: git fetch --unshallow --tags for a coworker with slow connection, works for me - dubious ownership #11618

@jankapte

Description

@jankapte
  • VSCode Version: Dev Containers 0.454.0 in VS Code 1.117.0
  • Local OS Version: Win 11

I'm facing a very strange problem here. Using devcontainers with a ~100 MB repo (in case size matters) fails on my co-workers PC, but works fine on mine. Exactly same configuration, same version, same image, same git sha. Only difference is location, I'm in Europe, my coworker is in India an connection speed is a bit slower, although I don't think that matters here.

We both create a fresh devcontainer via f1->clone repo in named volume, choose a new volume name and wait.

Key extract from the logs:

Coworker:

[2026-04-29T04:10:42.587Z] Start: Run in container: git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
[2026-04-29T04:10:42.690Z] 
[2026-04-29T04:10:44.082Z] Stop (1495 ms): Run in container: git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
[2026-04-29T04:10:44.093Z] Start: Run in container: git fetch --unshallow --tags
[2026-04-29T04:10:44.195Z] 
[2026-04-29T04:10:51.396Z] remote: Enumerating objects: 11892, done.
remote: Counting objects:  91% (10822/11892)
�]0;C:\Program Files\RedHat\Podman\podman.exe�
[2026-04-29T04:10:51.424Z] remote: Counting objects: 100% (11892/11892), done.
remote: Compressing objects:  87% (4883/5612)

[2026-04-29T04:10:51.436Z] remote: Compressing objects: 100% (5612/5612), done.
Receiving objects:   1% (119/11815)

[2026-04-29T04:10:51.617Z] Receiving objects:   2% (237/11815)

[2026-04-29T04:10:51.630Z] Receiving objects:   3% (355/11815)

[2026-04-29T04:10:51.764Z] Receiving objects:   4% (473/11815)

. . . 

[2026-04-29T04:13:03.151Z] Resolving deltas:  87% (5248/6032)

[2026-04-29T04:13:03.172Z] Resolving deltas:  95% (5731/6032)

[2026-04-29T04:13:03.187Z] Resolving deltas:  99% (5972/6032)

[2026-04-29T04:13:03.197Z] Resolving deltas: 100% (6032/6032), completed with 49 local objects.
[2026-04-29T04:13:03.518Z] fatal: detected dubious ownership in repository at '/workspaces/<target>'
To add an exception for this directory, call:git config --global --add safe.directory /workspaces/<target>
error: remote did not send all necessary objects
[2026-04-29T04:13:03.527Z] fatal: detected dubious ownership in repository at '/workspaces/<target>'
To add an exception for this directory, call:git config --global --add safe.directory /workspaces/<target>
[2026-04-29T04:13:04.601Z] Stop (140508 ms): Run in container: git fetch --unshallow --tags
[2026-04-29T04:13:04.626Z] Command failed: git fetch --unshallow --tags

My log (working):

[2026-04-29T09:03:04.050Z] Start: Run in container: git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
[2026-04-29T09:03:04.288Z] 
[2026-04-29T09:03:05.725Z] Stop (1675 ms): Run in container: git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
[2026-04-29T09:03:05.744Z] Start: Run in container: git fetch --unshallow --tags
[2026-04-29T09:03:05.998Z] 
[2026-04-29T09:03:09.614Z] remote: Enumerating objects: 11894, done.
remote: Counting objects:  91% (10824/11894)
�]0;C:\Program Files\RedHat\Podman\podman.exe�
[2026-04-29T09:03:09.644Z] remote: Counting objects: 100% (11894/11894), done.
remote: Compressing objects: 100% (5614/5614), done.
Receiving objects:   0% (1/11817)

[2026-04-29T09:03:09.659Z] Receiving objects:   1% (119/11817)

. . .

[2026-04-29T09:03:30.054Z] Resolving deltas:  99% (5972/6032)

[2026-04-29T09:03:30.070Z] Resolving deltas: 100% (6032/6032), completed with 49 local objects.
[2026-04-29T09:03:31.307Z] From <redacted>

. . .
<long list of found tags and branches here>
. . .

[2026-04-29T09:03:31.336Z] 
[2026-04-29T09:03:31.366Z] warning: 8d71a77fe8277d6b3cc14a7ca49dcfb5e9d2474a:.gitmodules, multiple configurations found for 'submodule.<redacted>.path'. Skipping second one!
warning: 8d71a77fe8277d6b3cc14a7ca49dcfb5e9d2474a:.gitmodules, multiple configurations found for 'submodule.<redacted>.url'. Skipping second one!
warning: 8d71a77fe8277d6b3cc14a7ca49dcfb5e9d2474a:.gitmodules, multiple configurations found for 'submodule.<redacted>.path'. Skipping second one!
warning: 8d71a77fe8277d6b3cc14a7ca49dcfb5e9d2474a:.gitmodules, multiple configurations found for 'submodule.<redacted>.url'. Skipping second one!
warning: 8d71a77fe8277d6b3cc14a7ca49dcfb5e9d2474a:.gitmodules, multiple configurations found for 'submodule.<redacted>.path'. Skipping second one!
warning: 8d71a77fe8277d6b3cc14a7ca49dcfb5e9d2474a:.gitmodules, multiple configurations found for 'submodule.<redacted>.url'. Skipping second one!
[2026-04-29T09:03:33.005Z] Stop (27261 ms): Run in container: git fetch --unshallow --tags

Any ideas what this would cause? Since this happens before building the devcontainer based on the image, there's nothing I could fix to make it work at the first time, only use onCreateCommand or postCreateCommand to fix the git permissions and unshallow. But why does this happen in first place? Are there any git settings on the host that are injected into the devcontainer build?

Thanks :)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions