aws-amplify / aws-amplify/amplify-hosting

Amplifypush gives Error: Missing required dependencies to package

Open
#1,368 8 comments 4 reactions 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
Build works fine when i initialize the project, like no backend lambda functions, but as soon as add just one example lambda function, build starts failing. I'm able to do an amplify push on my local and backend can be deployed from local, but when i do a git push, and trigger the build, i get build failure, here is the log

this log is extracted from amplify console build log

**To Reproduce**
my lambda functions are written in Java 11

``` # Starting phase: build
# Executing command: amplifyPush --simple
2020-12-12T19:06:51.858Z [INFO]:
2020-12-12T19:06:51.860Z [INFO]: For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html
2020-12-12T19:06:52.171Z [INFO]: Amplify AppID found: dmby4dyvtonmc. Amplify App name is: xxx
2020-12-12T19:06:52.219Z [INFO]: Backend environment dev found in Amplify Console app: xxx
2020-12-12T19:06:52.966Z [WARNING]: - Fetching updates to backend environment: dev from the cloud.
2020-12-12T19:06:53.240Z [WARNING]: ✔ Successfully pulled backend environment dev from the cloud.
2020-12-12T19:06:53.273Z [INFO]:
2020-12-12T19:06:55.243Z [INFO]: Note: It is recommended to run this command from the root of your app directory
2020-12-12T19:07:00.103Z [WARNING]: - Initializing your environment: dev
2020-12-12T19:07:00.386Z [WARNING]: ✔ Initialized provider successfully.
2020-12-12T19:07:00.561Z [INFO]: Unable to find Java version >=11 on the path. Download link: https://amzn.to/2UUljp9
Unable to find Java compiler version >=11 on the path. Download link: https://amzn.to/2UUljp9
Unable to find Gradle version >=5 on the path. Download link: https://bit.ly/3aGYDj6
2020-12-12T19:07:00.562Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud
2020-12-12T19:07:00.562Z [WARNING]: ✖ There was an error initializing your environment.
2020-12-12T19:07:00.564Z [INFO]: init failed
2020-12-12T19:07:00.565Z [INFO]: Error: Missing required dependencies to package User
 at Object.buildResource (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/build-resources.js:30:11)
 at processTicksAndRejections (internal/process/task_queues.js:97:5)
 at packageResource (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:483:16)
 at async Promise.all (index 0)
 at Object.run (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:102:5)
2020-12-12T19:07:00.581Z [ERROR]: !!! Build failed
2020-12-12T19:07:00.582Z [ERROR]: !!! Non-Zero Exit Code detected
2020-12-12T19:07:00.582Z [INFO]: # Starting environment caching...
2020-12-12T19:07:00.582Z [INFO]: # Environment caching completed
```

**Expected behavior**
amplify should build with no errors

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Research direction

Start with the amplifyPush --simple build step and the dependency checks shown in the Amplify Console log. Inspect the reported build-resources.js path and the Java 11, Java compiler, and Gradle version requirements. Done means a Git-triggered build can package and deploy an Amplify project containing a Java 11 Lambda without the missing-dependencies error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, git, java
Domain
backend, ci-cd, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.