Github checkout broken

I’m using WSL (Ubuntu 16.04) for years now without any issue. My input is this as described in the docu:

git clone -b Copter-4.2 https://github.com/Ardupilot/ardupilot.git
cd ardupilot
git submodule update --init --recursive

then i get this error message:

Submodule path ‘modules/waf’: checked out 51f1529bd20759642e9fd0a8db648da9ba380b18’
Failed to recurse into submodule path 'modules/DroneCAN/libcanard’

Any idea how to resolve this ?

hello

Try : Tools/gittools/submodule-sync.sh twice and it should be good.

4 Likes

Thank you for your answer. I ran this script 5 times, but i get allways these errors:

fatal: reference is not a tree: 103745afb42f15f83d49fc23530f7fe2c11358b8
Unable to checkout ‘103745afb42f15f83d49fc23530f7fe2c11358b8’ in submodule path ‘modules/DroneCAN/libcanard/dsdl_compiler/pyuavcan/uavcan/dsdl_files’
Failed to recurse into submodule path ‘modules/DroneCAN/libcanard/dsdl_compiler/pyuavcan’

and:

Failed to recurse into submodule path ‘modules/DroneCAN/libcanard’

While not a perfect solution, this error usually doesn’t prevent a firmware build.

If you aren’t using the CAN bus, it is probably ok to proceed.

However, you should probably try to resolve it. Interesting that it failed on a fresh clone. That’s usually my solution whenever submodule updates appear broken, since I rarely have much need to maintain a clone for more time than it takes to try an experiment or two, or, in rare cases (for me), make a pull request.

Yes, it is a fresh clone indeed. I deleted the whole ardupilot directory before the clone.

I would really like to do that, but how ???

Sometimes just waiting a day or two and trying again helps. I know that’s not helpful right away, but I don’t have better advice on this particular topic.

$ sudo git submodule update --init --recursive
always fails

“Failed to recurse into submodule path ‘modules/libcanard’
Failed to recurse into submodule path ‘modules/uavcan’”

We also have this problem. I think this problem occors because the the github repositories “archived-libcanard” & “archived-uavcan” do not work normally.

Do not use sudo in that command or any other git commands.

There is a script in the scripts directory that you need to run to fix this particular known issue.

Thank you, the script must be “/Tools/gittools/submodule-sync.sh”. I also tried that, but it seems doesn’t work

Yes, that is the script. If it does not work update your git version

1 Like

Thank you, git version really matters!