aws-amplify / aws-amplify/amplify-hosting
Error: Creating a nested amplify project is not supported.
- 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.
### App Id
_No response_
### Region
us-east-1
### Amplify Hosting feature
Backend builds
### Describe the bug
In the last 24 hours (probably related to [@aws-amplify/cli version update](https://www.npmjs.com/package/@aws-amplify/cli)), my backend builds in my hosting deployments have failed trying to init the Amplify project with the following error:
```
2022-08-02T21:09:07.541Z [INFO]: File at path: '/codebuild/output/srcXXXXX/src/APPNAME/amplify/backend/amplify-meta.json' does not exist
2022-08-02T21:09:07.551Z [WARNING]: ✖ Sending zip
2022-08-02T21:09:07.556Z [INFO]: 🛑 Creating a nested amplify project is not supported. Project root detected: /codebuild/output/srcXXXXX/src/APPNAME
2022-08-02T21:09:07.557Z [INFO]: Error: Creating a nested amplify project is not supported. Project root detected: /codebuild/output/srcXXXXX/src/APPNAME
at checkForNestedProject (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/helpers/projectUtils.js:9:15)
at Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/commands/pull.js:69:50)
at Object.executeAmplifyCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:292:29)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:64:3)
at Function.runMain (pkg/prelude/bootstrap.js:1848:13)
at internal/main/run_main_module.js:17:47
at async executePluginModuleCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:142:5)
at async executeCommand (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/execution-manager.js:40:9)
at async Object.run (/snapshot/repo/build/node_modules/@aws-amplify/cli-internal/lib/index.js:165:13)
```
### Expected behavior
```
2022-08-01T21:36:31.041Z [INFO]: [0mAmplify AppID found: XXXXX. Amplify App name is: APPNAME[0m
2022-08-01T21:36:31.102Z [INFO]: [0mBackend environment dev found in Amplify Console app: APPNAME[0m
2022-08-01T21:36:36.520Z [WARNING]: - Fetching updates to backend environment: dev from the cloud.
2022-08-01T21:36:41.255Z [WARNING]: - Building resource auth/APPNAMEXXXXX
```
>
### Reproduction steps
1. Push changes to GitHub branches as usual
2. ...
3. Profit (Error occurs in hosting backend build)
### Build Settings
```yaml
version: 1
applications:
- backend:
phases:
build:
commands:
- update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.8 11
- /usr/local/bin/pip3.8 install --user pipenv
- amplifyPush --simple
frontend:
phases:
preBuild:
commands:
- yarn
build:
commands:
- yarn build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
appRoot: web
```
### Additional information
- We're using a monorepo structure with a NextJS at the /web directory.
- I've updated my local @aws-amplify/cli version to 9.2.0, to no avail.
Contributor guide
Research direction
Start with the supplied Build Settings, especially appRoot: web and the amplifyPush --simple command, then compare that configuration with the failing log's detected project root and missing amplify-meta.json. Reproduce the backend build and verify that it completes with the expected Amplify environment and resource-building output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js
- 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