-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
BedrockAgentClient::startIngestionJob results in "Invalid timestamp value passed to DateTimeResult::fromTimestamp" #2967
Comments
This issue also affects getIngestionJob - I imagine it may affect all BedrockClientAgent tasks. |
@yenfryherrerafeliz Thanks for investigating/fixing! Let me know if you need any extra data! |
Hi all, Apologies for the delay here. I suspect this may be an issue with the timestamp values Bedrock is sending, but I've tested both For those still affected, would it be possible to post debug logs from a call with a response parsing error? To enable debug logging, set |
@stobrien89 No sweat - I know that sometimes these things aren't easy to debug. The crux of it is.
This bubbles down to this small stack: Which in the end, attempts to call this (which reproduces the problem in one line):
Calling this directly yields a slightly more informational error, which is otherwise masked by the way the parser is constructed, (specifically in this block):
Looks like the true exception message is "The timezone could not be found in the database". Reproducible here: I apologize a bit for the confusion about environment version; our prod box is running a diff environment (7.4). I didn't think too much of it since composer install succeeds on both environments (req >= 7.2.5). Playing with 3v4l, it looks like parsing this DateFormat fails on 8.0.9: But succeeds with 8.0.10: The changelog for 8.0.10, https://www.php.net/ChangeLog-8.php#8.0.10, notes a compensation for ((DateTimeZone accepting invalid UTC timezones). Now interestingly - if you reduce to 6 decimal positions, it will parse on all versions: Valid: https://3v4l.org/sjeLa#v7.4.33
Invalid:
So you'd perhaps want to modify the service to output only 6 decimal positions, or, compensate in the parser, or, perhaps make the service return a regular old linux TS to address the issue. Hope this helps! |
Thanks @Saeven, That's extremely helpful. Seems like we might want to do a version compare and reduce decimal positions on the affected ranges, but I'll ask around to see if there's broad enough impact to warrant a change at the service level. This seems to be PHP-specific, in which case we'll likely get a fix out tomorrow or Friday, but I'll keep you posted. |
My pleasure. From years of working in Java, the standard there is six decimal places at most. The RFC doesn't place a limit on the precision, but until calling this service, I've never seen one with more than six. I suppose that the folks at PHP just follow a standard even though the RFC would contend that what you're doing is OK. That's a hell of a precision though! 🤣. With clock drift and the time it took to crunch those electrons, I wouldn't trust those tail digits too much! Thanks for the fix, look forward to it! |
Just posted #2974, which should resolve this for anywhere from 7 to 9 fractional seconds. It seems like most languages have native support for nanosecond precision and this is the first time (as far as I know) we're seeing this coming from an AWS service. Not sure if we'll ever see picoseconds, but that's a bridge we'll cross when/if we get to it 😃 . |
ROFL! Hopefully we're retired by then! 🍻 Thanks for the patch, eagerly look forward to the composer package increment! |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Any time! Thanks for your patience. This should be live in today's release around 2:15PM EDT |
Describe the bug
BedrockAgentClient::startIngestionJob results in "Invalid timestamp value passed to DateTimeResult::fromTimestamp"
Expected Behavior
That the SDK not crash with a date parsing exception
Current Behavior
Reproduction Steps
Possible Solution
Looks like a bad format of the date stamp is being pushed through your Date parser.
Additional Information/Context
While invoking StartIngestionJob - the command succeeds, but an exception is thrown with the stack trace noted above.
Examining key differences with breakpoints at the affected date parser, we see that successful calls return:
Whereas this failed call returns:
(I've tested other calls, S3, Polly, etc. which all succeed without exceptions).
It's important to note that the call actually triggers the process on the service side. The problem lies in the composer package, which throws an exception in the codebase when the response is being parsed.
SDK version used
3.316.8
Environment details (Version of PHP (
php -v
)? OS name and version, etc.)PHP 8.3.9 (cli) (built: Jul 2 2024 14:10:14) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.9, Copyright (c) Zend Technologies with Zend OPcache v8.3.9, Copyright (c), by Zend Technologies
The text was updated successfully, but these errors were encountered: