1

i am trying to deploy the python application through code-deploy to the ec2 instances but during deployment i am facing this error

The deployment failed because a specified file already exists at this location: /home/ubuntu/yello/manage.py

attaching my appsecfile also tried with overwrite but no luck

version: 0.0
    os: linux
    files:
      - source: /
        destination: /home/ubuntu/yello
        overwrite: true
    hooks:
      AfterInstall:
    - location: script/services.sh
      timeout: 300
      runas: ubuntu

can anyone help ?

Dhaval Shah
  • 144
  • 1
  • 8

3 Answers3

0

This is a very common error so AWS public docs has a section for the same.

Basically when creating the deployment, you need to select Overwrite the content option so the deployment does not fail (default behaviour). Details here:

The default behaviour prevents two Deployments from two different CodeDeploy "Applications" writing the same file and possibly causing some sort of conflict.

shariqmaws
  • 8,152
  • 1
  • 16
  • 35
0
cd /var/www/your-directory/public/funnel_webhooks/test/

sudo rm -rf clickfunnel.txt

After removing this file please release the change in the code pipeline.

0

Now you can specify file_exists_behavior in your appspec file. Allowed values are DISALLOW, OVERWRITE, or RETAIN.

version: 0.0
    os: linux
    files:
      - source: /
        destination: /home/ubuntu/yello
    file_exists_behavior: OVERWRITE
phpd
  • 551
  • 4
  • 10