pplu/aws-sdk-perl

Attribute (StartedAt) is required - Batch DescribeJobs

srchulo opened this issue · 3 comments

I'm getting an error when calling DescribeJobs that says that StartedAt is required, but it looks like it's not being returned by the AWS Batch API call. I'm not sure if this is a mistake by AWS, or PAWS? It looks like AWS is not returning StartedAt because the job is still in the SUBMITTED state.

my $describe_response = $self->batch->DescribeJobs(Jobs => [$job_id]);
Attribute (StartedAt) is required at /home/user/local/lib/perl5/x86_64-linux-gnu/Moose/Object.pm line 24
        Moose::Object::new('Paws::Batch::JobDetail', 'Container', 'Paws::Batch::ContainerDetail=HASH(0x55e84d3132f0)', 'CreatedAt', 1615430870067, 'Status', 'SUBMITTED', 'JobId', '1907efa4-6936-48d0-af27-c48290874365', 'Attempts', 'ARRAY(0x55e84d28d210)', 'Parameters', 'Paws::Batch::ParametersMap=HASH(0x55e84d3305d8)', 'JobName', 'my-job', 'DependsOn', 'ARRAY(0x55e84d223d10)', 'JobDefinition', 'xxxx', 'JobQueue', 'xxxxxxx') called at /home/user/local/lib/perl5/Paws/Net/RestJsonResponse.pm line 195
        Paws::Net::RestJsonResponse::new_from_result_struct('Paws::Net::RestJsonResponse=HASH(0x55e84d0dc0d0)', 'Paws::Batch::JobDetail', 'HASH(0x55e84d18bd58)') called at /home/user/local/lib/perl5/Paws/Net/RestJsonResponse.pm line 182
        Paws::Net::RestJsonResponse::new_from_result_struct('Paws::Net::RestJsonResponse=HASH(0x55e84d0dc0d0)', 'Paws::Batch::DescribeJobsResponse', 'HASH(0x55e84d1f2b40)') called at /home/user/local/lib/perl5/Paws/Net/RestJsonResponse.pm line 229
        Paws::Net::RestJsonResponse::new_from_response('Paws::Net::RestJsonResponse=HASH(0x55e84d0dc0d0)', 'Paws::Batch::DescribeJobsResponse', 'Paws::Net::APIResponse=HASH(0x55e84d209fd0)', '2aaa7c1b-8a38-4731-8c92-a89e501f9fae') called at /home/user/local/lib/perl5/Paws/Net/RestJsonResponse.pm line 212
        Paws::Net::RestJsonResponse::response_to_object('Paws::Net::RestJsonResponse=HASH(0x55e84d0dc0d0)', 'Paws::Batch::DescribeJobs=HASH(0x55e84cbafb68)', 'Paws::Net::APIResponse=HASH(0x55e84d209fd0)') called at /home/user/local/lib/perl5/Paws/Net/RestJsonResponse.pm line 23
        Paws::Net::RestJsonResponse::process('Paws::Net::RestJsonResponse=HASH(0x55e84d0dc0d0)', 'Paws::Batch::DescribeJobs=HASH(0x55e84cbafb68)', 'Paws::Net::APIResponse=HASH(0x55e84d209fd0)') called at /home/user/local/lib/perl5/Paws/Net/Caller.pm line 46
        Paws::Net::Caller::caller_to_response('Paws::Net::Caller=HASH(0x55e84bb21140)', 'Paws::Batch=HASH(0x55e84ce98a88)', 'Paws::Batch::DescribeJobs=HASH(0x55e84cbafb68)', 'Paws::Net::APIResponse=HASH(0x55e84d209fd0)') called at /home/user/local/lib/perl5/Paws/Net/RetryCallerRole.pm line 19
        Paws::Net::RetryCallerRole::do_call('Paws::Net::Caller=HASH(0x55e84bb21140)', 'Paws::Batch=HASH(0x55e84ce98a88)', 'Paws::Batch::DescribeJobs=HASH(0x55e84cbafb68)') called at /home/user/local/lib/perl5/Paws/Batch.pm line 65
pplu commented

Does taking required => 1 out of Paws/Batch/JobDetail.pm StartedAt attribute solve the problem?

Yes

Looks like this is a mistake by AWS. As per the documentation and botocore api json, the StartedAt parameter is required.

https://docs.aws.amazon.com/batch/latest/APIReference/API_JobDetail.html