App Runner failed to deploy

2

I'm facing the same issue when deploying to app runner, and the error just said: [AppRunner] Failed to deploy your application source code.

there is no detail provided. I just added @sentry/nextjs library in my nextjs project. Do you have insight about it?

https://github.com/aws/apprunner-roadmap/issues/110

AWS
Hari
asked a year ago2954 views
3 Answers
2

Hi, @Fadholi, Looks like you have run into a service bug because of a conflict in the NodeJS versions. We will internally prioritize this and work on a fix soon and keep you posted on the progress. As a temporary workaround you can install nodeJS 14 part of the pre-build phase and use that as a default runtime. This can be done by creating a configuration based service (using apprunner.yaml) instead of API based one.

Here is a sample apprunner.yaml file that you can use with the suggested fix:

version: 1.0
runtime: nodejs14
build:
  commands:
    pre-build:
      - n 14.18.3
    build:      
      - <<build_command>>
run: 
  command: <<start_command>>
  network:
    port: <<port>>
    env: APP_PORT
AWS
Hari
answered a year ago
  • Thank you for the feedback. I was implementing your suggestion, but I still got an error. :(

  • Hi @Fadholi, You wont be able to update the existing service to the above mentioned suggestion. Can you please create a new App Runner using the same repo, but this time have apprunner.yaml file with the above recommendation and create a configuration based service, instead of API based one. Thanks

  • Hi @Hari, Alright, It works well now. Thanks for your help. :)

0

Coming from github. Deploys were working amazing until weekend, I didn't do any changes on infra. This is my service. arn:aws:apprunner:us-east-2:986761589464:service/platform-staging-platform/13ee82df0d1948368d9f769b30f3d935

once app runner try to provision instances immediately rollback. deploy messages just said:

[AppRunner] Failed to deploy your application image.

and events:

Service status is set to RUNNING. Service update failed. For details, see service logs. Provisioning instances and deploying image. Successfully copied the image from ECR. Service status is set to OPERATION_IN_PROGRESS. Service update started.

Thanks in advance.

Frans
answered 9 months ago
  • For all this people including @TimSon777 , I solve my problem just pausing the app runner service, wait a time to let AWS kill the current Node and then run service again. After that your service will run fine. (I think It is what happens behind the wires).

0

@Hari, Is there a higher version of nodejs supported?

example apprunner.yaml

version: 1.0
runtime: nodejs16
build:
  commands:
    pre-build:
      - n 16.18.1
    build:      
      - <<build_command>>
run: 
  command: <<start_command>>
  network:
    port: <<port>>
    env: APP_PORT

What is the highest nodejs version supported till now (Mar 31, 2023)? thanks.

Eddy
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions