Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Killing a code deploy in the AWS console can dump a NilClass exception #188

Open
nikgregory opened this issue Nov 30, 2016 · 0 comments
Open
Labels

Comments

@nikgregory
Copy link

I had a launch that somehow failed to have a successful code deployment #39 and to move things along, I stopped the code deploy via the AWS console.

it appears that

  def handle_deployment_failure(deployment_id)
    instances = cd_client.list_deployment_instances(deployment_id: deployment_id)
                         .instances_list.map do |instance_id|
      cd_client.get_deployment_instance(deployment_id: deployment_id,
                                        instance_id: instance_id)
    end

    instances.map(&:instance_summary).each do |inst_summary|
      next unless inst_summary.status == 'Failed'

      inst_summary.lifecycle_events.each do |event|
        next unless event.status == 'Failed'

        ilog.error(event.diagnostics.message)
        event.diagnostics.log_tail.each_line do |line|
          ilog.error(line)
        end
      end
    end

    raise 'Deployment was unsuccessful!'
  end

ilog.error(event.diagnostics.message) seems to be able to return a nil in diagnostics.

  E, [2016-11-30T17:29:59.362336 #29481] ERROR -- : Deployment �[0;34;49md-WI31N9YBJ�[0m failed with status 'Stopped'

  undefined method `message' for nil:NilClass (at /home/jenkins/jobs/workspace/sf-start-stage/apigems/ruby/2.3.0/gems/moonshot-1.0.0.rc1/lib/moonshot/deployment_mechanism/code_deploy.rb:304:in ```

And at this point we cannot really trap a decent error so that we might be able to retry 'something'
@askreet askreet added the bug label Jun 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants