When i was try to build Hugo app at 23.02.2020 from Gitlab got fail on theme submodule extracting stage. Console log write

=> Cloning submodules
   warning: error cloning submodules: invalid auth method

I have try with next conditions:

  • project and submodule repos are in different gitlab groups
  • i’m owner of private groups, project and submodule repo
  • submodule has been added as https link
  • also tried to add https link with deploy tokens and there always rise same error.

What i’m doing wrong?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

👋 @DenysK

Great question. Git submodules are a bit of a pain; that said we are iterating on this and trying to make it better in the future. I do have a workaround that will hopefully handle your needs:

This assumes that your submodule is hosted in the same account/team as your app repository.

When an app is created from a GitLab project, we create and assign a deploy key to that project. Our build system uses that deploy key to check out the repository code as well as all submodule repositories. This means we need to enable that deploy key on the submodules repository.

Get the deploy key UUID from the app repo by going to the project, then

  1. Settings
  2. Repository
  3. Deploy Keys
  4. Copy the deploy key name (it’s a UUID)

then go to the submodule repository, and

  1. Settings
  2. Repository
  3. Deploy Keys
  4. Privately accessible deploy keys
  5. Search for the deploy key matching the UUID copied from the above step and click Enable.

You will also need to use the git ssh URL instead of the git https url in your .gitmodules file. So git@gitlab.com:owner/repo.git instead of https://gitlab.com/owner/repo.git.

  • Thanks for reply and clarification of deploy process.

    Well… But you reply describe only workaround for current situation. If i have plans to deploy over 100 apps this action turns to pain in ass obviously.
    Is any possibility to automate ssh key propagation to submodules via DO operator?
    I think there submodules list is bottleneck for this action. But i think it is possible to check repo for submodules file and search repos via gitlab api by url or something similar

    Also… Urls format for submodule repos in gitlab should well documented, cause i have find recommendations to add submodules via https for github accounts
    Source: https://www.digitalocean.com/docs/app-platform/how-to/troubleshoot-app/#review-github-permissions

    Anyway, thanks for help!