-
Notifications
You must be signed in to change notification settings - Fork 277
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
Compliance dashboard does not show the Overall Compliance Trend #138
Comments
Additional details: I tried Postman to submit the POST request to the "/api/compliance/v1/trend/compliance" API with:
It looks like the Angular Code is not sending the "from" parameter in the ISO 8601 date format yyyy-MM-dd'T'HH:mm:ss.SSS. The Angular code "compliance-overview-trend.component.ts" seems to be generating the "from" string only in the yyyy-MM-dd format which is a different format from the Date parser is expecting. This could be the reason why I am not able to see the "Overall Compliance Trend" and "Trend of Number of Policy Violations" sections. I am curious to know if others are facing the same problem where they are not able to see the "Overall Compliance Trend" and "Trend of Number of Policy Violations" sections in the Compliance landing page. I have tried both Firefox and Chrome, and got the same error. Not tried in IE or Microsoft Edge. |
I'm having the same exact issue. Does not work in Safari either. |
This is due to Date format issue, we will be release fix for this as part PacBot 1.2 release and it's coming soon. |
PacBot 1.2 version is released. Please check and feel free to re-open if the issue persists. |
Micro services
Compliance Service
OS Type: Windows/Linux/MacOS
Java version:
Summary
In the Compliance landing page of PacBot, the "Overall Compliance Trend" and the "Trend of Number of Policy Violations" show an error message "Uh-oh! Something went wrong while we were fetching your data.".
What I observed in the Firefox browser:
In the browser, these are the API calls that are going and they both show HTTP Code 400:
http://pacbot-xxxxxxx.us-west-2.elb.amazonaws.com/api/compliance/v1/trend/compliance
http://pacbot-xxxxxxx.us-west-2.elb.amazonaws.com/api/compliance/v1/trend/issues
(URL masked for security purposes)
HTTP Params:
ag: aws
from: 2019-1-26
filters {domain Infra & Platforms}
HTTP Response:
timestamp: 2019-02-26T15:14:34.869+0000
status: 400
error : Bad Request
message: JSON parse error: Cannot deserialize value of type
java.util.Date
from String "2019-1-26": not a valid representation (error: Failed to parse Date value '2019-1-26': Cannot parse date "2019-1-26": while it seems to fit format 'yyyy-MM-dd', parsing fails (leniency? null)); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of typejava.util.Date
from String "2019-1-26": not a valid representation (error: Failed to parse Date value '2019-1-26': Cannot parse date "2019-1-26": while it seems to fit format 'yyyy-MM-dd', parsing fails (leniency? null)) at [Source: (PushbackInputStream); line: 1, column: 20] (through reference chain: com.tmobile.pacman.api.compliance.domain.CompliantTrendRequest["from"]))path /api/compliance/v1/trend/compliance
What I saw in the Cloudwatch logs:
In the Cloudwatch events of Compliance API, I see these error messages.
o.s.w.s.m.s.DefaultHandlerExceptionResolver.handleHttpMessageNotReadable - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type
java.util.Date
from String "2019-1-26": not a valid representation (error: Failed to parse Date value '2019-1-26': Cannot parse date "2019-1-26": while it seems to fit format 'yyyy-MM-dd', parsing fails (leniency? null)); nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of typejava.util.Date
from String "2019-1-26": not a valid representation (error: Failed to parse Date value '2019-1-26': Cannot parse date "2019-1-26": while it seems to fit format 'yyyy-MM-dd', parsing fails (leniency? null))I do not know why the date "2019-1-26" was used as the "From" date to display the Compliance Trend report. I installed the PacBot afresh yesterday.
Everything else seems to be working, such as "Policy Compliance Overview" and "Overall Compliance" graphics in the "Compliance" landing page.
Reproduce steps
Expected Results
Actual Results
The text was updated successfully, but these errors were encountered: