FIREBASE WARNING: Invalid query string segment - W

2019-03-25 08:00发布

问题:

This morning I started noticing a large amount of "FIREBASE WARNING: Invalid query string segment" errors in my functions log. In an attempt to figure out what was going on I ended up making various changes to function and deploying all my cloud functions several times.

While doing this I noticed that I was getting the error on a function that:

  1. Does not have a Firebase Query in it.
  2. Has not been invoked in months (it's a test function).

This leads me to believe that a change was made Firebase Cloud Functions recently that may be sporadically generating this error on deploy and/or execution of cloud functions regardless of whether the function has anything to do with real time database queries. Has anybody else noticed this error or have any insight into why it is occurring?

Relevant part of my cloud index.js file is as follows (should be enough to replicate the issue):

const cors = require('cors')({origin: true});
const functions = require('firebase-functions');
const admin = require('firebase-admin');

const firebaseRef = admin.database().ref();
const firestoreRef = admin.firestore();

exports.testCloudFunctions = functions.https.onRequest((request, response) => {
  cors(request, response, () => {
    const params = request.query;
    console.log(params)
    response.status(200).send({success: true, message: "Test Successful", params: params});
  });
});

回答1:

After talking with Firebase support, I learned this bug was introduced in the npm dependency @firebase/database: 0.1.10. You will have this dependency if you also have the latest firebase-admin dependency.

The warning

shouldn't have any impact on the function's overall processing.

If you want to remove the warning, you can force the npm dependency of @firebase/database: 0.1.9. I tested this adjustment and the warning was removed from my Firebase Console Logs.

The support agent also stated the fix has been made, but not released, so I would expect @firebase/database: 0.1.11+ to not experience this bug.



回答2:

Looks like a recently introduced bug which will hopefully be fixed soon.



回答3:

We having the same problem today. Maybe some maintenance in the platform. Maybe some Google dev will soon say something about this.



回答4:

It seems they are having issues with notification. You can check for the status here: https://status.firebase.google.com/



回答5:

I am new to Firebase today.

The code snippet I generated for the Firebase db connection had this firebase.js :

<script src="https://www.gstatic.com/firebasejs/4.10.0/firebase.js"></script>

This is generating the message : 'FIREBASE WARNING: Invalid query string segment:', but is also returning the data.

If I use a different version of firebase.js, either .../4.8.0/... or .../4.9.0/... , no error/warning message is generated.

I am running Google Chrome on Windows 10.



回答6:

Update: It's officially a bug and you can ignore it until they release a fix in the next update or add version of @firebase/database: 0.1.9 to dependencies if you don't want to wait.


Seems like an internal error or change. Also getting this firebase warning and my code was working fine yesterday using '' syntax as well. However my function still works. Looks like they're doing some heavy dev work on it as its in beta and issues are coming up now and then.

Wait for fix or report here: https://firebase.google.com/support/contact/bugs-features/

Status here (fixes usually take time to appear on here): https://status.firebase.google.com/

Copy of 48830081 and possibly 48832566