mosaic
mosaic copied to clipboard
Git Sources - Clone issue when multiple sources use the same repo
If 2 or more sources use the same repo then there is an error thrown when cloning:
[Mosaic] Source Error: Command 'git clone <repo url> --no-checkout --origin=origin' failed: 128. fatal: destination path '<repo project-name>' already exists and is not an empty directory.
Basically, this is a timing issue at heart.
- both sources start up
- check for a previous clone which doesn't exist
- clone the repo
- find out that the other source has created the repo directory first
- throw error
We have logic that checks for a previous clone but it does not work across sources. A git source is only aware of what it has done.
Workaround
Schedule the sources to start with different delays. Delayed sources won't attempt a clone and will re-use the earlier cloned repo.