Closed vesajaaskelainen closed 4 weeks ago
Same problem is also present in aws iot describe-certificate
and the proposed change also fixes that.
Hi @vesajaaskelainen - thanks for reaching out.
I've attempted a couple times to reproduce this but was unable to. Then I continue to look into the Overflow Error
you're seeing and it seems to be a generic Python lib error rather than botocore/AWS CLI.
Also I noticed that you installed awscliv2
via pip which we do not support. Please use the installation methods mentioned in this docs and retry the command?
Hi @vesajaaskelainen - thanks for reaching out.
I've attempted a couple times to reproduce this but was unable to. Then I continue to look into the
Overflow Error
you're seeing and it seems to be a generic Python lib error rather than botocore/AWS CLI. Also I noticed that you installedawscliv2
via pip which we do not support. Please use the installation methods mentioned in this docs and retry the command?
Please set you time zone somewhere that is positive like +02:00 then the python's time sanity checker goes haywire.
I installed awscliv2 with as instructed but with that you cannot debug it as you encapsulate the libraries. The problem description command was executed with the pristine release installed with installation instructions.
Only way to debug the problem was to install the components in python's virtual environment.
Here is example session when playing out with time zone from command line (with release aws cli):
$ aws --version
aws-cli/2.11.16 Python/3.11.3 Linux/5.19.0-41-generic exe/x86_64.ubuntu.22 prompt/off
$ aws iot describe-ca-certificate --profile my-profile --certificate-id xxxxxx
date value out of range
$ TZ='America/New_York' aws iot describe-ca-certificate --profile my-profile --certificate-id xxxxxx
{
"certificateDescription": {....
}
}
$ TZ='Europe/Helsinki' aws iot describe-ca-certificate --profile my-profile --certificate-id xxxxxx
date value out of range
@vesajaaskelainen - apologies for the silence here.
The "date value out of range" error typically occurs when the AWS CLI encounters a date or timestamp value that it cannot parse correctly. This issue can arise due to differences in time zone handling, date formatting, or other compatibility issues between your local system and the AWS service you're interacting with.
Here are a few steps to troubleshoot:
cli_timestamp_format
configuration variable to a format that works for your use case.
aws configure set cli_timestamp_format "iso8601"
aws iot describe-ca-certificate --region us-west-2
Let me know if issue persists after trying above steps.
Greetings! It looks like this issue hasn’t been active in longer than five days. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.
Describe the bug
I registered IEEE Secure Device Identity based CA certificate in the AWS IoT Core.
In AWS IoT Console Web UI it is shown OKish.
Now I try to see certificate details from CLI:
My current time zone is
Europe/Helsinki
(GMT+02:00)Expected Behavior
Command
aws iot describe-ca-certificate
would display details correctly.Current Behavior
Same command with additional
--debug
:Reproduction Steps
Invoke AWS CLI method:
in example with the following scripts:
Alternatively just invoke the
parse_timestamp
function with2.53402300799E11
:Possible Solution
Treat the time as UTC always:
and then trying it out:
To get consistent output I would probably just always use tzutc() for parsing the date time and if for some reason this does not work then use local timezone.
Testing the change:
Personally I would prefer to have timestamp in ISO format eg.
9999-12-31T23:59:59Z
but also that+00:00
form is understandable.Additional Information/Context
No response
SDK version used
1.29.123
Environment details (OS name and version, etc.)
Ubuntu 22.04