You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running the latest Parse-Server (2.1.6) and Parse (1.6.12) on my AWS EB instance. I noticed that when the user signs up via the iOS or Android clients with signUpInBackground, the user's username becomes a random string (e.g. "username": "52927b5594f76b391cc6fbdcbe2da63c"), even though I set the user's username to be the email.
Therefore, user's can't relogin because their email isn't associated to their username.
Here's a snippet of the Android code:
ParseUser user = new ParseUser();
if( ParseAnonymousUtils.isLinked(ParseUser.getCurrentUser()) ) {
user = ParseUser.getCurrentUser(); // Sign Up current anonymous user
}
user.setUsername(email);
user.setPassword(password);
user.setEmail(email);
user.put("firstName", firstName);
user.put("lastName", lastName);
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
saveInstallation(new SaveCallback() {
@Override
public void done(ParseException e) {
if( callback != null ) {
callback.onSuccess();
}
}
});
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
if( callback != null ) {
callback.onFailure(e.getMessage());
}
}
}
});
@flovilmart Sorry for the delay. Yes, I finally managed to update to 2.2.4 on AWS can I still see the same issue. The username is still generated and isn't given the email value I give it at sign up, both on iOS and Android.
Hmmm... I just noticed I do a saveEventually when I login anonymously (before sign up):
ParseAnonymousUtils.logIn(new LogInCallback() {
@Override
public void done(ParseUser user, ParseException e) {
if (e == null) {
user.saveEventually();
saveInstallation(new SaveCallback() {
@Override
public void done(ParseException e) {
});
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
}
}
});
Have you tested on your side? I tried with Parse-Server 2.2.4, and 2.1.6, and still the same issue. I also removed the "saveEventually", but it didn't help.
So I just tried deploying the app on Heroku instead of AWS... and now it works. SO INFURIATING. I have no idea why it had that behaviour on AWS. Sorry for wasting your time, and a huge thank you for your contribution to Parse. :)
no problem! here to help. That's odd what's happening on AWS. But if you can stick to heroku, you'll be better off for now, Elastic Beanstalk is not that easy to manage. ;)
Activity
flovilmart commentedon Apr 2, 2016
The latest parse server is 2.2.4 ;) can you update and see if the issue is still here?
meilers commentedon Apr 2, 2016
@flovilmart Sorry for the delay. Yes, I finally managed to update to 2.2.4 on AWS can I still see the same issue. The username is still generated and isn't given the email value I give it at sign up, both on iOS and Android.
flovilmart commentedon Apr 2, 2016
Ok that's annoying, I'll have a look before next week
meilers commentedon Apr 2, 2016
Ok thanks. I'll be downgrading to 2.0 in the meantime, because it's pretty critical to me that users can't log back in.
flovilmart commentedon Apr 3, 2016
That's very very odd as this is properly covered by unit tests here.
Can you run the server with environment var
VERBOSE=1and let us know the trace of requests/responses upon signup?meilers commentedon Apr 3, 2016
Here is is. Here are the headers for sign up:
With JSON payload:

Here are the response headers:

With JSON:

Now, when I do a login, right after (in between the user gets logged in anonymously because I log out), here is the request:

With JSON:

And response:
With JSON:

