devpod icon indicating copy to clipboard operation
devpod copied to clipboard

Cannot clone git repositories on Windows hosts

Open endocrimes opened this issue 1 year ago • 1 comments

What happened?

When using Windows 10, with git installed via scoop, trying to create a workspace in a remote Kubernetes environment fails during the repository clone step.

[14:13:02] debug Credentials server started...
[14:13:02] debug Create content folder C:\Users\Danielle\.devpod\agent\contexts\default\workspaces\spin-operator\content
[14:13:02] debug Clone Repository
[14:13:02] info Could not create process with command '"C:\Users\Danielle\scoop\apps\git\current\cmd\git.exe"  clone --config "credential.helper=!'C:\Program Files\DevPod\devpod-cli.exe' agent git-credentials --port 13488" https://github.com/spinkube/spin-operator C:\Users\Danielle\.devpod\agent\contexts\default\workspaces\spin-operator\content'.
[14:13:02] error Cloning failed: clone repository: error cloning repository: exit status 1. Trying cloning on local machine and uploading folder
[14:13:02] info Cloning from host and upload folder to server
[14:13:02] debug Error receiving from stream: rpc error: code = Unknown desc = exit status 1
[14:13:02] info EOF
[14:13:02] info cloning local folder
[14:13:02] info github.com/loft-sh/devpod/cmd/agent/workspace.RemoteCloneAndDownload
[14:13:02] info D:/a/devpod/devpod/cmd/agent/workspace/up.go:367
[14:13:02] info github.com/loft-sh/devpod/cmd/agent/workspace.prepareWorkspace
[14:13:02] info D:/a/devpod/devpod/cmd/agent/workspace/up.go:216
[14:13:02] info github.com/loft-sh/devpod/cmd/agent/workspace.initWorkspace
[14:13:02] info D:/a/devpod/devpod/cmd/agent/workspace/up.go:137
[14:13:02] info github.com/loft-sh/devpod/cmd/agent/workspace.(*UpCmd).Run
[14:13:02] info D:/a/devpod/devpod/cmd/agent/workspace/up.go:81
[14:13:02] info github.com/loft-sh/devpod/cmd/agent/workspace.NewUpCmd.func1
[14:13:02] info D:/a/devpod/devpod/cmd/agent/workspace/up.go:53
[14:13:02] info github.com/spf13/cobra.(*Command).execute
[14:13:02] info D:/a/devpod/devpod/vendor/github.com/spf13/cobra/command.go:983
[14:13:02] info github.com/spf13/cobra.(*Command).ExecuteC
[14:13:02] info D:/a/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1115
[14:13:02] info github.com/spf13/cobra.(*Command).Execute
[14:13:02] info D:/a/devpod/devpod/vendor/github.com/spf13/cobra/command.go:1039
[14:13:02] info github.com/loft-sh/devpod/cmd.Execute
[14:13:02] info D:/a/devpod/devpod/cmd/root.go:90
[14:13:02] info main.main
[14:13:02] info D:/a/devpod/devpod/main.go:6
[14:13:02] info runtime.main
[14:13:02] info C:/Users/runneradmin/go/pkg/mod/golang.org/[email protected]/src/runtime/proc.go:271
[14:13:02] info runtime.goexit
[14:13:02] info C:/Users/runneradmin/go/pkg/mod/golang.org/[email protected]/src/runtime/asm_amd64.s:1695
[14:13:02] info exit status 1

This is "interesting" because directly executing the command succeeds:

PS C:\Users\Danielle> git clone --config "credential.helper=!'C:\Program Files\DevPod\devpod-cli.exe' agent git-credentials --port 14160" https://github.com/spinkube/spin-operator C:\Users\Danielle\.devpod\agent\contexts\default\workspaces\spin-operator\content
Cloning into 'C:\Users\Danielle\.devpod\agent\contexts\default\workspaces\spin-operator\content'...
remote: Enumerating objects: 2067, done.
remote: Counting objects: 100% (895/895), done.
remote: Compressing objects: 100% (384/384), done.
remote: Total 2067 (delta 691), reused 602 (delta 509), pack-reused 1172 (from 1)
Receiving objects: 100% (2067/2067), 1.27 MiB | 11.64 MiB/s, done.
Resolving deltas: 100% (1225/1225), done.

What did you expect to happen instead?

The repository to clone and the workspace to be successfully created.

How can we reproduce the bug? (as minimally and precisely as possible)

  • Acquire a Windows host
  • Install git (potentially via scoop)
  • Install DevPod and configure a remote environment
  • Try to create a workspace from any repository

Local Environment:

  • DevPod Version: 0.5.19
  • Operating System: windows
  • ARCH of the OS: AMD64

DevPod Provider:

  • Cloud Provider: N/A (bare metal Kubernetes on a Talos cluster)
  • Kubernetes Provider: v1.30.1

Anything else we need to know?

endocrimes avatar Aug 14 '24 12:08 endocrimes

@endocrimes thanks for reporting this issue, we'll look into it 👍

pascalbreuninger avatar Sep 02 '24 08:09 pascalbreuninger

@endocrimes Another user reported something similiar in https://github.com/loft-sh/devpod/issues/1250, could you try the fix there and see if that works for you? Simply wrap the call to DevPod Desktop in a shell, something like

#! /usr/bin/env sh

exec $SHELL -c 'exec /Applications/DevPod.app/Contents/MacOS/DevPod'

I think it can't find jetbrains because it does not have access to the correct PATH

bkneis avatar Oct 17 '24 15:10 bkneis

Just a hint: I have a similar issue - Devpod was not able to find installed Git for Windows. As I added %LOCALAPPDATA%\Programs\Git\cmd\ to the system path all goes fine.

I would classify this behaviour as a bug and the solution would be that Devpod also respects the path configuration of the user profile.

thomashucke avatar Dec 11 '24 10:12 thomashucke

I'll figure out a Windows shell situation later this week (My "windows" workstation is mostly my photo editing system that I happen to also do some dev work on via WSL2 bc I got tired of dual booting, so there's a bare minimum of tooling on the windows side)

endocrimes avatar Dec 11 '24 13:12 endocrimes

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Feb 11 '25 01:02 github-actions[bot]

This issue was closed because it has been inactive for 30 days since being marked as stale.

github-actions[bot] avatar Mar 13 '25 02:03 github-actions[bot]