Closed miguelguzmanconde closed 6 years ago
Hi @miguelguzmanconde,
Are you facing the issue in the latest SDK version? Can you provide us logs where it succeeds and fails? Did you modify the AWS Region between the retries?
I have also triggered this issue. I had some old tokens and I deleted the user via the cognito webpage. Essentially, I encountered com.amazonaws.services.cognitoidentityprovider.model.UserNotFoundException: User does not exist. (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: UserNotFoundException; Request ID: 9911881f....)
.
The error message was "User does not exist." - you will note that the previous catch statement clears the tokens with clearCachedTokens();
. I added the clear cached tokens method and that resolved my issue - without the fix the user was stuck in a failure loop.
} catch (final Exception e) {
clearCachedTokens(); // <- added
throw new CognitoInternalErrorException("Failed to authenticate user", e);
}
Hi @miguelguzmanconde, Can you provide us the implementation of UserPoolManager is possible? @snodnipper, We will check and add the trigger accordingly. Thank you for the analysis.
I am running into the same issue. This is new, it was working before. I updated the cognito library to v2.6.14. The error I am receiving is:
com.amazonaws.services.cognitoidentityprovider.model.UserNotFoundException: User does not exist. (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: UserNotFoundException; Request ID: 334a4da1-42a3-11e8-8072-11ccbb2a2c28)
I was trying to get user details using the "GetDetailsHandler". I successfully signed the user in, then I tried to get user details.
private static void getUserDetails() {
// set user
mUser = mUserPool.getCurrentUser();
GetDetailsHandler handler = new GetDetailsHandler() {
@Override
public void onSuccess(CognitoUserDetails cognitoUserDetails) {
}
@Override
public void onFailure(Exception exception) {
exception.printStackTrace();
// get user details failed
Log.e(TAG, exception.toString());
if (!FrameworkUtils.checkIfNull(mDatabaseRegisterCompleteLister)) {
// set listener
mDatabaseRegisterCompleteLister.onFailure(exception);
}
}
};
mUser.getDetailsInBackground(handler);
mUser object is not null. It has all the correct information, e.g. context, secretHash, userId, pool, cognitoIdentityProviderclient, ect. What happened?
Experiencing the same issue suddenly too. Its been working fine for months prior to today for me.
com.amazonaws.services.cognitoidentityprovider.model.UserNotFoundException: User does not exist. (Service: AmazonCognitoIdentityProvider; Status Code: 400; Error Code: UserNotFoundException; Request ID: 62156912-4958-11e8-b18b-b1ca6355ff7d)
I have updated to the latest SDK (2.6.18) and still no luck. It only appears to be occurring with certain credentials though - other users are having no issue authenticating. The iOS SDK has no problem authenticating with the same accounts.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because of inactivity. Please open a new issue if are still encountering problems.
To help us solve your problem better, please answer the following list of questions.
What service are you using? Cognito
In what version of SDK are you facing the problem? com.amazonaws:aws-android-sdk-s3:2.6.0
Can you give us steps to reproduce with a minimal, complete, and verifiable example? Please include any specific network conditions that might be required to reproduce the problem. My problem is that i create a user through the console.aws.amazon.com with email and phone confirmed (Because im just proving other aspects) but, when i excecute the void getSessionInBackground() it answers with UserNotFoundException. It seems to be "solved" alone if i wait some time (I dont know how much). I need to know if this is normal, if i have to still do a signin() before the getSession()... I need some information about this. I have to say that this configuration was working during the las 5 hours, i repeated the procedure at least 3 or 4 times and, like i said, after a while, the getSession() returns success.
Please include a stacktrace if applicable.
***Here is some parts of the code im using