First time using elastic beanstalk: looking for help solving error

I’ve never used eb before and would appreciated any help I can get.

my dockerrun aws json:

{
“AWSEBDockerrunVersion”: “1”,
“Image”: { “Name”: “1234567890.dkr.ecr.eu-west-1.amazonaws.com/projectname:latest” },
“Ports”: [ { “ContainerPort”: “8000” } ],
“Volumes”:
}

I get an error saying:

“[Instance: i-0b88a08b2600e4deb] Command failed on instance. Return code: 1 Output: fa7e87a4cccc50ee0e5181fc6833232bbfcf956530d983360499eb81de11e54f Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Wed Jan 9 08:40:42 UTC 2019:. Check snapshot logs for details. Hook /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.”

when I check the /var/log/eb-activity.log it says the following(see 1st comment).

sorry it’s hella long, I tried to cut to the relevant part, but since I’ve never used eb before I might have pasted the wrong section of the log.

If anybody could help me understand what’s happening I would be very grateful!

I tried to make it as less messy as possible.

I think these are the most important warnings:

“note: expected ‘const char *’ but argument is of type ‘yaml_char_t *’” (several times)

“note: expected ‘yaml_char_t *’ but argument is of type ‘char *’” (several times)

" Compiling /tmp/pip-build-SdWJNu/docker/docker/api/mixin.py …

File “/tmp/pip-build-SdWJNu/docker/docker/api/mixin.py”, line 8

base_url: str = ‘’

^

SyntaxError: invalid syntax"

" Running setup.py install for functools32

/usr/local/lib/python2.7/dist-packages/setuptools/dist.py:470: UserWarning: Normalizing ‘3.2.3-2’ to ‘3.2.3.post2’

normalized_version,

warning: no files found matching ‘*.txt’

no previously-included directories found matching ‘build’

no previously-included directories found matching ‘dist’

no previously-included directories found matching ‘.git*’

Could not find .egg-info directory in install record for functools32 (from jsonschema>=2.5.1,<3->docker-compose>=1.21.2,<1.22.0->awsebcli==3.14.4)"

"[2019-01-09T08:40:42.934Z] INFO [3627] - [Application deployment afa-source@1/StartupStage1/AppDeployEnactHook/00run.sh] : Activity execution failed, because: fa7e87a4cccc50ee0e5181fc6833232bbfcf956530d983360499eb81de11e54f

Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Wed Jan 9 08:40:42 UTC 2019:. Check snapshot logs for details. (ElasticBeanstalk::ExternalInvocationError)"


Related discussions:

