Git clone ...farmbot_os.git --recursive does not work

Hi,

the documentation describes the following command to download the Farmbot_os sources.
But it generates an error:

git clone https://github.com/FarmBot/farmbot_os.git --recursive
Cloning into ‘farmbot_os’…
remote: Enumerating objects: 134, done.
remote: Counting objects: 100% (134/134), done.
remote: Compressing objects: 100% (107/107), done.
remote: Total 52640 (delta 41), reused 59 (delta 20), pack-reused 52506
Receiving objects: 100% (52640/52640), 71.91 MiB | 10.60 MiB/s, done.
Resolving deltas: 100% (31948/31948), done.
Submodule ‘farmbot_firmware/c_src/farmbot-arduino-firmware’ (git@github.com:Farmbot/farmbot-arduino-firmware.git) registered for path ‘farmbot_firmware/c_src/farmbot-arduino-firmware’
Cloning into ‘/Users/klaus/Projects/Farmbot/farmbot_os/farmbot_firmware/c_src/farmbot-arduino-firmware’…
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of ‘git@github.com:Farmbot/farmbot-arduino-firmware.git’ into submodule path ‘/Users/klaus/Projects/Farmbot/farmbot_os/farmbot_firmware/c_src/farmbot-arduino-firmware’ failed
Failed to clone ‘farmbot_firmware/c_src/farmbot-arduino-firmware’. Retry scheduled
Cloning into ‘/Users/klaus/Projects/Farmbot/farmbot_os/farmbot_firmware/c_src/farmbot-arduino-firmware’…
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of ‘git@github.com:Farmbot/farmbot-arduino-firmware.git’ into submodule path ‘/Users/klaus/Projects/Farmbot/farmbot_os/farmbot_firmware/c_src/farmbot-arduino-firmware’ failed
Failed to clone ‘farmbot_firmware/c_src/farmbot-arduino-firmware’ a second time, aborting

@Jaroslawsky This is likely a problem with your local machine and not a problem on our end. I was able to clone locally. I also called two different colleagues outside of Farmbot who have “known good” Git installations and it worked on their machines without issue.

Verified working locally:

╰─>$ git clone https://github.com/FarmBot/farmbot_os.git --recursive
Cloning into 'farmbot_os'...
remote: Enumerating objects: 138, done.
remote: Counting objects: 100% (138/138), done.
remote: Compressing objects: 100% (108/108), done.
remote: Total 52644 (delta 43), reused 64 (delta 22), pack-reused 52506
Receiving objects: 100% (52644/52644), 71.91 MiB | 2.49 MiB/s, done.
Resolving deltas: 100% (31950/31950), done.
Submodule 'farmbot_firmware/c_src/farmbot-arduino-firmware' (git@github.com:Farmbot/farmbot-arduino-firmware.git) registered for path 'farmbot_firmware/c_src/farmbot-arduino-firmware'
Cloning into '/foo/farmbot_os/farmbot_firmware/c_src/farmbot-arduino-firmware'...
remote: Enumerating objects: 176, done.        
remote: Counting objects: 100% (176/176), done.        
remote: Compressing objects: 100% (133/133), done.        
remote: Total 3064 (delta 120), reused 75 (delta 42), pack-reused 2888        
Receiving objects: 100% (3064/3064), 1.04 MiB | 2.17 MiB/s, done.
Resolving deltas: 100% (2299/2299), done.
Submodule path 'farmbot_firmware/c_src/farmbot-arduino-firmware': checked out '1711db1d9923bc295f81a5eb9952f6b3a10db6a9'
  • Are you able to clone other git repositories?
  • Have you set up SSH keys on your machine?

This issue on StackOverflow might be relevant to your setup.

@Jaroslawsky Actually, are you on a Windows machine by chance? I was able to find someone running Windows and they seem to hit the problem when using the --recursvie flag (but it works without the --recursive flag).

This 2-step process always works for me

  • Clone farmbot_os without using --recursive
  • Within the newly cloned repo, run git submodule update --init --recursive

F.w.i.w.

1 Like

Thanks for the hints.

The problem occurred to me on various systems: Big Sur, High Sierra, Windows 10.

In addition, it only happened when checking out the submodule, whether with the --recursive flag or with a separate command.

The problem is that it’s necessary to generate and configure an SSH key and to add it to your own GitHub account. How to do it is described here: https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/adding-a-new-ssh-key-to-your-github-account

After that everything worked.

Thank you
Klaus

2 Likes