Open simpian opened 3 years ago
Can you provide your appId and region? What is the amplify cli version you used in AWS Amplify Console?
Can you provide your appId and region? What is the amplify cli version you used in AWS Amplify Console?
appid: dmby4dyvtonmc region: us-east-1
Hi @simpian Java is currently not supported in Amplify's default build image. I have created a backlog item for this, and we'll update here once this is added. In the meantime, as a workaround you can:
amplify push
your Java lambda function to deploy changesHappening to me also. Started after I added 1 API and 1 lambda function to a simple application I am working on. Like @simpian indicated
021-02-09T02:07:00.265Z [INFO]: 2021-02-09T02:07:00.268Z [INFO]: [0mFor more information on AWS Profiles, see:[0m [0mhttps://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html[0m 2021-02-09T02:07:00.753Z [INFO]: [0mAmplify AppID found: d3u1arczmsatez. Amplify App name is: strayaway[0m 2021-02-09T02:07:00.802Z [INFO]: [0mBackend environment dev found in Amplify Console app: strayaway[0m 2021-02-09T02:07:01.565Z [WARNING]: - Fetching updates to backend environment: dev from the cloud. 2021-02-09T02:07:01.910Z [WARNING]: ✔ Successfully pulled backend environment dev from the cloud. 2021-02-09T02:07:01.944Z [INFO]: 2021-02-09T02:07:04.174Z [INFO]: [33mNote: It is recommended to run this command from the root of your app directory[39m 2021-02-09T02:07:09.564Z [WARNING]: - Initializing your environment: dev 2021-02-09T02:07:09.890Z [WARNING]: ✔ Initialized provider successfully. 2021-02-09T02:07:10.400Z [INFO]: [31mpython3 found but version Python 3.7.9 is less than the minimum required version.[39m [31mYou must have python >= 3.8 installed and available on your PATH as "python3" or "python". It can be installed from https://www.python.org/downloads[39m [31mYou must have pipenv installed and available on your PATH as "pipenv". It can be installed by running "pip3 install --user pipenv".[39m 2021-02-09T02:07:10.400Z [WARNING]: ✖ An error occurred when pushing the resources to the cloud 2021-02-09T02:07:10.400Z [WARNING]: ✖ There was an error initializing your environment. 2021-02-09T02:07:10.403Z [INFO]: [31minit failed[39m 2021-02-09T02:07:10.405Z [INFO]: [0mError: Missing required dependencies to package strayawayfunc[0m [0m 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)[0m [0m at processTicksAndRejections (internal/process/task_queues.js:97:5)[0m [0m at packageResource (/root/.nvm/versions/node/v12.19.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/src/push-resources.ts:489:14)[0m [0m at async Promise.all (index 0)[0m [0m 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:113:5)[0m 2021-02-09T02:07:10.423Z [ERROR]: !!! Build failed 2021-02-09T02:07:10.424Z [ERROR]: !!! Non-Zero Exit Code detected 2021-02-09T02:07:10.424Z [INFO]: # Starting environment caching... 2021-02-09T02:07:10.424Z [INFO]: # Environment caching completed Terminating logging...
Hi, I'm facing a similar issue when using Python lambdas in my project. Is there any solution for this yet? Originally I was getting the same error as @si3mshady. So I added some lines to the build script to install Python 3.8 in the container before running amplifyPush:
- export BASE_PATH=$(pwd)
- yum install -y gcc openssl-devel bzip2-devel libffi-devel python3.8-pip > /dev/null
- cd /opt && wget -q https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz > /dev/null
- cd /opt && tar xzf Python-3.8.2.tgz > /dev/null
- cd /opt/Python-3.8.2 && ./configure --enable-optimizations > /dev/null
- cd /opt/Python-3.8.2 && make altinstall > /dev/null
- pip3.8 install --user pipenv > /dev/null
- ln -fs /usr/local/bin/python3.8 /usr/bin/python3 >/dev/null
- ln -fs /usr/local/bin/pip3.8 /usr/bin/pip3 > /dev/null
- cd $BASE_PATH
to the yml build specification. However, now it successfully installs python 3.8 but still errors out while pushing.
The error message looks like this:
Creating a virtualenv for this project...
Pipfile: /codebuild/output/src934188498/src/personal-frontend/amplify/backend/function/createAnInterviewLambda/Pipfile
Using /usr/local/bin/python3.8 (3.8.2) to create virtualenv...
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...
⠦ Creating virtual environment...
⠧ Creating virtual environment...
⠇ Creating virtual environment...
⠏ Creating virtual environment...
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...
⠦ Creating virtual environment...
⠧ Creating virtual environment...
⠇ Creating virtual environment...
⠏ Creating virtual environment...
⠋ Creating virtual environment...
⠙ Creating virtual environment...
⠹ Creating virtual environment...
⠸ Creating virtual environment...
⠼ Creating virtual environment...
⠴ Creating virtual environment...
⠦ Creating virtual environment...
⠧ Creating virtual environment...
⠇ Creating virtual environment...created virtual environment CPython3.8.2.final.0-64 in 1230ms
creator CPython3Posix(dest=/root/.local/share/virtualenvs/createAnInterviewLambda-l_7Y9xC-, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
added seed packages: pip==21.0.1, setuptools==52.0.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
✔ Successfully created virtual environment!
Virtualenv location: /root/.local/share/virtualenvs/createAnInterviewLambda-l_7Y9xC-
Installing dependencies from Pipfile.lock (98dbad)...] running command [pipenv install]
at Object.execAsStringPromise (/root/.nvm/versions/node/v12.21.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-python-function-runtime-provider/src/util/pyUtils.ts:43:11)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
2021-03-13T07:15:47.208Z [ERROR]: !!! Build failed
It seems to fail while installing dependencies from Pipfile.lock.
The only time it seems to work is when I override the Amplify CLI version to version 4.2 in Build Settings > Live Package Updates. However I would prefer if I didn't use such an outdated version of the CLI.
create a custom build image: https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html
Thank you for your advise !
I made some docker image for java11 corretto and gradle 6.4.1 to build it via Amplify Console. and finally It works well in my region (ap-northeast-1) To save time (for someone), I put link on here
https://gallery.ecr.aws/v5a0p7x7/amplify-build-java11-gradle
Is Go supported?
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
Expected behavior amplify should build with no errors
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.