Steeven Delucis
Steeven Delucis

Reputation: 352

com.google.firebase.FirebaseException: An internal error has occurred. [ 7: ]

I used to create accounts and connect to my application with firebase but then soon when I disconnected I couldn't create accounts. After 1h of that, I managed to create an account and when I disconnected to see if the problem was resolved, I realize that it's still there.

By doing task.getException() in case of account creation failure, I get this error: "com.google.firebase.FirebaseException: An internal error has occurred. [7:]" Do you have an idea of ​​the cause of the problem?

Upvotes: 3

Views: 5211

Answers (5)

Adi Azarya
Adi Azarya

Reputation: 4503

I have the same issue too. My application crashed on offline mode/airplane mode.

getIdToken returns the current token if it has not expired. Otherwise, this will refresh the token and return a new one, more info here

In my case, I called the getIdToken like this getIdToken(true) which means I force refresh regardless of token expiration. In my case call, getIdToken(false) like this solves the issue.

I have tested the offline mode/airplane mode and it works great.

Upvotes: 0

user12755203
user12755203

Reputation:

Here is how I solved the same issue: Opened a browser on my emulator, typed something and searched. After that, I came back to my app and retried to connect to firebase and everything started to work well.

The reason of the issue was probably the emulator not being able to connect to internet until I searched something in Google.

Upvotes: 0

Ojonugwa Jude Ochalifu
Ojonugwa Jude Ochalifu

Reputation: 27256

If you are sure you have an active Internet connection and you are testing from an Emulator, restart your emulator and it should work. Sometimes, the emulator disconnects from the Internet and these sort of problems occur.

Upvotes: 3

R R Rishvik
R R Rishvik

Reputation: 29

I have same problem because my internet was not active. Make sure you have active internet connection.

Upvotes: 3

Rob
Rob

Reputation: 1055

I had a similar issue and got the same exception and code: 7. I was calling firebaseUser.getIdToken() in a Rx stream. So while testing the apps functionality while being offline, I found that the JWT token that is returned in firebaseUser.getIdToken() had expired and was throwing said error. It has a lifetime of 1h.

So I split out my implementation to separate functions, only calling firebaseUser.getIdToken() before a authorised call, which must be done while online anyway to be sure and secure.

Without seeing any code, it seems you are signed in/keep a reference to a expired firebase token. Make sure you signed out properly from firebaseAuth before calling your "account creation" piece.

Upvotes: 1

Related Questions