Bilal
Bilal

Reputation: 421

Codepipeline script_start failed Script does not exist at specified location

I am getting this error below. when I start deployment

Script name scripts/server_stop.sh Message Script does not exist at specified location: /opt/codedeploy-agent/deployment-root/2a16dbef-8b9f-42a5-98ad-1fd41f596acb/d-2KDHE6D5F/deployment-archive/scripts/server_stop.sh

source and build are fine

this is the appspec that I am using:

version: 0.0
os: linux

files:
  - source: /
    destination: /home/ec2-user/KnCare-Rest
file_exists_behavior: OVERWRITE

permissions:
  - object: /
    pattern: "**"
    owner: ec2-user
    group: ec2-user

hooks:
  #BeforeInstall:
    #- location: scripts/server_clear.sh
      #timeout: 300
      #runas: ec2-use
  ApplicationStart:
    - location: scripsts/server_start.sh
      timeout: 20
      runas: ec2-user

  ApplicationStop:
    - location: scripsts/server_stop.sh
      timeout: 20
      runas: ec2-user

Upvotes: 0

Views: 294

Answers (2)

Ankit Joshy
Ankit Joshy

Reputation: 11

Two things cause this issue

  1. If you deployed the scripts on asg or ec2 and then add additional scripts for the hook.
    For this you need to restart the asg or ec2 before adding additional scripts.

  2. If you used the same pipeline name again for a different deployment.
    For this you need to delete the input artifact that is in s3 before running the deployment since aws will not delete the artifacts even if you delete the pipeline.

Upvotes: 1

Did you ssh to ec2 instance to verify that scripts/server_stop.sh existed and in execute mode permissions?

Upvotes: 0

Related Questions