By: Olaf Meske user 01 Jul 2020 at 10:25 a.m. CDT

4 Responses
Olaf Meske gravatar
## Expected behavior All logins are successful. ## Actual behavior If two login attempts occurred during some milliseconds (up to several hundred milliseconds) than only the first login attempt succeed and the following attempts fail with INTERNAL SERVER ERROR 500. In the oxauth.log there are several entries about: g.gluu.oxauth.model.common.AuthorizationGrant] (AuthorizationGrant.java:181) - Failed to persist entry: [...] with cause by: Caused by: org.gluu.persist.exception.operation.DuplicateEntryException: Entry already exists at org.gluu.persist.ldap.operation.impl.LdapOperationsServiceImpl.addEntryImpl(LdapOperationsServiceImpl.java:726) - If the time between two login attempts is longer than about 1 second, than all logins are successful. - If we use different credentials than everything is OK. ## Minimized example See mini bash script that do some logins in a row with same credentials ``` #!/bin/bash # Need to set all three constants to proper values export TOKEN_ISSUER_URL=https://example.com/oxauth/restv1/token export CLIENT_ID=Hidden-Client-Id export CLIENT_SECRET=My-Client-Secret loginAttempt() { runCount="$1" response=$( curl --fail --silent --show-error -X POST "${TOKEN_ISSUER_URL}" -u "${CLIENT_ID}:${CLIENT_SECRET}" -d "grant_type=client_credentials&scope=openid" ) if [[ $? -ne 0 ]]; then echo "Login failed for ${runCount}. attempt." else echo "Login succeed for ${runCount}. attempt." fi # with an additional sleep 1sec all login attempts are OK. # sleep 1 } for i in {1..10} ; do loginAttempt $i done ``` The log file is at pastebin: [LogFile](https://pastebin.com/ifUHG6Qh)

By Aliaksandr Samuseu staff 01 Jul 2020 at 10:37 a.m. CDT

Aliaksandr Samuseu gravatar
Hi, Olaf. Sorry, could you elaborate on this? >If two login attempts occurred during some milliseconds (up to several hundred milliseconds) than only the first login attempt succeed and the following attempts fail with INTERNAL SERVER ERROR 500. Specifically, could you describe a real-world scenario where this issue can be seen?

By Aliaksandr Samuseu staff 01 Jul 2020 at 10:40 a.m. CDT

Aliaksandr Samuseu gravatar
I can only imagine a case when a user starts a browser which restores several tabs from previous session, in which some protected web pages are opened; thus it triggers several simultaneous login flows, hitting Gluu Server almost at the same time. Is this what you are facing?

By Olaf Meske user 01 Jul 2020 at 11:42 a.m. CDT

Olaf Meske gravatar
We develop a server application that uses several gluu session and all are connected during startup, thats where these logins occurred: multi-threaded at startup.

By Olaf Meske user 21 Jul 2020 at 3:24 a.m. CDT

Olaf Meske gravatar
Hi support, today I recognize that this bug is already closed, but with no given or reported solution. Additionally I didn't get any information about the closing of my bug report. Why are you closing a simple repeatable bug with an INTERNAL_SERVER_ERROR without any given additional information? I still have to circumvent this bug.