paulgio
paulgio

Reputation: 712

Firebase Realtime Database stopped working

For the past month or so I have been developing an app with Firebase's Real-time Database. It has been working great until today. For some reason, the database querying stopped working entirely. The authentication (email and password login, create an account, forgot password) all seem to work fine but for some reason, my app cannot retrieve the Firebase data.

Keep in mind that it was working for a whole month and I have changed nothing.

I even went to previous builds of my app to test them out. They worked when tested and they also cannot connect to the database. Has anybody ever faced this problem before and if so how did you manage to fix it?

This is my code by the way but it was working moments ago so I doubt anything is wrong with it.

var firebaseResponse = firebase.database().ref().orderByChild("country").equalTo(country)

fireBaseResponse.once('value').then(snapshot => {

snapshot.forEach(item => {
    const temp = item.val();
    data1.push(temp);
});

Upvotes: 2

Views: 2104

Answers (3)

Arif Hasan
Arif Hasan

Reputation: 1

Follow these steps... Realtime Database-->Rules--> just change read : true and write : true. Written below..

 ".read": true,
  ".write": true

It worked for me.

Upvotes: 0

Rohit Singh
Rohit Singh

Reputation: 18202

Weird timestamp rule in Firebase console

I faced a similar problem in one of my projects. It was loading data since yesterday but today it does not return anything.

I don't know how but this weird timestamp rule got added by default when I created the rule in my Firebase project.

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if request.time < timestamp.date(2020,8, 22);
    }
  }
}

So I just removed the request.time < timestamp.date(2020,8, 22) rule and replaced it with this.

allow read, write: if true;

Note:

allow read, write: if true; make your database public for read/write request. Add some security rules. 

Funny note:

I was pretty sure that the problem was with my service.json file. So I checked everything but the rules because firebase does not add timestamp rule by default. Maybe I copied the rule from somewhere.

How did I figure out this?

By luck and by logcat.

When I deep dived into logcat I found this warning message

[Firestore]: Listen for Query(deck_collection order by name) failed: Status{code=PERMISSION_DENIED, description=Missing or insufficient permissions., cause=null}

Upvotes: 0

Diego P
Diego P

Reputation: 1758

There was a Firebase service disruption started today at 12:20 (US/Pacific). For more info you can track Firebase Status here

Upvotes: 4

Related Questions