Returing User Facebook Login

When I try to login with facebook (Easy facebook login) the first time, the user is able to log in successfully.

I see on the web console the created user, but when I run the app again, and try to login with facebook(same credentials) I get this error:

502 Bad Gateway nginx/1.4.2

At the same time when I try to look at my web console I get “server temporarily unavailable” for about 5-10 seconds and then the web console returns back to normal.

Please let me know how to resolve this error

Regards,

George

Hi George,

Could you try it again? I suspect you ran it when we had a brief moment of outage today.

Regards,
Mark

Hi Mark,

I just tried it again, but I get the same error.

Regards,

George

Hi George!

Could you provide sample of your code and your app id?
Regards,
Kate.

My application id is 810E1BD2-99CC-1065-FF51-9DEFFFC14500

what i do is simply this

Backendless.UserService.loginWithFacebook(getActivity(), new AsyncCallback<BackendlessUser>() {
    @Override
    public void handleResponse(BackendlessUser user) {
       
    }

    @Override
    public void handleFault(BackendlessFault backendlessFault) {
        
    }
});

Which runs fine the first time, the user can login, I can see the user in the console in the User’s table, but when I try to login again, I get the error.

Regards,

George

@Kate

Hi Kate!

Any update on this issue?

Regards,

George

Hi George!

I’m able to reproduce this issue: root of problem in cyclic relations and autoload.
We need several days for resolving this issue. We will notify you about server updates.
Regards,
Kate.

Thank you Kate.
Is this cyclic relations issue also sometimes responsible for objects with relations to other objects,
having autoload enabled not being able to be updated/saved?

Regards,

George

Hi George!

We updated code on production server. Could you try login facebook user again?
Regards,
Kate.

Hi Kate,
Thank you for the update, I will try it out today and get back to you.

Regards,

George

I just checked and its working now. Thank you

But now I am getting a class cast exception in one of the User’s properties which is a relation to another table.
java.util.HashMap cannot be cast to UserLocation

even though I have done the followig
Backendless.Data.mapTableToClass(“UserLocation”, UserLocation.class);While when I use regular signup and login this issue is not present.

Regards,

George

Hi Kate,
I thought to post it in different comment to be more clear.
Now I am getting a class cast exception in one of the User’s properties which is a relation to another table.
java.util.HashMap cannot be cast to UserLocation

even though I have done the followig
Backendless.Data.mapTableToClass(“UserLocation”, UserLocation.class);While when I use regular signup and login this issue is not present.

Regards,

George

Hi George!

Could you try this use case with latest android sdk?

Hi Kate,

The test I run is with the latest android sdk.
I have the updated version. I regularly check for nee sdk versions and download the new ones.

Regards,

George

Hi George,

Could you post the UserLocation class here?

Regards,
Mark

Hi Mark,

Sure I can post my UserLocation class

public class UserLocation
{
  private java.util.Date created;
  private java.util.Date updated;
  private String ownerId;
  private Boolean isPrivate;
  private String objectId;
  private BackendlessUser user;
  private NudgeLocationHistory nudgeHistory;
  private GeoPoint location;
  public java.util.Date getCreated()
  {
    return created;
  }

  public java.util.Date getUpdated()
  {
    return updated;
  }

  public String getOwnerId()
  {
    return ownerId;
  }

  public Boolean getIsPrivate()
  {
    return isPrivate;
  }

  public void setIsPrivate( Boolean isPrivate )
  {
    this.isPrivate = isPrivate;
  }

  public String getObjectId()
  {
    return objectId;
  }

  public BackendlessUser getUser()
  {
    return user;
  }

  public void setUser( BackendlessUser user )
  {
    this.user = user;
  }

  public NudgeLocationHistory getNudgeHistory()
  {
    return nudgeHistory;
  }

  public void setNudgeHistory( NudgeLocationHistory nudgeHistory )
  {
    this.nudgeHistory = nudgeHistory;
  }

  public GeoPoint getLocation()
  {
    return location;
  }

  public void setLocation( GeoPoint location )
  {
    this.location = location;
  }

}

Sorry for the late response.

Regards,

George

Hi Mark,

Any update on this issue?

Regards,

George

Hi, George!

Could not reproduce your issue to this moment. Can you help us here?
Could you send us your project that encounters this error (support@backendless.com)? If you have the stable steps to get this error, please share them too.
Thank you!

Hi Anatolii!

I will try and put together a small project demonstrating this issue sometime today, and I will send it to you.

Thank you

George

Hi Anatolii,

I have two screenshots that show the problem when logging in with facebook. One picture shows the result when getting the property with regular login, and the other with facebook login. You can see from the evaluator that in regular login procedure the object is fetched as “UserLocation” object, while when attempt is made from facebook its fetched as a Map, and hence the error.
I hope this helps.

Regards,

Georgehttp://support.backendless.com/public/attachments/724b3d9db88139b9072c38c4ca986e22.png</img>http://support.backendless.com/public/attachments/d4650758204d3923d95f6695c4d7c6b1.png</img>