In file included from ext/_yaml.h:2:0,
from ext/_yaml.c:565:
/usr/include/yaml.h:633:1: note: expected ‘yaml_char_t *’ but argument is of type ‘char *’
yaml_mapping_start_event_initialize(yaml_event_t *event,
^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wl,-z,relro -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/ext/_yaml.o -lyaml -o build/lib.linux-x86_64-2.7/_yaml.so

    Found existing installation: setuptools 5.5.1
      Not uninstalling setuptools at /usr/lib/python2.7/dist-packages, owned by OS
    Running setup.py install for semantic-version
      no previously-included directories found matching 'docs/_build'
    Could not find .egg-info directory in install record for semantic-version==2.5.0 (from awsebcli==3.14.4)
    Found existing installation: six 1.12.0
      Uninstalling six:
        Successfully uninstalled six
    Running setup.py install for tabulate
      Installing tabulate script to /usr/local/bin
    Could not find .egg-info directory in install record for tabulate==0.7.5 (from awsebcli==3.14.4)
    Running setup.py install for termcolor
    Could not find .egg-info directory in install record for termcolor==1.1.0 (from awsebcli==3.14.4)
    Found existing installation: urllib3 1.9.1
      Not uninstalling urllib3 at /usr/lib/python2.7/dist-packages, owned by OS
    Found existing installation: requests 2.4.3
      Not uninstalling requests at /usr/lib/python2.7/dist-packages, owned by OS
  Compiling /tmp/pip-build-SdWJNu/docker/docker/api/mixin.py ...
    File "/tmp/pip-build-SdWJNu/docker/docker/api/mixin.py", line 8
      base_url: str = ''
              ^
  SyntaxError: invalid syntax
  
    Running setup.py install for texttable
    Could not find .egg-info directory in install record for texttable>=0.9.0,<0.10 (from docker-compose>=1.21.2,<1.22.0->awsebcli==3.14.4)
    Running setup.py install for docopt
    Could not find .egg-info directory in install record for docopt>=0.6.1,<0.7 (from docker-compose>=1.21.2,<1.22.0->awsebcli==3.14.4)
    Running setup.py install for backports.ssl-match-hostname
    Could not find .egg-info directory in install record for backports.ssl-match-hostname>=3.5 (from docker-compose>=1.21.2,<1.22.0->awsebcli==3.14.4)
    Running setup.py install for dockerpty
    Could not find .egg-info directory in install record for dockerpty>=0.4.1,<0.5 (from docker-compose>=1.21.2,<1.22.0->awsebcli==3.14.4)
    Found existing installation: chardet 2.3.0
      Not uninstalling chardet at /usr/lib/python2.7/dist-packages, owned by OS
    Running setup.py install for functools32
      /usr/local/lib/python2.7/dist-packages/setuptools/dist.py:470: UserWarning: Normalizing '3.2.3-2' to '3.2.3.post2'
        normalized_version,
      warning: no files found matching '*.txt'
      no previously-included directories found matching 'build'
      no previously-included directories found matching 'dist'
      no previously-included directories found matching '.git*'
    Could not find .egg-info directory in install record for functools32 (from jsonschema>=2.5.1,<3->docker-compose>=1.21.2,<1.22.0->awsebcli==3.14.4)
  Successfully installed awsebcli botocore cement colorama pathspec python-dateutil PyYAML setuptools semantic-version six tabulate termcolor docker-compose docutils jmespath urllib3 requests enum34 docker websocket-client texttable cached-property jsonschema docopt backports.ssl-match-hostname ipaddress dockerpty certifi idna chardet docker-pycreds functools32
  Cleaning up...
  Removing intermediate container 75608c147e0d
   ---> a9078ea32074
  Step 6/11 : RUN npm i -g [email protected]
   ---> Running in 8dbf747304a2
  /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
  /usr/local/bin/npx -> /usr/local/lib/node_modules/npm/bin/npx-cli.js
  + [email protected]
  added 5 packages from 3 contributors, removed 9 packages and updated 19 packages in 7.094s
  Removing intermediate container 8dbf747304a2
   ---> 728556a91864
  Step 7/11 : RUN npm i -g [email protected]
   ---> Running in 6ee4d9d78377
  /usr/local/bin/ts-node -> /usr/local/lib/node_modules/ts-node/dist/bin.js
  + [email protected]
  added 11 packages from 42 contributors in 1.037s
  Removing intermediate container 6ee4d9d78377
   ---> 1c02312aa01a
  Step 8/11 : RUN npm i -g [email protected]
   ---> Running in 3c927c467589
  npm WARN deprecated [email protected]: The 'apollo-codegen' command has been replaced with the more-powerful 'apollo' CLI. Switch to 'apollo' to ensure future updates and visit https://npm.im/apollo#code-generation for more information.
  /usr/local/bin/apollo-codegen -> /usr/local/lib/node_modules/apollo-codegen/lib/cli.js
  + [email protected]
  added 113 packages from 78 contributors in 5.56s
  Removing intermediate container 3c927c467589
   ---> b0df39758edc
  Step 9/11 : RUN npm i -g [email protected]
   ---> Running in 719d60b7cb48
  /usr/local/bin/pm2 -> /usr/local/lib/node_modules/pm2/bin/pm2
  /usr/local/bin/pm2-dev -> /usr/local/lib/node_modules/pm2/bin/pm2-dev
  /usr/local/bin/pm2-docker -> /usr/local/lib/node_modules/pm2/bin/pm2-docker
  /usr/local/bin/pm2-runtime -> /usr/local/lib/node_modules/pm2/bin/pm2-runtime
  npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/pm2/node_modules/fsevents):
  npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
  
  + [email protected]
  added 249 packages from 221 contributors in 8.674s
  Removing intermediate container 719d60b7cb48
   ---> 9507a9cf8f0e
  Step 10/11 : RUN npm i -g [email protected]
   ---> Running in cf2b245e351d
  npm WARN deprecated [email protected]: cross-spawn no longer requires a build toolchain, use it instead
  /usr/local/bin/npm-check -> /usr/local/lib/node_modules/npm-check/bin/cli.js
  + [email protected]
  added 247 packages from 94 contributors in 7.218s
  Removing intermediate container cf2b245e351d
   ---> 33f566cd673a
  Step 11/11 : EXPOSE 8000
   ---> Running in 6dd864cbeb38
  Removing intermediate container 6dd864cbeb38
   ---> 8dd5655a0ec3
  Successfully built 8dd5655a0ec3
  Successfully tagged aws_beanstalk/staging-app:latest
  Successfully built aws_beanstalk/staging-app

continued in reply to this comment

[2019-01-09T08:40:35.804Z] INFO [3627] - [Application deployment afa-source@1/StartupStage0/AppDeployPreHook] : Completed activity. Result:

Successfully execute hooks in directory /opt/elasticbeanstalk/hooks/appdeploy/pre.

