3

I am deploying an application using AWS code deploy to Windows environment. I use an apspec.yml yaml file. When I deploy the application I get following error

The deployment failed because an invalid version value () was entered in the application specification file. Make sure your AppSpec file specifies "0.0" as the version, and then try again.

It seems like there is a problem with encoding or line ending. All the materials in the internet are for linux but not for windows. I use visual studio editor to edit this file. How to fix this issue?

Sriwantha Attanayake
  • 7,694
  • 5
  • 42
  • 44
  • i am facing same proble still let me know if there is any solution https://stackoverflow.com/questions/62613077/aws-code-deploy-ec2-on-premises-yml-file-error-on-from-s3-to-windows-server – sagarDotNetMaster Jun 27 '20 at 17:10

4 Answers4

5

In my case the encoding was wrong. appspec.yml should be saved as UTF-8 and not UTF-8 BOM.

BTW: The encoding can be changed in VS 2017 using File > Save as.., then the down arrow at the Save-Button ... Save with encoding...

disco crazy
  • 31,313
  • 12
  • 80
  • 83
2

The issue is in the line ending. If you create a yml file make sure you use \n line ending (linux way of line ending) instead of \r\n (windows way of line ending). If your editor is visual studio when you safe the yml file save it as follows. File->Advanced Saved Options

enter image description here

Sriwantha Attanayake
  • 7,694
  • 5
  • 42
  • 44
  • YAML has had generic line breaks in all its incarnations (1.0/1.1/1.2) for 15+ years. If you really have to deal with software that process YAML and needs specific line-endings, you should look for an alternative. – Anthon Apr 19 '17 at 19:34
2

Make sure your appspec.yml starts with below line

version: 0.0

codedeploy requires this attribute as must. refer this

Ravi
  • 912
  • 6
  • 12
0

Change the Encoding format by simply opening it notepad++ from UTF-8-BOM to UTF-8

enter image description here