supabase-on-aws icon indicating copy to clipboard operation
supabase-on-aws copied to clipboard

AWS Stack deploy fails in Amplify Frontend

Open werkamsus opened this issue 1 year ago • 6 comments

Bug report

Describe the bug

The AWS Amplify build of the frontend fails (logs attached) This also happens on latest, stable, and build 7.0

I recall one-click deploying in december, where everything worked out of the box.

To Reproduce

Deploy any AWS stack, i.e. "stable" to us-west-2.

Expected behavior

Build completes and supabase studio is reachable

Logs

2024-02-28T19:35:56.785Z [INFO]: # Starting phase: preBuild
                                 # Executing command: echo POSTGRES_PASSWORD=$(aws secretsmanager get-secret-value --secret-id $DB_SECRET_ARN --query SecretString | jq -r . | jq -r .password) >> .env.production
2024-02-28T19:35:57.451Z [INFO]: # Executing command: echo SUPABASE_ANON_KEY=$(aws ssm get-parameter --region $SUPABASE_REGION --name $ANON_KEY_NAME --query Parameter.Value) >> .env.production
2024-02-28T19:35:58.123Z [INFO]: # Executing command: echo SUPABASE_SERVICE_KEY=$(aws ssm get-parameter --region $SUPABASE_REGION --name $SERVICE_KEY_NAME --query Parameter.Value) >> .env.production
2024-02-28T19:35:58.804Z [INFO]: # Executing command: env | grep -e STUDIO_PG_META_URL >> .env.production
2024-02-28T19:35:58.806Z [INFO]: # Executing command: env | grep -e SUPABASE_ >> .env.production
2024-02-28T19:35:58.807Z [INFO]: # Executing command: env | grep -e NEXT_PUBLIC_ >> .env.production
2024-02-28T19:35:58.808Z [INFO]: # Executing command: cd ../
2024-02-28T19:35:58.809Z [INFO]: # Executing command: npx [email protected] prune --scope=studio
2024-02-28T19:35:59.598Z [WARNING]: npm
2024-02-28T19:35:59.607Z [WARNING]: WARN exec The following package was not found and will be installed: [email protected]
2024-02-28T19:36:00.603Z [INFO]: Generating pruned monorepo for studio in /codebuild/output/src4190248314/src/Supabase/out
2024-02-28T19:36:00.605Z [INFO]: - Added common
2024-02-28T19:36:00.605Z [INFO]: - Added config
2024-02-28T19:36:00.605Z [INFO]: - Added shared-data
2024-02-28T19:36:00.674Z [INFO]: - Added studio
2024-02-28T19:36:00.675Z [INFO]: - Added tsconfig
2024-02-28T19:36:00.709Z [INFO]: - Added ui
2024-02-28T19:36:00.790Z [INFO]: # Executing command: npm clean-install
2024-02-28T19:36:04.804Z [WARNING]: npm
2024-02-28T19:36:04.809Z [WARNING]: ERR! code EBADENGINE
                                    npm ERR! engine Unsupported engine
                                    npm ERR! engine Not compatible with your version of node/npm: [email protected]
                                    npm ERR! notsup Not compatible with your version of node/npm: [email protected]
                                    npm ERR! notsup Required: {"npm":">=9.0.0 <10.0.0","node":">=18.0.0 <19.0.0"}
                                    npm ERR! notsup Actual:   {"npm":"10.2.3","node":"v18.19.0"}
                                    npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-02-28T19_36_01_021Z-debug-0.log
2024-02-28T19:36:04.928Z [ERROR]: !!! Build failed
2024-02-28T19:36:04.929Z [INFO]: Please read more about Amplify Hosting's support for SSR frameworks to find if your build failure is related to an unsupported feature: https://docs.aws.amazon.com/amplify/latest/userguide/amplify-ssr-framework-support.html. You may also find this troubleshooting guide useful: https://docs.aws.amazon.com/amplify/latest/userguide/troubleshooting-ssr-deployment.html
2024-02-28T19:36:04.929Z [ERROR]: !!! Error: Command failed with exit code 1
2024-02-28T19:36:04.929Z [INFO]: # Starting environment caching...
2024-02-28T19:36:04.929Z [INFO]: # Environment caching completed
Terminating logging...

werkamsus avatar Feb 28 '24 19:02 werkamsus

same issue here

bhaktatejas922 avatar Mar 05 '24 06:03 bhaktatejas922

It looks like the public.ecr.aws/sam/build-nodejs18.x:latest image has an incompatible npm version, but you can specify the Amplify build image to something like public.ecr.aws/sam/build-nodejs18.x:1.100 which is working for me.

cepko33 avatar Mar 07 '24 13:03 cepko33

me to have this issue but with build 100 it is working also

bsuredigital avatar Apr 08 '24 12:04 bsuredigital

Same issue here

ManuelAngel99 avatar Apr 13 '24 18:04 ManuelAngel99

same here

arvehisa avatar Apr 17 '24 10:04 arvehisa

In the build spec for the studio stack, you can explicitly install a compatible npm version. On line 17 of my screenshot, I added to the preBuild section: 'npm install -g [email protected]'

Hope this can help folks.

image

dubscode avatar Apr 28 '24 20:04 dubscode