@@ -620,8 +620,9 @@ func (mtask *managedTask) emitTaskEvent(task *apitask.Task, reason string) {
620
620
}
621
621
if ! taskKnownStatus .BackendRecognized () {
622
622
logger .Debug ("Skipping event emission for task" , logger.Fields {
623
- field .TaskID : mtask .GetID (),
624
- field .Error : "status not recognized by ECS" ,
623
+ field .TaskID : mtask .GetID (),
624
+ field .Error : "status not recognized by ECS" ,
625
+ field .KnownStatus : taskKnownStatus .String (),
625
626
})
626
627
return
627
628
}
@@ -862,34 +863,36 @@ func (mtask *managedTask) handleEventError(containerChange dockerContainerChange
862
863
switch event .Status {
863
864
// event.Status is the desired container transition from container's known status
864
865
// (* -> event.Status)
865
- case apicontainerstatus .ContainerPulled :
866
+ case apicontainerstatus .ContainerManifestPulled , apicontainerstatus . ContainerPulled :
866
867
// If the agent pull behavior is always or once, we receive the error because
867
- // the image pull fails, the task should fail. If we don't fail task here,
868
+ // the image or manifest pull fails, the task should fail. If we don't fail task here,
868
869
// then the cached image will probably be used for creating container, and we
869
870
// don't want to use cached image for both cases.
870
871
if mtask .cfg .ImagePullBehavior == config .ImagePullAlwaysBehavior ||
871
872
mtask .cfg .ImagePullBehavior == config .ImagePullOnceBehavior {
872
- logger .Error ("Error while pulling image; moving task to STOPPED" , logger.Fields {
873
+ logger .Error ("Error while pulling image or its manifest ; moving task to STOPPED" , logger.Fields {
873
874
field .TaskID : mtask .GetID (),
874
875
field .Image : container .Image ,
875
876
field .Container : container .Name ,
876
877
field .Error : event .Error ,
878
+ field .Status : event .Status ,
877
879
})
878
880
// The task should be stopped regardless of whether this container is
879
881
// essential or non-essential.
880
882
mtask .SetDesiredStatus (apitaskstatus .TaskStopped )
881
883
return false
882
884
}
883
885
// If the agent pull behavior is prefer-cached, we receive the error because
884
- // the image pull fails and there is no cached image in local, we don't make
886
+ // the image or manifest pull fails and there is no cached image in local, we don't make
885
887
// the task fail here, will let create container handle it instead.
886
888
// If the agent pull behavior is default, use local image cache directly,
887
889
// assuming it exists.
888
- logger .Error ("Error while pulling image; will try to run anyway" , logger.Fields {
890
+ logger .Error ("Error while pulling image or its manifest ; will try to run anyway" , logger.Fields {
889
891
field .TaskID : mtask .GetID (),
890
892
field .Image : container .Image ,
891
893
field .Container : container .Name ,
892
894
field .Error : event .Error ,
895
+ field .Status : event .Status ,
893
896
})
894
897
// proceed anyway
895
898
return true
0 commit comments