I am currently in the process of setting up my first Elastic Beanstalk Node application and I have hit a snag.
I followed this tutorial to get a working Express application running with no view-engine (going to be using React):
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html
However, I want to move it to the /app directory so that eventually I can install a Wordpress instance in the root directory to use as a quick public facing intro to our application with a blog.
The project looks like this:
my-app
// Wordpress Files Here
/.ebextensions
/app
/bin
/client
// React Files Here
/node_modules
/public
/routes
/app.js
/package-lock.json
/package.json
With all of the Node files in the root directory, everything works as expected. When I move everything to the app directory and add this to the .ebextensions/01_nodeconfig.config file:
commands:
01_npm_install:
command: npm install
cwd: app/
I get this error on eb deploy:
2018-11-09 17:39:35 INFO Environment update is starting.
2018-11-09 17:40:15 INFO Deploying new version to instance(s).
2018-11-09 17:40:22 ERROR [Instance: i-0eedebf7a339e69ca] Command failed on instance. Return code: 1 Output: [Errno 2] No such file or directory: 'app/'.
EBExtension failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2018-11-09 17:40:23 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2018-11-09 17:40:23 ERROR Unsuccessful command execution on instance id(s) 'i-0eedebf7a339e69ca'. Aborting the operation.
2018-11-09 17:40:23 ERROR Failed to deploy application.
When I look in the log, here is what is returned:
[2018-11-09T17:40:20.819Z] INFO [26711] - [Application update app-4f25-181109_123930#15/AppDeployStage0/EbExtensionPreBuild/Infra-EmbeddedPreBuild] : Activity execution failed, because: [Errno 2] No such file or directory: 'app/' (ElasticBeanstalk::ExternalInvocationError)
Does anyone have an idea on why it cannot find the app directory even though it is right there?
Thanks.
Related
I'm facing an issue with the deployement of my Node.js application on my Kubernetes container.
The container is stuck on Crashlooping with this error "Back-off restarting failed container" and as error code i have this "Reason: Error - exit code: 243"
I did a describe of the pod i found nothing except the "Back-off restarting failed container" .
If someone could help that would be great thanks
I'm not sure why this worked, but it seems to be something with using npm run... to start the node service. I experimented with changing my Docker file to launch the container using:
CMD npm run start
To just running the node command, using exactly what NPM should have been running, directly:
CMD node ...
EDIT:
In our environment it was an access problem. To get NPM working, we had to chown all the directories:
COPY --chown=${uid}:${gid} --from=builder /app .
Stack information :
BE : NodeJS App, MongoDB
FE : AngularJS App
Use case :
I am deploying BE(NodeJS) application on AWS ECS along with MongoDB. There is a task definition (AWS) in which there should be both the containers attached so that Mongo container can be linked to the NodeJS container. Mongo container is from docker hub registry registry.hub.docker.com/library/mongo:latest
Please note I have also subscribed to the CloudWatch Logs for the containers.
I am also providing the MONGO_INITDB_ROOT_PASSWORD & MONGO_INITDB_ROOT_USERNAME as new user environment variables.
Problem :
As soon as the service bootstraps NodeJS container, it gets failed with below error.
2019-05-28T14:15:23.208+0000 I CONTROL [main] ERROR: Cannot write pid file to /tmp/docker-entrypoint-temp-mongod.pid: Unknown error
Result :
As a result, mongo is not able to get started and NodeJS app is unable to operate on the db. I want this db operations within container (ECS) as a solution.
Please guide what I am doing wrong here!! Kindly Help!
Why it differs from this answer/question :
Because in my case the application along with MongoDB is running in container environment and container (Node container) is all responsible for bootstrapping it or restarting the mongo service. Also, the error I am facing is Unknown Error.
EDIT :
Dockerfile
FROM node:8-alpine
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm#5+)
COPY package*.json ./
RUN npm install
# RUN npm audit
# Bundle app source
#COPY . /usr/src/app
COPY . .
EXPOSE 9000
CMD [ "npm", "start" ]
Folks
I am trying to deploy a simple node.js app onto appengine. Every time I deploy the same using gcloud deploy, I get these warning and errors in the logs. I am using the config module in node.js also to load some general environment variables I need. Any pointers apprecaited if others have come across similar runtime issues? here is log when I execute the command:
gcloud app deploy app.yaml
No cached base image found for entry
us.gcr.io/.../app-engine-build-cache/node-cache:f0sdafsadasdfsadfasfasdfasdf
Step #1 - "builder": INFO Cache miss on local cache for us.gcr.io/.../app-engine-build-cache/node-cache:f0sdafsadasdfsadfasfasdfasdf
....
later....
...
Step #1 - "builder": ERROR Error during upload of: us.gcr.io/.../app-engine-build-cache/node-cache:f0sdafsadasdfsadfasfasdfasdf
Finally my deploy fails
File upload done.
Updating service [myservice name]...failed.
ERROR: (gcloud.app.deploy) Error Response: [9] Cloud build <number> status: FAILURE. Check the build log for errors: https://console.cloud.google.com/gcr/builds/<my build number>
I am using
$gcloud version
Google Cloud SDK 214.0.0
bq 2.0.34
core 2018.08.24
gsutil 4.33
$ npm --version
6.3.0
thanks for any pointers where things might be going wrong.
Quick: where can I find the deployment logs for a node deploy which fails?
Setup: windows 10 box developing a node.js website. the website runs locally, and has deployed successfully with the same package stack (body-parser, express, firebase, firebase-tools, path, pug)
Google Cloud SDK 134.0.0
app-engine-python 1.9.40
bq 2.0.24
bq-win 2.0.24
core 2016.11.07
core-win 2016.11.07
gcloud
gsutil 4.22
gsutil-win 4.20
windows-ssh-tools 2016.05.13
The last few lines of the deploy output shows a core dump and timeout ends the deploy and how the latest gcloud update gacked up the logging output.
[91mnpm[0m[91m WARN using --force I sure hope you know what you are doing.
[0m
> group-coms#0.0.1 install /app
> npm install --force
[91mAborted (core dumped)
ERROR: (gcloud.app.deploy) Error Response: [4] DEADLINE_EXCEEDED
Oh yes, when it failed earlier today, I moved the folder to the root of the drive testing the 'too long a path' theory and it deployed successfully a couple of times. I haven't added or renamed any files since then, I have tried reloading all the node_modules to no avail.
# [START app_yaml]
runtime: nodejs
vm: true
# [END app_yaml]
I changed the yamal file to comply with upgrading#appyaml_changes and the deploy completed successfuly... I would still like to know more about how I can monitor the build process..
I'm using a Node Express app with App Engine. Everything's been deploying fine, but I must have had an interrupted deployment because now when I try to deploy using this:
gcloud preview app deploy .
I get this:
Error 409: --- begin server output ---
Another transaction by user <username> is already in progress for app:
s~<appId>, version: 1. That user can undo the transaction with "appcfg
rollback".
--- end server output ---
ERROR: (gcloud.preview.app.deploy) Command failed with error code [1]
I can't find an appcfg file to rollback, nor any documentation about this issue for a node app.
You can use gcloud preview app deploy . --force
which will implicitly do a rollback (to clear the deploy lock) before attempting the deployment.
Use the appcfg.py rollback command.
Here, create a file as app.yaml and a directory WEB-INF in which there will be two files named as web.xml and appengine-web.xml.