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

Batch SDK - AttemptContainerDetail - wrongly defined, reason instead of statusReason #3029

Closed
LoganWlv opened this issue Sep 13, 2023 · 3 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days.

Comments

@LoganWlv
Copy link

LoganWlv commented Sep 13, 2023

Describe the bug

Hello,

We are redirecting AWS Batch events to an SQS queue.
Within the message we can find the job detail (JobDetail), nested inside can be found one or more AttemptContainerDetail, somehow in the message the reason is serialized as statusReason, while the Java object field is defined as reason (getter is getReason), hence it isn't serialized properly.

Is it expected?

Expected Behavior

I'd either except EventBridge to properly serialize the JobDetail object.
Or change the JobDetail object definition, to match the one used in EventBridge.

Current Behavior

Applicative code define: AttemptContainerDetail#reason
While EventBridge define: AttemptContainerDetail#statusReason

Reproduction Steps

Just compare event from AWS Batch to the applicative code on Github

Possible Solution

No response

Additional Information/Context

No response

AWS Java SDK version used

1.12.512

JDK version used

17

Operating System and version

Linux/X86_64

@LoganWlv LoganWlv added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Sep 13, 2023
@debora-ito
Copy link
Member

While EventBridge define: AttemptContainerDetail#statusReason

Can you show exactly where are you seeing statusReason?

@debora-ito debora-ito added p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Sep 22, 2023
@debora-ito debora-ito self-assigned this Sep 22, 2023
@debora-ito debora-ito added the response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days. label Sep 22, 2023
@LoganWlv
Copy link
Author

Ok I assume I was wrong somewhere, I cannot find the issue in the following event.
Sorry and thank you.

{
  "version": "0",
  "id": "<hidden>",
  "detail-type": "Batch Job State Change",
  "source": "aws.batch",
  "account": "<hidden>",
  "time": "2023-09-27T02:09:53Z",
  "region": "eu-west-1",
  "resources": [
    "arn:aws:batch:eu-west-1:<hidden>"
  ],
  "detail": {
    "jobArn": "arn:aws:batch:eu-west-1:<hidden>",
    "jobName": "<hidden>",
    "jobId": "<hidden>",
    "jobQueue": "arn:aws:batch:eu-west-1:<hidden>",
    "status": "FAILED",
    "attempts": [
      {
        "container": {
          "containerInstanceArn": "arn:aws:ecs:eu-west-1:<hidden>",
          "taskArn": "arn:aws:ecs:eu-west-1:<hidden>",
          "reason": "CannotPullContainerError: Error response from daemon: manifest for <hidden>",
          "networkInterfaces": []
        },
        "stoppedAt": 1695780593408,
        "statusReason": "Task failed to start"
      }
    ],
    "statusReason": "Task failed to start",
    "createdAt": 1695780358903,
    "stoppedAt": 1695780593408,
    "dependsOn": [],
    "jobDefinition": "arn:aws:batch:eu-west-1:<hidden>",
    "parameters": {},
    "container": {
      "image": "<hidden>",
      "vcpus": 2,
      "memory": 8000,
      "command": [
        "<hidden>"
      ],
      "executionRoleArn": "arn:aws:iam::<hidden>",
      "volumes": [],
      "environment": [],
      "mountPoints": [],
      "ulimits": [
        {
          "hardLimit": 6096,
          "name": "nofile",
          "softLimit": 6096
        }
      ],
      "privileged": true,
      "reason": "CannotPullContainerError: Error response from daemon: manifest for <hidden>",
      "containerInstanceArn": "arn:aws:ecs:eu-west-1:<hidden>",
      "taskArn": "arn:aws:ecs:eu-west-1:<hidden>",
      "networkInterfaces": [],
      "resourceRequirements": [
        {
          "value": "512000",
          "type": "MEMORY"
        },
        {
          "value": "16",
          "type": "VCPU"
        }
      ],
      "logConfiguration": {
        "logDriver": "fluentd",
        "options": {
          "fluentd-address": "127.0.0.1:24224"
        },
        "secretOptions": []
      },
      "secrets": []
    },
    "tags": {
      "resourceArn": "arn:aws:batch:eu-west-1:<hidden>"
    },
    "propagateTags": true,
    "platformCapabilities": [],
    "eksAttempts": []
  }
}

@github-actions
Copy link

COMMENT VISIBILITY WARNING

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info or feedback. Will move to "closing-soon" in 5 days.
Projects
None yet
Development

No branches or pull requests

2 participants