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

Error Handling with empty file list #14

Open
hypery2k opened this issue Mar 26, 2020 · 2 comments
Open

Error Handling with empty file list #14

hypery2k opened this issue Mar 26, 2020 · 2 comments

Comments

@hypery2k
Copy link
Contributor

hypery2k commented Mar 26, 2020

Seeing this error multiple times in our server looks

14:32:44,555 ERROR [org.keycloak.events.EventBuilder] (default task-587) Failed to send type to com.larscheidschmitzhermes.keycloak.events.MonitoringEventListenerProvider@5de6f2b0: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:458)
	at deployment.keycloak-monitoring-prometheus.jar//com.larscheidschmitzhermes.keycloak.events.MonitoringEventListenerProvider.increaseCounter(MonitoringEventListenerProvider.java:96)
	at deployment.keycloak-monitoring-prometheus.jar//com.larscheidschmitzhermes.keycloak.events.MonitoringEventListenerProvider.onEvent(MonitoringEventListenerProvider.java:34)
	at [email protected]//org.keycloak.events.EventBuilder.send(EventBuilder.java:192)
	at [email protected]//org.keycloak.events.EventBuilder.success(EventBuilder.java:157)
	at [email protected]//org.keycloak.services.managers.AuthenticationManager.finishedRequiredActions(AuthenticationManager.java:900)
	at [email protected]//org.keycloak.authentication.AuthenticationProcessor.authenticationComplete(AuthenticationProcessor.java:1099)
	at [email protected]//org.keycloak.authentication.AuthenticationProcessor.authenticate(AuthenticationProcessor.java:862)
	at [email protected]//org.keycloak.protocol.AuthorizationEndpointBase.handleBrowserAuthenticationRequest(AuthorizationEndpointBase.java:150)
	at [email protected]//org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.buildAuthorizationCodeAuthorizationResponse(AuthorizationEndpoint.java:465)
	at [email protected]//org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.process(AuthorizationEndpoint.java:160)
	at [email protected]//org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.buildGet(AuthorizationEndpoint.java:111)
	at jdk.internal.reflect.GeneratedMethodAccessor401.invoke(Unknown Source)

@hypery2k
Copy link
Contributor Author

hypery2k commented Mar 26, 2020

@tobilarscheid
Copy link
Member

Hi Martin, as always: good catch! Thanks for giving back to the community here.

Regarding your question:

BTW: is there a particular reason to throw a RuntimeException here:

If writing to the file fails, there is really no way to safely recover - that's why we bubble up the checked IOException as a RuntimeException

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants