1
votes

appspec.yml:

version: 0.0
os: linux
files:
  - source: /
    destination: /var/ingester
permissions:
  - object: /var
    pattern: ingester
    owner: ubuntu
    group: ubuntu
    type:
      - directory
  - object: /var/ingester
    owner: ubuntu
    group: ubuntu
hooks:
  ApplicationStart:
    - location: deployment/start.sh
      runas: ubuntu

Codedeploy gets to BeforeInstall and then errors with:

ERROR [codedeploy-agent(2735)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during perform: TypeError - no implicit conversion of String into Integer - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/application_specification/application_specification.rb:49:in `[]'

It looks as though this is related to the parsing of the YAML, but I can't figure out what it's trying (and failing) to convert to an integer.

Can anyone spot what's going wrong here?

1
Which version of the codedeploy agent are you using? Have you tried updating it to the latest version? - Castrohenge
@Castrohenge It's being installed on the EC2 box's spinning up, so it should be the latest version already. - user1381745
Can you check appspec.yml in /opt/codedeploy-agent/deployment-root/<deployment_group_id>/<deployment_id>/ ? Is this same as you posted above ? Error suggests that files section is treated as hash instead an array of hashes. I suspect - is missing before source: in appspec.yml on instance. - Ravi
@Ravi You're exactly right, thank you. The version being deployed didn't match the version I'd been staring at; replacing the appspec.yml with the version I had locally fixed the issue. Thank you! - user1381745

1 Answers

1
votes

After a hint from Ravi (see OP comments), I checked the appspec.yml on the EC2 box and it appeared to be an old copy, missing the hyphen before the source: in the YAML. Thus, Ruby interpreted it as a hash instead of an array.