Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "Client is offline" error reading from Realtime Database after upgrading to 11.0.0 #6390

Closed
Hivemind9000 opened this issue Jun 25, 2022 · 5 comments

Comments

@Hivemind9000
Copy link

Environment:

Firebase SDK version: 11.0.0
Firebase Product: database
Node.js version: 14

Problem:

After upgrading to 11.0.0 I started to get the error "Client is offline" when reading from the Realtime Database. The cloud function that threw the issue had not been changed for months. When I reverted back to 10.2.0 (the version I was on previously) the problem disappeared.

The relevant line of code was:

const sysCtlDS = await admin.database().ref('/system/directive/status').get();

I tried a solution from Stackoverflow, but instead of getting the "Client is offline" error, the cloud function just hung on that request and timed out.

const sysCtlDS = await admin.database().ref('/system/directive/status').once('value');

Any ideas as to why this is occurring?

@lahirumaramba
Copy link
Member

lahirumaramba commented Jun 27, 2022

Following are the changes in firebase/database packages from firebase-admin 10.2.0 to 11.0.0.
v10.2.0 firebase-admin:

"@firebase/database-compat": {
      "version": "0.1.8",
      "requires": {
        "@firebase/component": "0.5.13",
        "@firebase/database": "0.12.8",
        "@firebase/database-types": "0.9.7",
        "@firebase/logger": "0.3.2",
        "@firebase/util": "1.5.2",
        "tslib": "^2.1.0"
      },

v11.0.0 firebase-admin:

"@firebase/database-compat": {
      "version": "0.2.1",
      "requires": {
        "@firebase/component": "0.5.15",
        "@firebase/database": "0.13.1",
        "@firebase/database-types": "0.9.9",
        "@firebase/logger": "0.3.3",
        "@firebase/util": "1.6.1",
        "tslib": "^2.1.0"
      }
    },

@lahirumaramba lahirumaramba reopened this Jun 27, 2022
@lahirumaramba lahirumaramba transferred this issue from firebase/firebase-admin-node Jun 27, 2022
@lahirumaramba
Copy link
Member

Transferring to firebase/firebase-js-sdk

@maneesht
Copy link
Contributor

This may be fixed by #6340

@maneesht
Copy link
Contributor

@Hivemind9000 - can you please try this on the latest version of the admin SDK?

@Hivemind9000
Copy link
Author

Thanks @maneesht it seems to be working now (not hanging) using:

const sysCtlDS = await admin.database().ref('/system/directive/status').once('value');

firebase-admin 11.0.1
firebase-functions 3.22.0

@firebase firebase locked and limited conversation to collaborators Sep 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants