Support Topics Documentation Slack YouTube Blog

Null point exception when trying to log in

(Karol Domagala) #1

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

(Stanislaw Grin) #2

Hi Karol,

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

(Karol Domagala) #3

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.

(Sergey Chupov) #4

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

(Karol Domagala) #5

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…

(Sergey Chupov) #6

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.

(Karol Domagala) #7

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.

(Sergey Chupov) #8

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!

(Karol Domagala) #9

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.

(Sergey Chupov) #10

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!

(Karol Domagala) #11

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

(Sergey Chupov) #12

Hi Karol,

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

(Karol Domagala) #13

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…

(Sergey Kukurudzyak) #14

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

(Karol Domagala) #15

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