[2019-01-09T08:40:35.804Z] INFO [3627] - [Application deployment afa-source@1/StartupStage0/EbExtensionPostBuild] : Starting activity…

[2019-01-09T08:40:36.241Z] INFO [3627] - [Application deployment afa-source@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild] : Starting activity…

[2019-01-09T08:40:36.242Z] INFO [3627] - [Application deployment afa-source@1/StartupStage0/EbExtensionPostBuild/Infra-EmbeddedPostBuild] : Completed activity.

[2019-01-09T08:40:36.257Z] INFO [3627] - [Application deployment afa-source@1/StartupStage0/EbExtensionPostBuild] : Completed activity.

[2019-01-09T08:40:36.257Z] INFO [3627] - [Application deployment afa-source@1/StartupStage0/InfraCleanEbExtension] : Starting activity…

[2019-01-09T08:40:36.258Z] INFO [3627] - [Application deployment afa-source@1/StartupStage0/InfraCleanEbExtension] : Completed activity. Result:

Cleaned ebextensions subdirectories from /tmp.

[2019-01-09T08:40:36.258Z] INFO [3627] - [Application deployment afa-source@1/StartupStage0] : Completed activity. Result:

Application deployment - Command CMD-Startup stage 0 completed

[2019-01-09T08:40:36.259Z] INFO [3627] - [Application deployment afa-source@1/StartupStage1] : Starting activity…

[2019-01-09T08:40:36.259Z] INFO [3627] - [Application deployment afa-source@1/StartupStage1/AppDeployEnactHook] : Starting activity…

[2019-01-09T08:40:36.260Z] INFO [3627] - [Application deployment afa-source@1/StartupStage1/AppDeployEnactHook/00run.sh] : Starting activity…

[2019-01-09T08:40:42.934Z] INFO [3627] - [Application deployment afa-source@1/StartupStage1/AppDeployEnactHook/00run.sh] : Activity execution failed, because: fa7e87a4cccc50ee0e5181fc6833232bbfcf956530d983360499eb81de11e54f

Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Wed Jan 9 08:40:42 UTC 2019:. Check snapshot logs for details. (ElasticBeanstalk::ExternalInvocationError)

caused by: fa7e87a4cccc50ee0e5181fc6833232bbfcf956530d983360499eb81de11e54f

Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Wed Jan 9 08:40:42 UTC 2019:. Check snapshot logs for details. (Executor::NonZeroExitStatus)

[2019-01-09T08:40:42.934Z] INFO [3627] - [Application deployment afa-source@1/StartupStage1/AppDeployEnactHook/00run.sh] : Activity failed.

[2019-01-09T08:40:42.935Z] INFO [3627] - [Application deployment afa-source@1/StartupStage1/AppDeployEnactHook] : Activity failed.

[2019-01-09T08:40:42.935Z] INFO [3627] - [Application deployment afa-source@1/StartupStage1] : Activity failed.

[2019-01-09T08:40:42.935Z] INFO [3627] - [Application deployment afa-source@1] : Completed activity. Result:

Application deployment - Command CMD-Startup failed

[2019-01-09T08:56:29.626Z] INFO [8080] - [CMD-BundleLogs] : Starting activity…

[2019-01-09T08:56:29.626Z] INFO [8080] - [CMD-BundleLogs/AddonsBefore] : Starting activity…

[2019-01-09T08:56:29.627Z] INFO [8080] - [CMD-BundleLogs/AddonsBefore] : Completed activity.

[2019-01-09T08:56:29.627Z] INFO [8080] - [CMD-BundleLogs/BundleLogs] : Starting activity…

[2019-01-09T08:56:29.627Z] INFO [8080] - [CMD-BundleLogs/BundleLogs/BundleLogs] : Starting activity…

It looks like you did not include the dependencies in the requirements.txt

thank you for your response.
I haven’t got a requirements.txt file so that could indeed be the problem.
I’m using a docker platform (Single Container Docker Configuration)

Do I need a requirements.txt as well in that case?
there’s no mention of it here: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/single-container-docker-configuration.html#single-container-docker-configuration.dockerrun

when I google the requirements.txt file I keep ending up on guides for python platforms instead of docker platforms. That’s why I ask.

Some additional info that might be relevant:
the application is written with angular, php and postgress.
so no python is involved.
Does that change anything?

Have you run your docker container locally to make sure it actually runs? From the logs, it seems like your container is exiting immediately.

I was thinking Python.

Thanks for thinking along, yeah it works locally.

could this be the result of mentioning the wrong port in ports,containerPort in the Dockerrun.aws.json file?

the Docker my dockerfile for the api says expose 8000 that’s why my dockerrun.aws.json’s containerport says 8000 as well. Is that correct?