Admin can't assign user to 'On-Call Role Schedule'
Description
Environment
Acceptance / Success Criteria
Attachments
Lucidchart Diagrams
Activity

Jeff Gehlbach November 8, 2022 at 4:18 PM
and I agree that this is sufficiently low risk to pull into 31.0.0 even though it didn't make the cut. We have merging to do anyway, so it's no extra work.

Alberto November 8, 2022 at 2:44 PM
merged to 31.x

Alberto November 8, 2022 at 12:26 AMEdited
The issue is whenever we use SimpleDateFormat without specifying a locale will use the default locale. In my case the default iocale is EN_CA (English Canada) and this causes parsing exceptions.
From the documentation SimpleDateFormat is Locale sensitive. And parsing a formatted date using SimpleDateFormat without specifying an especific Locale will become an issue in different parts of OpenNMS.
I will create a new Jira to ensure we use at least Locale.ROOT (that seems to be the implemented in a few places already in OpenNMS) in all the SimpleDateFormat instantiations.

Jeff Gehlbach September 28, 2022 at 1:52 PM
Big if reproducible.
Details
Assignee
AlbertoAlbertoReporter
Ivan TrechekasIvan TrechekasHB Grooming Date
Sep 27, 2022HB Backlog Status
Refined BacklogSprint
NoneFix versions
Affects versions
Priority
Major
Details
Details
Assignee

Reporter

HB Grooming Date
HB Backlog Status
Sprint
Fix versions
Affects versions
Priority
PagerDuty
PagerDuty Incident
PagerDuty
PagerDuty Incident
PagerDuty

Steps:
login as admin user (Admin role/ Admin group)
open 'User and Groups' (http://localhost:8980/opennms/admin/userGroupView/index.jsp)
open 'Configure On-Call Roles'
created a Role 'new role'
click on that role
in On-Call Role Schedule table click on any button to assign user on it
In 'Edit Schedule Entry' (http://localhost:8980/opennms/admin/userGroupView/roles) select any user and set up any date.
click Save
Expected:
User will be assigned on this date
Actual:
1) on 'Edit Schedule Entry' user sees empty alert notification message.
2) after click on Save button UI sends
startAmOrPm=AM
endAmOrPm=AM
that causes backend issue:
in that class org/opennms/web/admin/roles/AdminRoleServlet.java at 241th row:
Root cause?
it's not clear what triggered this issue.
From what I see:
Since we have AM / PM from UI data, it couldn't be parsed by this pattern because it expects a.m. / p.m.
But this issue could be solved by adding `Locale.US` (it works on local env)