#git not found in path?

1 messages · Page 1 of 1 (latest)

frozen crypt
#

Ran through the Dagger demo, then tried to run dagger init --sdk=go and I'm seeing this error over and over again in logs:
git init --bare in /go/pkg/mod/cache/vcs/d734c3a6ab88fcf6cd7b74ee7260b1c55713a27a59b0a8ec2ef99e776d1f070a: exec: "git": executable file not found in $PATH

Any idea what could be causing that? Why is dagger trying to run git init? The executable is definitely in my path:

$ which git
/usr/bin/git
solid token
#

@frozen crypt is this v0.12.2?

solid token
#

@frozen crypt just renamed my git binary locally to something else and dagger init still works. LMK whenver you have a sec so we can see what's happening

frozen crypt
#

Thanks for the reply... I was running an outdated version of Dagger. Updated to latest and now getting the error where Go can't download modules from a private repo (fatal: could not read Username for 'https://github.com': terminal prompts disabled). However, have GOPRVIVATE set, ~/.gitconfig setup to use SSH, and I'm able to download these modules outside of Dagger. 🤔

solid token
#

Is your .gitconfig in your machine? Or do you populate it as part of your pipeline?

frozen crypt
#

No, I don't have a dagger pipeline at all. I'm trying to "daggerize" a project so that I can build a dagger pipeline (similar to this step in the tutorial). I get the error when running dagger init. I have the .gitconfig on my machine.

solid token
#

Oh, I see

#

Are you behind a proxy or a corporate network

#

?

#

I assume your network can't access go modules publicly?

frozen crypt
#

Not on a proxy. I am on a corporate network, but I can fetch the modules outside of dagger init. The modules are not publicly available and I'm not using a private Go proxy.

solid token
#

or you're trying to do something custom with private modules?

frozen crypt
#

Yes, just a regular dagger init in an existing project. I don't understand why dagger init is trying to download the modules at all.

solid token
#

ok, I think I know what might be happening

#

can you try creating a folder insdie your project and doing the dagger init there?

frozen crypt
#

Tried running it in a new folder, still seeing the error (changed the company/mod name for privacy)

solid token
#

can you try the following please?

  • rollback any changes to your project's go.mod and go.sum files with git restore
  • go into the dagger dir again and run dagger init --sdk go --source .
#

oh wait

#

sorry about the confusion, this changed recently and I'm not entirely familiarized how it was changed

#

ok try, the following please:

  • do the dagger init --sdk go in a folder outside you project
  • copy that folder within your projet and then you should be able to do dagger -m $folder functions
#

it's still related to the issue above. When you run dagger init in an existing project, Dagger merges the existing go.mod files with the one Dagger requires and this causes some issues

#

I'll bump the priority on this issue to get it fixed ASAP

frozen crypt
#

Thanks! I'm signing off for the day, but I'll give that a try first thing tomorrow. Appreciate your help 🙏

frozen crypt
#

I think that worked (at least no errors)! I have a wall of meetings today, but I'll try to confirm this afternoon. Thanks again 🥳

solid token
frozen crypt
#

Following up... ended up getting everything working. Had massage the output files a bit due to how I executed the command, but was a good learning experience on the structure of the dagger module. Thanks again for your help @solid token!