Shippable / support

Shippable SaaS customers can report issues and feature requests in this repository
100 stars 28 forks source link

git submodule update fails #5150

Open vedant-khandelwal opened 3 years ago

vedant-khandelwal commented 3 years ago

Hello,

I'm using a submodule in a repo but shippable is unable to pull the repo during git submodule update with the error:

ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Link to the build failure: https://app.shippable.com/github/Falkonry/tiling/runs/1834/1/console

We've setup the subscription ssh key in the private submodule repo. Can you please help us fix the issue? Thanks

a-murphy commented 3 years ago

Could you double-check that the URL in the .gitmodules file is correct? There's a very similarly named project that has been enabled on Shippable and I wonder if it was meant to be the same. If the name is correct, then could you make sure that the key has been added to the repository that is the submodule and not the one using the submodule?

vedant-khandelwal commented 3 years ago
  1. The url in the .gitmodules is correct because the folder shows up in the github repo.
  2. The key has been added to the submodule repo itself, we're sure. First we tried to add the key from Settings>Deployment key but github gave an error saying "key already in use", so we created a new ssh key as a subscription integration with the permission, added it to github and shippable.yml then tried to run the build but that's failing too https://app.shippable.com/github/Falkonry/tiling/runs/1847/summary/console
a-murphy commented 3 years ago

SSH key integrations aren't handled in quite the same way as the subscription SSH key, so it doesn't know to use the integrations you've created. If you want to use a subscription integration, I'd suggest disabling submodules in the YML and then fetching the submodules in your script with something like ssh-agent bash -c 'ssh-add /tmp/ssh/your_integration_name; git submodule init; git submodule sync; git submodule update'.

GitHub only allows an SSH key to be added to one repository or one account, so alternatively, you could set up an account that has access to both repositories that need the subscription key and add the key to that account instead.