skip to Main Content

So this is my first experience with AWS. I have a nodejs/typescript setup with source from github. It goes through 2 stages of the codepipeline

  • Build: I use a buildspec.yml file to build the typescript file and dump it in an S3 bucket. Here’s the content of the buildspect.yml.
version: 0.2

phases:
  install:
    commands:
      - "npm install"
  build:
    commands:
      - "npm run build"
artifacts:
  files:
    - "dist*/*"
  discard-paths: yes

And my package.json

{
  "name": "aws-install",
  "version": "1.0.0",
  "description": "",
  "main": "./dist/app.js",
  "scripts": {
    "build": "tsc",
    "start": "node ./dist/app.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@types/express": "^4.17.11",
    "@types/node": "^14.14.35",
    "express": "^4.17.1",
    "mongodb": "^3.6.5",
    "nodemon": "^2.0.7",
    "typescript": "^4.2.3"
  },
  "devDependencies": {},
  "engines": {
    "node": "14.15.0"
  }
}
  • Deploy: The deploy stage is an Elastic Beanstalk thing. I believe it’s suppose to take the output of the build and deploy to an EC2 instance. I don’t think this is what’s happening. It gives the following error.

enter image description here


Here’s how my general setup looks like

AWS Pipeline screenshot

Logs
I download full logs and I spot a few more details about the error

varlogeb-engine.log

2021/03/24 10:05:10.373225 [ERROR] update processes [web nginx cfn-hup healthd] pid symlinks failed with error Read pid source file /var/pids/web.pid failed with error:open /var/pids/web.pid: no such file or directory
2021/03/24 10:05:10.373235 [ERROR] An error occurred during execution of command [app-deploy] - [Track pids in healthd]. Stop running the command. Error: update processes [web nginx cfn-hup healthd] pid symlinks failed with error Read pid source file /var/pids/web.pid failed with error:open /var/pids/web.pid: no such file or directory 

I really don’t know what else to do here. Thanks in advance guys

2

Answers


  1. It’s related to old versions used during your last deployment.
    you should delete your application versions and restart the pipeline again.
    if it didn’t work delete the deployment environment and create it again.

    Login or Signup to reply.
  2. i had same problem, but i have found a way to solve it, you can try the steps i adopted and solve yours.

    this is the error response i got:

    • after the source succeeded
    • and build succeeded
    • deploy failed

    i had to go to -> logs -> request logs -> last 100 lines, below is what i saw

    enter image description here

    i had to go to package.json on my project and remove some lines of code just like below.
    enter image description here

    then i have to replace it

    enter image description here

    when that is done, commit your code and push to your branch, go back to your pipeline and click on release change.

    then go to your elastic beanstalk and click on actions -> rebuild environment

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search