flovilmart commentedon Apr 3, 2016
What does it look like in mongodb? the randomly generated string is generated at the time we link/create an anonymous user.
meilers commentedon Apr 3, 2016
{
"_id": "DpYUKuoTqx",
"_rperm": [
"DpYUKuoTqx",
"*"
],
"_wperm": [
"DpYUKuoTqx"
],
"username": "cf421f4bac640e6cdd582f036beee972",
"_updated_at": {
"$date": "2016-04-03T17:22:55.860Z"
},
"_created_at": {
"$date": "2016-04-03T17:20:35.054Z"
},
"_auth_data_anonymous": null,
"lastName": "Test",
"firstName": "Test",
"email": "test16@test.com",
"_hashed_password": "$2a$10$usYnVR.Pn/A7Nc5ZPzpReOGfDTNUUwH9/FfKZh1XWRyD5Rjlh7FaG"
}
flovilmart commentedon Apr 3, 2016
alright thx!
flovilmart commentedon Apr 3, 2016
Do you have a beforeSave on _User?
meilers commentedon Apr 3, 2016
No - should I?
flovilmart commentedon Apr 3, 2016
nope, just to scratch out potential problems
meilers commentedon Apr 3, 2016
Hmmm... I just noticed I do a saveEventually when I login anonymously (before sign up):
Could that be a problem?
flovilmart commentedon Apr 3, 2016
yeah, that may be related as you may introduce a race condition here... ParseAnonymousUtils.logIn will save your user anyway
meilers commentedon Apr 3, 2016
Weird it's working on older versions of Parse-Server though. Let me test without it.
1 remaining item
meilers commentedon Apr 3, 2016
Yeah - AWS Beanstalk is slow today. I'm requesting the logs as we speak.
flovilmart commentedon Apr 3, 2016
use
eb sshmeilers commentedon Apr 3, 2016
ok i'm in with ssh. Where can I find the logs?
flovilmart commentedon Apr 3, 2016
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.logging.html
that would be in /var/log/nodejs/
or in
/srv/...
meilers commentedon Apr 3, 2016
PUT /parse/classes/_User/DpYUKuoTqx { host: 'parse-server-birder.elasticbeanstalk.com',
'x-real-ip': '10.164.111.163',
'x-forwarded-for': '24.203.158.119, 10.164.111.163',
'content-length': '165',
'accept-encoding': 'gzip',
'content-type': 'application/json',
'user-agent': 'Parse Android SDK 1.13.0 (com.sobremesa.birdwatching/36) API Level 23',
'x-parse-app-build-version': '36',
'x-parse-app-display-version': '1.7',
'x-parse-application-id': 'xxxxxxxxxxxxx',
'x-parse-client-key': 'xxxxxxxxxxxxx',
'x-parse-client-version': 'a1.13.0',
'x-parse-installation-id': '6fffc9ca-eeca-4b3b-82b9-e8a70987f1db',
'x-parse-os-version': '6.0.1',
'x-parse-session-token': 'r:a9a539a5979e05f959fe6f28454a131d',
'x-forwarded-port': '80',
'x-forwarded-proto': 'http' } {
"lastName": "Test",
"firstName": "Test",
"email": "test16@test.com",
"password": "test",
"username": "test16@test.com",
"authData": {
"anonymous": null
},
"objectId": "DpYUKuoTqx"
}
response: {
"response": {
"updatedAt": "2016-04-03T17:22:55.860Z"
}
}
meilers commentedon Apr 3, 2016
hmmm is verbose not working?
flovilmart commentedon Apr 3, 2016
no calls before or after? this is what you get with VERBOSE
meilers commentedon Apr 3, 2016
This what I have just before...
PUT /parse/classes/_Installation/YtmhOeQ1JO { host: 'parse-server-birder.elasticbeanstalk.com',
'x-real-ip': '10.164.111.163',
'x-forwarded-for': '24.203.158.119, 10.164.111.163',
'content-length': '119',
'accept-encoding': 'gzip',
'content-type': 'application/json',
'user-agent': 'Parse Android SDK 1.13.0 (com.sobremesa.birdwatching/36) API Level 23',
'x-parse-app-build-version': '36',
'x-parse-app-display-version': '1.7',
'x-parse-application-id': 'xxxxxxxxx',
'x-parse-client-key': 'xxxxxxxxx',
'x-parse-client-version': 'a1.13.0',
'x-parse-installation-id': '6fffc9ca-eeca-4b3b-82b9-e8a70987f1db',
'x-parse-os-version': '6.0.1',
'x-parse-session-token': 'r:a9a539a5979e05f959fe6f28454a131d',
'x-forwarded-port': '80',
'x-forwarded-proto': 'http' } {
"userId": "DpYUKuoTqx",
"user": {
"__type": "Pointer",
"className": "_User",
"objectId": "DpYUKuoTqx"
},
"objectId": "YtmhOeQ1JO"
}
response: {
"response": {
"updatedAt": "2016-04-03T17:22:56.723Z"
}
}
flovilmart commentedon Apr 3, 2016
ok so if there is no other call on _User/DpYUKuoTqx that's really odd
meilers commentedon Apr 3, 2016
Just noticed this. When I logout after signing up, and log in anonymously, it returns the same _User/DpYUKuoTqx:
POST /parse/users { host: 'parse-server-birder.elasticbeanstalk.com',
'x-real-ip': '10.164.111.163',
'x-forwarded-for': '24.203.158.119, 10.164.111.163',
'content-length': '72',
'accept-encoding': 'gzip',
'content-type': 'application/json',
'user-agent': 'Parse Android SDK 1.13.0 (com.sobremesa.birdwatching/36) API Level 23',
'x-parse-app-build-version': '36',
'x-parse-app-display-version': '1.7',
'x-parse-application-id': 'xxxxxxxx',
'x-parse-client-key': 'xxxx',
'x-parse-client-version': 'a1.13.0',
'x-parse-installation-id': '6fffc9ca-eeca-4b3b-82b9-e8a70987f1db',
'x-parse-os-version': '6.0.1',
'x-forwarded-port': '80',
'x-forwarded-proto': 'http' } {
"authData": {
"anonymous": {
"id": "aaf2bbf0-a113-49b4-bbd2-a75f65ca54e5"
}
}
}
response: {
"status": 201,
"response": {
"objectId": "DpYUKuoTqx",
"createdAt": "2016-04-03T17:20:35.054Z",
"sessionToken": "r:a9a539a5979e05f959fe6f28454a131d"
},
"location": "http://parse-server-birder.elasticbeanstalk.com/parse/users/DpYUKuoTqx"
}
Right after, there's the log in call that fails:
GET /parse/login { host: 'parse-server-birder.elasticbeanstalk.com',
'x-real-ip': '10.164.111.163',
'x-forwarded-for': '24.203.158.119, 10.164.111.163',
'content-length': '64',
'accept-encoding': 'gzip',
'content-type': 'application/json',
'user-agent': 'Parse Android SDK 1.13.0 (com.sobremesa.birdwatching/36) API Level 23',
'x-parse-app-build-version': '36',
'x-parse-app-display-version': '1.7',
'x-parse-application-id': 'xxxxx',
'x-parse-client-key': 'xxxxx',
'x-parse-client-version': 'a1.13.0',
'x-parse-installation-id': 'fd1c71a3-d441-47f3-a5d3-8accadd54cf7',
'x-parse-os-version': '6.0',
'x-forwarded-port': '80',
'x-forwarded-proto': 'http' } {
"username": "test15@test.com",
"password": "test"
}
error: ParseError { code: 101, message: 'Invalid username/password.' }
flovilmart commentedon Apr 3, 2016
it's very odd that
"anonymous": { "id": "aaf2bbf0-a113-49b4-bbd2-a75f65ca54e5" }returns your user.meilers commentedon Apr 4, 2016
Have you tested on your side? I tried with Parse-Server 2.2.4, and 2.1.6, and still the same issue. I also removed the "saveEventually", but it didn't help.
meilers commentedon Apr 4, 2016
So I just tried deploying the app on Heroku instead of AWS... and now it works. SO INFURIATING. I have no idea why it had that behaviour on AWS. Sorry for wasting your time, and a huge thank you for your contribution to Parse. :)
flovilmart commentedon Apr 4, 2016
no problem! here to help. That's odd what's happening on AWS. But if you can stick to heroku, you'll be better off for now, Elastic Beanstalk is not that easy to manage. ;)