Submodule-sync.sh -> fatal: no URL for submodule-path 'modules/libcanard' in .gitmodules found

After rebase I started submodule-sync.sh and I received an error (no URL for libcanard found):

willy@willy-H81H3-EM2 ~/ardupilot $ ./Tools/gittools/submodule-sync.sh
fatal: Keine URL für Submodul-Pfad 'modules/libcanard' in .gitmodules gefunden
Synchronisiere Submodul-URL für 'modules/ChibiOS'
Synchronisiere Submodul-URL für 'modules/CrashDebug'
Synchronisiere Submodul-URL für 'modules/DroneCAN/DSDL'
Synchronisiere Submodul-URL für 'modules/DroneCAN/dronecan_dsdlc'
Synchronisiere Submodul-URL für 'modules/DroneCAN/libcanard'
Synchronisiere Submodul-URL für 'modules/DroneCAN/pydronecan'
Synchronisiere Submodul-URL für 'modules/gbenchmark'
Synchronisiere Submodul-URL für 'modules/gsoap'
Synchronisiere Submodul-URL für 'modules/gtest'
Synchronisiere Submodul-URL für 'modules/mavlink'
Synchronisiere Submodul-URL für 'modules/mavlink/pymavlink'
Synchronisiere Submodul-URL für 'modules/uavcan'
Synchronisiere Submodul-URL für 'modules/uavcan/dsdl'
Synchronisiere Submodul-URL für 'modules/uavcan/libuavcan/dsdl_compiler/pyuavcan'
Synchronisiere Submodul-URL für 'modules/uavcan/libuavcan/dsdl_compiler/pyuavcan/dsdl'
Synchronisiere Submodul-URL für 'modules/waf'
fatal: Keine URL für Submodul-Pfad 'modules/libcanard' in .gitmodules gefunden
Synchronisiere Submodul-URL für 'modules/ChibiOS'
Synchronisiere Submodul-URL für 'modules/CrashDebug'
Synchronisiere Submodul-URL für 'modules/DroneCAN/DSDL'
Synchronisiere Submodul-URL für 'modules/DroneCAN/dronecan_dsdlc'
Synchronisiere Submodul-URL für 'modules/DroneCAN/libcanard'
Synchronisiere Submodul-URL für 'modules/DroneCAN/pydronecan'
Synchronisiere Submodul-URL für 'modules/gbenchmark'
Synchronisiere Submodul-URL für 'modules/gsoap'
Synchronisiere Submodul-URL für 'modules/gtest'
Synchronisiere Submodul-URL für 'modules/mavlink'
Synchronisiere Submodul-URL für 'modules/mavlink/pymavlink'
Synchronisiere Submodul-URL für 'modules/uavcan'
Synchronisiere Submodul-URL für 'modules/uavcan/dsdl'
Synchronisiere Submodul-URL für 'modules/uavcan/libuavcan/dsdl_compiler/pyuavcan'
Synchronisiere Submodul-URL für 'modules/uavcan/libuavcan/dsdl_compiler/pyuavcan/dsdl'
Synchronisiere Submodul-URL für 'modules/waf'
fatal: Keine URL für Submodul-Pfad 'modules/libcanard' in .gitmodules gefunden
Synchronisiere Submodul-URL für 'modules/ChibiOS'
Synchronisiere Submodul-URL für 'modules/CrashDebug'
Synchronisiere Submodul-URL für 'modules/DroneCAN/DSDL'
Synchronisiere Submodul-URL für 'modules/DroneCAN/dronecan_dsdlc'
Synchronisiere Submodul-URL für 'modules/DroneCAN/libcanard'
Synchronisiere Submodul-URL für 'modules/DroneCAN/pydronecan'
Synchronisiere Submodul-URL für 'modules/gbenchmark'
Synchronisiere Submodul-URL für 'modules/gsoap'
Synchronisiere Submodul-URL für 'modules/gtest'
Synchronisiere Submodul-URL für 'modules/mavlink'
Synchronisiere Submodul-URL für 'modules/mavlink/pymavlink'
Synchronisiere Submodul-URL für 'modules/uavcan'
Synchronisiere Submodul-URL für 'modules/uavcan/dsdl'
Synchronisiere Submodul-URL für 'modules/uavcan/libuavcan/dsdl_compiler/pyuavcan'
Synchronisiere Submodul-URL für 'modules/uavcan/libuavcan/dsdl_compiler/pyuavcan/dsdl'
Synchronisiere Submodul-URL für 'modules/waf'
willy@willy-H81H3-EM2 ~/ardupilot $

I tried to solve that with support of Amilcar Lucas, but unfortunately with no success:
I updated git to version 2.36.1
I deleted my local repo and cloned it again
(I work on Linux Mint 20.3, based on Ubuntu 20.04)

The .gitmodules looks quite good:
gitmodules.txt (1.2 KB)

So we have no idea how to fix that or to come to the root cause.

Has anybody an idea?

In the meantime I recognized an empty and useless directory ‘modules/libcanard’, but I have no idea how to get rid of it.
Should I just delete it and commit that? But why is that historical directory still existing?

I think I’ve got it.
If you want to rebase a branch based on master older than 24.11.2021 to current master you have to:

  • delete modules/libcanard manually and commit that (it’s ignored at rebase, because it’s still in there)
  • rebase to master
  • update submodules

It’s been easy as soon as I understood what happened.

Note no need to delete or commit anything when moving forward. Just delete the module after you move forward and git status should show no changes.

1 Like

Thank you for that hint @hendjosh
I didn’t try out that because I’ve been a little afraid to produce a change.