Skip to content
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

IndexOutOfBoundsException encountered by LogsProcessor #13109

Closed
damithc opened this issue May 4, 2024 · 2 comments · Fixed by #13120
Closed

IndexOutOfBoundsException encountered by LogsProcessor #13109

damithc opened this issue May 4, 2024 · 2 comments · Fixed by #13120
Labels
p.Medium Marginal impact; would like to do if time permits s.ToInvestigate The issue sounds complete but needs validation by a core team member

Comments

@damithc
Copy link
Contributor

damithc commented May 4, 2024

V9-0-0-beta.6

Found in production server logs. Happened at least 3 times so far within last 24 hours

Error Message: IndexOutOfBoundsException caught by WebApiServlet: Index -1 out of bounds for length 0
caused by java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 0
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.util.Objects.checkIndex(Objects.java:372)
at java.util.ArrayList.get(ArrayList.java:459)
at teammates.logic.api.LogsProcessor.getNumberOfLogsForEvent(LogsProcessor.java:88)
at teammates.ui.webapi.CalculateUsageStatisticsAction.execute(CalculateUsageStatisticsAction.java:30)
at teammates.ui.webapi.CalculateUsageStatisticsAction.execute(CalculateUsageStatisticsAction.java:17)
at teammates.ui.servlets.WebApiServlet.executeWithTransaction(WebApiServlet.java:128)
at teammates.ui.servlets.WebApiServlet.invokeServlet(WebApiServlet.java:66)
at teammates.ui.servlets.WebApiServlet.doGet(WebApiServlet.java:38)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:500)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
at ...
@damithc damithc added p.Medium Marginal impact; would like to do if time permits s.ToInvestigate The issue sounds complete but needs validation by a core team member labels May 4, 2024
@damithc
Copy link
Contributor Author

damithc commented May 5, 2024

Still happening, a few times a day.

@Ashwinn11
Copy link
Contributor

This can be fixed by just adding a check whether the list is empty or not. Can I work on this?

Ashwinn11 added a commit to Ashwinn11/teammates that referenced this issue May 23, 2024
wkurniawan07 pushed a commit that referenced this issue Jun 12, 2024
* #13109-added check to see if logs is empty

* switch back to logs.get(list.size()-1)

* [#13109] IndexOutOfBoundsException encountered by LogsProcessor

---------

Co-authored-by: domoberzin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p.Medium Marginal impact; would like to do if time permits s.ToInvestigate The issue sounds complete but needs validation by a core team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants