aws-amplify / aws-amplify/amplify-hosting
Unable to clone a repo with private git submodules.
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
### Before opening, please confirm:
- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
### App Id
arn:aws:amplify:us-east-1:465512941999:apps/d1zlbbwrkaj7oo
### AWS Region
us-east-1
### Amplify Hosting feature
Git providers
### Frontend framework
React
### Next.js version
13
### Next.js router
App Router
### Describe the bug
When my code has private git submodules, the build step fails. The error is as follows -
```sh
# Unable to update submodules: Error: Command failed: git submodule update
Cloning into '/codebuild/output/src3058105818/src//src/components/common-css-components'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:org/.git' into submodule path '/codebuild/output/src3058105818/src//src/components/common-css-components' failed
Failed to clone 'src/components/common-css-components'. Retry scheduled
Cloning into '/codebuild/output/src3058105818/src//src/components/common-css-components'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:org/.git' into submodule path '/codebuild/output/src3058105818/src/src/components/common-css-components' failed
Failed to clone 'src/components/common-css-components' a second time, aborting
```
### Expected behavior
It should be able to clone the sub module with the connect git app has been provided access to the git sub module repository
### Reproduction steps
1. Add a private git repo to your amplify app
2. push to github to trigger the build job
### Build Settings
_No response_
### Log output
```
# Put your logs below this line
```
### Additional information
_No response_
Contributor guide
Research direction
Start with FAQ.md and CONTRIBUTING.md, then reproduce the Amplify Hosting build from the listed steps with a private Git submodule. Inspect the git submodule update output and the app's Build Settings; done means the build can clone the private submodule without the reported host-key or access error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, git, github, next.js, react
- Domain
- ci-cd, cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100