Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

cannot run npm run deploy #6

Open
WebbTseng opened this issue May 19, 2023 · 7 comments
Open

cannot run npm run deploy #6

WebbTseng opened this issue May 19, 2023 · 7 comments

Comments

@WebbTseng
Copy link


executor failed running [/bin/sh -c npm run build]: exit code: 1
[100%] fail: docker build --tag cdkasset-eac8aa482c5b0aaf9cf45dca81711c0e905f42cb36626f8893814cdde62907a0 --platform linux/amd64 . exited with error code 1: #1 [internal] load build definition from Dockerfile
#1 sha256:94ad57c069987cc5f2545ee37b0f671e5b0cc64f5b79f45035c90208c26c311d
#1 transferring dockerfile: 37B done
#1 DONE 0.0s

{A[Y].splice(0,A[v]npm ERR! code ELIFECYCLE
#14 0.836 npm ERR! errno 1
#14 0.839 npm ERR! @ build: next build
#14 0.839 npm ERR! Exit status 1
#14 0.839 npm ERR!
#14 0.840 npm ERR! Failed at the @ build script.
#14 0.840 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
#14 0.844
#14 0.844 npm ERR! A complete log of this run can be found in:
#14 0.844 npm ERR! /root/.npm/_logs/2023-05-19T21_05_51_228Z-debug.log
#14 ERROR: executor failed running [/bin/sh -c npm run build]: exit code: 1

[builder 5/5] RUN npm run build:


executor failed running [/bin/sh -c npm run build]: exit code: 1
stg-aiStoriesBackend: building assets...

[0%] start: Building b4dc6bab39417a56a230ec51c4b77694c3b7e2b741828a002aac1ca2bc339ebb:current_account-current_region
[0%] start: Building 4aea577eb744c3399c23dd93a5ab40e0b5a9bb67b0a65cd383ca9c1b728b6e1b:current_account-current_region
[0%] start: Building 369141d9c3fce053bfb036a3081d5b6ac09d809d33f4e7705d3bb95f4708fe08:current_account-current_region
[0%] start: Building 61c63449bfa374126c263ef985e327bb569ab247e7e1537d0542c77b2e18ab0d:current_account-current_region
[25%] success: Built b4dc6bab39417a56a230ec51c4b77694c3b7e2b741828a002aac1ca2bc339ebb:current_account-current_region
[50%] success: Built 4aea577eb744c3399c23dd93a5ab40e0b5a9bb67b0a65cd383ca9c1b728b6e1b:current_account-current_region
[75%] success: Built 369141d9c3fce053bfb036a3081d5b6ac09d809d33f4e7705d3bb95f4708fe08:current_account-current_region
[100%] success: Built 61c63449bfa374126c263ef985e327bb569ab247e7e1537d0542c77b2e18ab0d:current_account-current_region

stg-aiStoriesBackend: assets built

❌ Building assets failed: Error: Building Assets Failed: Error: Failed to build one or more assets. See the error messages above for more information.
at buildAllStackAssets (/Users/chiweitseng/WorkSpace/gluten-ai/aws-serverless-ai-stories/backend/node_modules/aws-cdk/lib/index.js:347:116743)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async CdkToolkit.deploy (/Users/chiweitseng/WorkSpace/gluten-ai/aws-serverless-ai-stories/backend/node_modules/aws-cdk/lib/index.js:347:142824)
at async exec4 (/Users/chiweitseng/WorkSpace/gluten-ai/aws-serverless-ai-stories/backend/node_modules/aws-cdk/lib/index.js:402:51795)

Building Assets Failed: Error: Failed to build one or more assets. See the error messages above for more information.

@WebbTseng
Copy link
Author

#14 0.826 uncaughtException /app/node_modules/next/dist/compiled/undici/index.js:1

@davidwintermeyer
Copy link

Having a similar issue. @WebbTseng any luck?

@boyney123
Copy link
Contributor

Hey,

@davidwintermeyer you finding the same when you run the build command? What OS are you using?

@davidwintermeyer
Copy link

This was running npm run deploy

Screenshot 2023-06-12 at 1 39 58 PM

I looked at the stack hierarchy and tried to deploy individually. I was able to successfully deploy stg-aiStoriesTables.

When I try to deploy stg-webStack I get the following error:
Screenshot 2023-06-12 at 1 42 14 PM

I looked in CW logs of the Service being deployed and get this error [AppRunner] Deployment with ID : 69b1ddc9f98d41908af5517bf89e8138 failed. Failure reason : Failed to copy the image from ECR.

I tried to push an image to ECR myself. This is my ECR
Screenshot 2023-06-12 at 1 44 59 PM

My guess is that an issue with the assets is causing the image to not be pushed to ECR, which is why the stg-webStack is failing to deploy. I'm not sure how to debug this though - I'm not great with docker. Thanks for your help!

@mchugh7153
Copy link

mchugh7153 commented Jun 22, 2023

Was this issue ever resolved? @boyney123, @mmuller88

@calsaviour
Copy link

Update the Dockerfile to use. node:19-alpine

My guess is the next latest version was not compatible with node:14-apline.

And it works.

image

@khaneun
Copy link

khaneun commented Mar 16, 2024

Thanks for solving my same problem

Dockerfile Location for modification
~/aws-serverless-ai-stories/frontend/Dockerfile
2,10,17 line

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants