Null point exception when trying to log in

I’m getting an error when I try to log in with my android app. It started to happen when I deleted manually all user record in backendless console.

$backendlessFBLogin$1: facebook login error: BackendlessFault{ code: ‘Server.Processing’, message: ‘java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException’, detail: ‘java.lang.RuntimeException: java.lang.RuntimeException: java.lang.NullPointerException’ }

The same error is returned for facebook login as well

Hi Karol,

please provide us with your App ID and sample code that does login to reproduce this problem.

app id: 3CEC2E00-5426-C827-FF96-1C345A654100

the code is the same and unchanged based on your examples. Just try to log in. Based on the error returned by the server it’s a bug on the backend.

Hi Karol,
The problem has been fixed, please verify.

Thanks Sergey, the app is working now. I have reported this issue for the third time now. Could you fix it? I guess it doesn’t happen often because it’s related to complete data deletion but it can definitely block the development process…

Do you have specific steps to consistently reproduce the error? If you manage to do the same on the new app, it’d definitely help us find the cause and fix it. For now, we’re still looking into circumstances which could result in the error, but since the issue isn’t frequent among all the users it’s not prioritized enough to investigate deeper and usually the fix has to be manual.

I think it’s very easy to reproduce. You need to create a relation with some table and User table. Add some data, then delete all… It will fail when you try to add new data. It happened to me every time I did that. I can reproduce it for you when you gonna look into this issue.

I couldn’t reproduce this on a new app, here’s what I did:

    Created a test table "MyTable" Created a one-to-many relation from Users to MyTable Created a user in Users table Created 3 rows in MyTable table Added relation from the user in Users table to that 3 rows in MyTable table Checked and deleted 3 rows from MyTable table
..and no NullPointerException on login after that.

Have you tried the same steps on a new app? Or even if it only reproduces in your current app, can you please provide the exact steps similar to above?
Thanks in advance!

Thank you Sergey. I think what you are missing in your steps is to delete all the users as well. When I do that in my app I’m not able to create new user anymore. I’ll try to prepare so simple example for you.

BTW are you able to check where was the null pointer thrown in backendless backend? I think that would give you the final answer what was really wrong. I can reproduce it for you with my app if you need. Many thanks for your help.

Sure I can see where the NullPointerException happens, and I can also see that it’s caused by an inconsistency in the database. Thus I can add a special ignoring handler for NPE right on this line, but that would only hide the problem, not fix it.
Just recently I’ve been working on a fix for this same inconsistency but with a different use-case. That work is still in progress, but there is a possibility it might also fix your use-case.

Anyway, it would be very useful if we could investigate your specific use-case, too, and probably it would even help to find a better solution for that other problem I mentioned.
That said, if you could reproduce the error and describe the specific steps for that, it would really be of much help for us!

Hi Sergey, have you managed to reproduce it? As I said you have to clear user table as well to reproduce.

Hi Karol,

Actually I was expecting you to prepare the sample as you said in the post above…

Well I don’t really have the time. If I delete the users in my app it will be broken again and we are in the middle of the development…

Do you mind if I clone your application and try to remove all users on the cloned app? It would not break your current app

Perfect! If you have any questions let me know and I’ll try to help to reproduce.