I have a bitbucket repository which runs through a pipeline. The repository also has a git submodule. The submodule came from a public repository on github. When I try to update the submodule as part of my pipeline, it fails.
# I have this .gitmodules file in the root of my repo:
[submodule "website_content/themes/beautifulhugo"]
path = website_content/themes/beautifulhugo
url = git@github.com:halogenica/beautifulhugo.git
# And in my bitbucket pipeline, I try to update the submodule:
+ git submodule update --recursive --init
Submodule 'website_content/themes/beautifulhugo' (git@github.com:halogenica/beautifulhugo.git) registered for path 'website_content/themes/beautifulhugo'
Cloning into '/opt/atlassian/pipelines/agent/build/website_content/themes/beautifulhugo'...
fatal: unable to fork
fatal: clone of 'git@github.com:halogenica/beautifulhugo.git' into submodule path '/opt/atlassian/pipelines/agent/build/website_content/themes/beautifulhugo' failed
Failed to clone 'website_content/themes/beautifulhugo'. Retry scheduled
Cloning into '/opt/atlassian/pipelines/agent/build/website_content/themes/beautifulhugo'...
fatal: unable to fork
fatal: clone of 'git@github.com:halogenica/beautifulhugo.git' into submodule path '/opt/atlassian/pipelines/agent/build/website_content/themes/beautifulhugo' failed
Failed to clone 'website_content/themes/beautifulhugo' a second time, aborting
# The submodule is a public repo, so why is bitbucket pipelines unable to clone this?
Anybody know why this fails to clone, when its cloning from a public repository?
Using a submodule url that starts with `git@github.com` clones over SSH and requires and SSH key, even though the remote repository is public.
Switching the submodule to use git://github.com/<user>/<repo> works, and presumably HTTPS would also.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.