Skip to content

devops-agent list-chats fails with "year must be in 1..9999" — API returns epoch-milliseconds, parser expects seconds #10222

@hhassen

Description

@hhassen

Describe the bug

aws devops-agent list-chats (and likely other devops-agent commands returning timestamps) fails with ValueError: year must be in 1..9999, not 58244. The API returns timestamps in epoch-milliseconds but botocore's timestamp parser treats them as epoch-seconds, resulting in an impossible year.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

The command should return a valid JSON response with properly formatted timestamps:

{
  "executions": [
    {
      "executionId": "1f45ce7b-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "createdAt": "2026-04-12T08:12:01Z",
      "updatedAt": "2026-04-12T08:14:58Z",
      "summary": "Investigation Status Update Request"
    }
  ]
}

Current Behavior

The command fails before producing any output:

$ aws devops-agent list-chats --agent-space-id <AGENT_SPACE_ID> --user-id <USER_ID> --output json

aws: [ERROR]: year must be in 1..9999, not 58244

The --debug flag reveals the API returns a valid HTTP 200 with epoch-millisecond timestamps:

Response body:
b'{"executions":[{"executionId":"1f45ce7b-xxxx-xxxx-xxxx-xxxxxxxxxxxx","createdAt":1775836321122,"updatedAt":1775836498842,"summary":"Investigation Status Update Request"}]}'

1775836321122 ms = 1775836321 s = 2026-04-12T08:12:01Z (valid), but the parser interprets the raw value as seconds, producing year 58244.

Reproduction Steps

# Any devops-agent command that returns timestamps will trigger this
aws devops-agent list-chats \
  --agent-space-id <AGENT_SPACE_ID> \
  --user-id <USER_ID> \
  --output json

Stack Trace (from --debug output)

Traceback (most recent call last):
  File "awscli/clidriver.py", line 550, in main
  File "awscli/clidriver.py", line 688, in __call__
  File "awscli/clidriver.py", line 905, in __call__
  File "awscli/clidriver.py", line 1041, in invoke
  File "awscli/clidriver.py", line 1055, in _make_client_call
  File "awscli/botocore/client.py", line 438, in _api_call
  File "awscli/botocore/client.py", line 892, in _make_api_call
  File "awscli/botocore/client.py", line 922, in _make_request
  File "awscli/botocore/endpoint.py", line 114, in make_request
  File "awscli/botocore/endpoint.py", line 149, in _send_request
  File "awscli/botocore/endpoint.py", line 190, in _get_response
  File "awscli/botocore/endpoint.py", line 264, in _do_get_response
  File "awscli/botocore/parsers.py", line 262, in parse
  File "awscli/botocore/parsers.py", line 1123, in _do_parse
  File "awscli/botocore/parsers.py", line 1133, in _add_modeled_parse
  File "awscli/botocore/parsers.py", line 1175, in _parse_payload
  File "awscli/botocore/parsers.py", line 342, in _parse_shape
  File "awscli/botocore/parsers.py", line 701, in _handle_structure
  File "awscli/botocore/parsers.py", line 342, in _parse_shape
  File "awscli/botocore/parsers.py", line 1234, in _handle_list
  File "awscli/botocore/parsers.py", line 355, in _handle_list
  File "awscli/botocore/parsers.py", line 342, in _parse_shape
  File "awscli/botocore/parsers.py", line 701, in _handle_structure
  File "awscli/botocore/parsers.py", line 342, in _parse_shape
  File "awscli/botocore/parsers.py", line 720, in _handle_timestamp
  File "awscli/customizations/timestampformat.py", line 46, in iso_format
  File "awscli/botocore/utils.py", line 828, in parse_timestamp
  File "awscli/botocore/utils.py", line 798, in _parse_timestamp_with_tzinfo
ValueError: year must be in 1..9999, not 58244

Possible Solution

Either:

  • The devops-agent service model's timestamp fields should specify timestampFormat: "unixTimestamp" with millisecond handling, or
  • The API should return epoch-seconds instead of epoch-milliseconds, or
  • botocore/parsers.py _handle_timestamp should detect and normalize millisecond-precision timestamps (value > 9999999999 → divide by 1000)

Additional Information/Context

This affects all devops-agent commands that return timestamp fields. The API itself works correctly (HTTP 200 with valid data) — the failure is purely in the client-side response parser. Workaround: use --debug 2>&1 | grep 'Response body' to extract the raw JSON response.

The devops-agent service reached GA on March 31, 2026.

CLI version used

2.34.26

Environment details (OS name and version, etc.)

AWS CloudShell, Linux 6.1.163 (Amazon Linux 2023), Python 3.14.3, x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions