mosaic icon indicating copy to clipboard operation
mosaic copied to clipboard

Git Sources - Clone issue when multiple sources use the same repo

Open DavieReid opened this issue 1 year ago • 0 comments

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.

  1. both sources start up
  2. check for a previous clone which doesn't exist
  3. clone the repo
  4. find out that the other source has created the repo directory first
  5. 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.

DavieReid avatar Aug 25 '23 14:08 DavieReid