Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elastic Beanstalk stops at EbExtensionPostBuild

I am having a problem deploying an EB instance with a custom .ebextensions file. This is the relevant part in that file:

container_commands:
  01_migrate:
    command: 'python db_migrate.py'
  02_npm_build:
    command: 'npm install && npm run prod'

As you can see, these commands are for migrating my PostgreSQL database (via a Flask backend) and building my React .jsx files.

If I leave these commands out, the deployment completes perfectly well. However, once I put them in, looking at the eb-activity.log it stalls at this part forever (as far as I can tell):

[2017-04-10T02:39:24.106Z] INFO  [3023]  - [Application deployment app-613e-170409_223418@1/StartupStage0/EbExtensionPostBuild] : Starting activity...

I also get this message on the Health overview in the console (this is after 1 day):

Performing application deployment (running for 1 day).

I have also tried to deploy it without those container_commands, and then including it back after the successful initial deployment. Then I get the same error message as before in eb-activity.log, and I also get this message on the Health overview:

Incorrect application version "app-2a3d-170409_214923" (deployment 1). Expected version "app-2a3d-170409_214923" (deployment 1).

Which is very strange because those two versions referenced are the same versions. I don't know what this means!

like image 451
Matt Hong Avatar asked Apr 11 '17 21:04

Matt Hong


1 Answers

I found a solution.

Remove all you container_commands from .ebextensions/

Go ssh to instance, kill process with.

sudo killall python

Then Deploy new version without container_commands. And start debuging all your container_commands, one by one on ssh..

Have fun.

like image 74
Sigdev Avatar answered Nov 10 '22 04:11

Sigdev