-
Notifications
You must be signed in to change notification settings - Fork 927
@firebase/firestore: Firestore (9.16.0): Connection WebChannel transport errored #6993
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
Comments
Please enable debug logging, reproduce the issue, and attach the full logs. To enable debug logging, call https://firebase.google.com/docs/reference/js/firestore_#setloglevel |
Also, please browse to https://debug-my.firebaseapp.com/ in the same browser/device that is having the problem and attach the output as a gist. This could help identify the protocol layer where the problem is occurring. |
i am also facing the same issue. |
I'm also have the same issue on 9.17.1 version: @firebase/firestore: Firestore (9.17.0): Connection WebChannel transport errored Please, I have very important project and watch the logs (wich display timeout null with no explanation) solves nothing... Thanks a lot, a big user of firebase/firestore |
*9.17.0 version |
I solved my error by re initializing my project |
@urlsab and @Malik-Usman17 Please capture logs as requested in my previous comments #6993 (comment) and #6993 (comment). |
For dconeybe as requested : (i copied what seems to be relevant) [ 1.425s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP Bad status 418 (14597) 1: webchannel.googleapis.com with default options: FAILED (1430ms) those are the logs before even i made some action in my project when i register - the auth of firebase works fine but firestore db has no respne or respone after long time in chrome console's i'm getting this : react_devtools_backend.js:4012 [2023-02-09T13:35:36.626Z] @firebase/firestore: Firestore (9.17.1): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds. but my internet connection is greate... for Lunar-Fang-coder : how to re-initialized it ? |
@urlsab Thanks for the logs. You are definitely having connectivity issues with the Firestore backend. Could you paste the entire output from https://debug-my.firebaseapp.com/ to https://gist.github.com/ and put the link here? Seeing the entire log will help diagnose. |
Just for comparison, here is what I see from https://debug-my.firebaseapp.com/ which indicates a healthy connection to the Firestore backend:
https://gist.github.com/dconeybe/f2618055cef2e8b90524976b013923d3 |
I couldn't find the way to enable debug logging in react-native project , I am still trying to figuring out how to do it, any help from anyone ??? |
Thanks for the response. Yes, i will send you the entire logs.
|
(edited by @dconeybe - I've moved most of the logs to a GitHub Gist: https://gist.github.com/dconeybe/016dd821eb5fae7d3e760a8cdb0a8db0. This makes the comment thread of this issue shorter and easier to navigate)
|
thanks a lot. now what ? |
@urlsab I'll take a closer look at your logs today or tomorrow. I'll ask my team for help if that doesn't prove fruitful. Then, I may ask for more information from you or suggest a workaround. |
Sounds good, thanks!
בתאריך יום ב׳, 13 בפבר׳ 2023, 16:38, מאת Denver Coneybeare <
***@***.***>:
… @urlsab <https://github.com/urlsab> I'll take a closer look at your logs
today or tomorrow. I'll ask my team for help if that doesn't prove
fruitful. Then, I may ask for more information from you or suggest a
workaround.
—
Reply to this email directly, view it on GitHub
<#6993 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASLT57ZU43QE7CY2ZZ3O3LLWXJBQFANCNFSM6AAAAAAUMD5RDI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
So ? Any conclusion ?
בתאריך יום ב׳, 13 בפבר׳ 2023 ב-20:21 מאת יאיר סבג ***@***.***
>:
… Sounds good, thanks!
בתאריך יום ב׳, 13 בפבר׳ 2023, 16:38, מאת Denver Coneybeare <
***@***.***>:
> @urlsab <https://github.com/urlsab> I'll take a closer look at your logs
> today or tomorrow. I'll ask my team for help if that doesn't prove
> fruitful. Then, I may ask for more information from you or suggest a
> workaround.
>
> —
> Reply to this email directly, view it on GitHub
> <#6993 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ASLT57ZU43QE7CY2ZZ3O3LLWXJBQFANCNFSM6AAAAAAUMD5RDI>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
What if the issue is my rules file ? My date was 12.2.2023..how can i
define it again ?
בתאריך יום ד׳, 15 בפבר׳ 2023 ב-8:17 מאת יאיר סבג ***@***.***
>:
… So ? Any conclusion ?
בתאריך יום ב׳, 13 בפבר׳ 2023 ב-20:21 מאת יאיר סבג <
***@***.***>:
> Sounds good, thanks!
>
> בתאריך יום ב׳, 13 בפבר׳ 2023, 16:38, מאת Denver Coneybeare <
> ***@***.***>:
>
>> @urlsab <https://github.com/urlsab> I'll take a closer look at your
>> logs today or tomorrow. I'll ask my team for help if that doesn't prove
>> fruitful. Then, I may ask for more information from you or suggest a
>> workaround.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#6993 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/ASLT57ZU43QE7CY2ZZ3O3LLWXJBQFANCNFSM6AAAAAAUMD5RDI>
>> .
>> You are receiving this because you were mentioned.Message ID:
>> ***@***.***>
>>
>
|
You are getting the strangest error I've ever seen: HTTP 418 "I'm a teapot" https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418 Is there perhaps a proxy between your device and Firestore that may be refusing the requests and returning the failed HTTP status 418? Also, please test your app AND browse to https://debug-my.firebaseapp.com/ in the following environments (if possible):
Please reply with the information in a table like this:
|
Yes, I have an app on my pc called netfree that filters dirty content from
the web.
I've already used the debug test tool you gave me, so there's no
necessary to test again on 4 environment you mentioned
I think I should check my app on a pc that doesn't have netfree and see if
it works there. If it's still stock - the issue is not because netfree.
Thanks a lot
בתאריך יום ד׳, 15 בפבר׳ 2023 ב-19:13 מאת Denver Coneybeare <
***@***.***>:
… You are getting the strangest error I've ever seen: HTTP 418 "I'm a teapot"
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418
Is there perhaps a proxy between your device and Firestore that may be
refusing the requests and returning the failed HTTP status 418?
Also, please test your app AND browse to https://debug-my.firebaseapp.com/
in the following environments (if possible):
1. iOS real device
2. iOS simulator
3. Android real device
4. Android emulator
Please reply with the information in a table like this:
Environment App behavior debug-my.firebaseapp.com behavior
iOS real device worked worked
iOS simulator Connection WebChannel transport errored HTTP 418
Android real device ... ...
Android emulator ... ...
—
Reply to this email directly, view it on GitHub
<#6993 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASLT57YVZQTZESHJKMJOVQDWXUFD7ANCNFSM6AAAAAAUMD5RDI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Update: @Malik-Usman17 pointed out that you are not the OP. Sorry for getting that mixed up. For posterity, I've left my original comment intact below. @urlsab In the opening comment, you mention that "I am running my app on real device (not emulator)" so some software running on your computer shouldn't affect the behavior on a real device, right? Also, what kind of "device" were you using (Android, iPhone)? Do you see this problem on the emulator/simulator as well as a real device? I realize it will be a bit of work to put together the table that I asked for in a previous comment but that will greatly help narrow down the scope of the problem. As it is, all I see so far is that you get some confusing connectivity error and I'm trying to narrow down the source of the error to focus the investigation. And the debug web page may produce different results on the real devices and emulators, which will be useful information to help narrow down the problem. In any case, I'll try to work with whatever information you're able to provide. |
Infact that was me, that said it about the real device, I was running my app on android real device. And can you please help in that below my comment
|
@Malik-Usman17 Oh you're right. I got the users mixed up. Thanks for correcting that. When you say "I couldn't find the way to enable debug logging in react-native project" could you be more specific? Are you not able to invoke the My colleague who is more familiar with react-native than me pointed out two potentially-useful resources. If the problem is that you enable debug logging but don't see any logs, it appears that there was a range of react-native versions that failed to emit debug logs. If you're using RN 61+ then you should be good in this respect (https://stackoverflow.com/questions/46417066/react-native-console-debug-does-not-show-log-using-log-ios) Another salient point is you have to use |
@urlsab I think that your issue is distinct from that reported by the OP. They have the same generic error but apparently different root causes. To avoid conflating two issues in this GitHub issue, please open a new issue for your problem. The information you provide in the new issue template will also be quite enlightening. Feel free to @mention me and I'll continue working with you. |
I solved this error, but I didn't understand the core concept about it , well what I did it earlier were: `import { initializeApp } from "firebase/app"; const firebaseConfig = { const app = initializeApp(firebaseConfig); export { db, auth }` So well somehow I find the solution and then turned my above firebase config file code the this: const firebaseConfig = { const app = initializeApp(firebaseConfig); const auth = getAuth(app) const db = initializeFirestore(app, { export { db, auth };` and it worked it, now I'm making the collection, adding the documents in a collection, getting documents or collections from firestore database all things working fine now. |
I changed firebase.js the same way as Malik-Usman17 and it worked. thanks |
Just copy my issue to a new one?
And i hope muhamad solution will work also for me
בתאריך יום ו׳, 17 בפבר׳ 2023, 19:18, מאת Denver Coneybeare <
***@***.***>:
… @urlsab <https://github.com/urlsab> I think that your issue is distinct
from that reported by the OP. They have the same generic error but
apparently different root causes. To avoid conflating two issues in this
GitHub issue, please open a new issue for your problem. The information you
provide in the new issue template will also be quite enlightening. Feel
free to @mention me and I'll continue working with you.
—
Reply to this email directly, view it on GitHub
<#6993 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASLT57YVPIQ74PPZACSSYMLWX6XIDANCNFSM6AAAAAAUMD5RDI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Amazing !!! @Malik-Usman17 solution is working !!! so it's not a problem in my machine or 3rd party.... Now we need to understand how simple method update changed all ?...and why it's not in firebase docs ? |
Well I have a same question that I didn't find this on officical firebase docs |
Oh wow I would not have expected long polling to fix your issues. Good find! There must be a proxy between your apps and the Firestore servers that behaves in a way that we are not accustomed to. For full details about long polling, see #1674. But here is the summary: normally Firestore clients open a long-lived connection with the Firestore server over HTTP port 80. This usually works; however, some proxy servers don't play well with long-lived HTTP connections. Long polling works around this by opening a new connection every 30 seconds to emulate a long-lived connection. So long polling is less efficient, but it is the only workaround we have for this problem, and it works quite well. You can visually see the long polling if you open up the "network" tab of chrome (e.g. #1674 (comment)) as a new connection will open every 30 seconds. Since everyone has reported that their presenting issues have been fixed by enabling long polling, I'm going to close this issue. Let me know if you think this issue should remain open. |
I had the same issue, and it took me quite a while before I found this issue post. I'm using Expo, and the standard config works fine with ExpoGo. However, it started throwing "Could not reach Cloud Firestore backend" when I use Expo development build. The strange part is some Firestore api work while some don't. For those that didn't work, I had "Connection WebChannel transport errored", that led me to this post. Thanks to @Malik-Usman17, I can move on. I hope this can be put in the java SDK documentation. |
I encountered this issue again and have a minimal reproduction code available. It might have todo with the underlying network stack of the machine you are on? If I run my react code on the iOS simulator in the browser it also works. Update: BUT, when I use the debugger in chrome, it finally starts working (with experimentalForceLongPolling set to true, not without though) using react-native 0.71.3 and firestore 9.17.2 |
Before you close this issue, please update the docs of firestore. thanks |
Hey @dconeybe, I am still having that issue even after setting the property experimentalForceLongPolling to true. |
Hi chetan-2002, want to show us part of your code? maybe it comes from other parts in your app... |
@chetan-2002 Please open a new GitHub issue with your specific issue, logs, sdk versions, etc. |
I am integrating the firebase with my react-native app, when I am adding the document, it give me this warning and didn't add the document.
@firebase/firestore: Firestore (9.16.0): Connection WebChannel transport errored: {"defaultPrevented": false, "g": {"A": true, "J": null, "R": [Circular], "g": {"$": true, "$a": 5000, "A": 3, "B": null, "C": 0, "Ca": "1hJW6YGvkRCHMzXfdmutYXfxVzcgGjoWTwnPDvMNTgI", "D": "gsessionid", "Ea": -1, "F": [U], "Fa": 12, "G": 0, "Ga": false, "H": true, "Ia": [ud], "J": "B8CDx_gBqjeTEQ67byhG9A", "K": 45000, "L": false, "M": true, "O": true, "P": false, "R": 0, "U": [Object], "V": 0, "W": 53269, "Y": "https://firestore.googleapis.com/google.firestore.v1.Firestore/Write/channel", "aa": 4, "ab": false, "ba": false, "bb": false, "cb": 2, "eb": 1, "fb": 10000, "g": null, "h": [pd], "i": [Array], "j": [Sb], "l": [Z], "la": [Object], "m": null, "ma": undefined, "na": "", "o": null, "oa": null, "pa": 8, "s": null, "sa": -1, "u": null, "ua": undefined, "v": null, "va": [U], "wa": 600000}, "h": {"database": "projects/fir-auth-7be2f/databases/(default)"}, "i": {"g": [Object], "h": 4, "src": [Circular]}, "j": {"g": [Circular]}, "l": "https://firestore.googleapis.com/google.firestore.v1.Firestore/Write/channel", "o": undefined, "s": false, "v": true}, "status": 1, "target": {"A": true, "J": null, "R": [Circular], "g": {"$": true, "$a": 5000, "A": 3, "B": null, "C": 0, "Ca": "1hJW6YGvkRCHMzXfdmutYXfxVzcgGjoWTwnPDvMNTgI", "D": "gsessionid", "Ea": -1, "F": [U], "Fa": 12, "G": 0, "Ga": false, "H": true, "Ia": [ud], "J": "B8CDx_gBqjeTEQ67byhG9A", "K": 45000, "L": false, "M": true, "O": true, "P": false, "R": 0, "U": [Object], "V": 0, "W": 53269, "Y": "https://firestore.googleapis.com/google.firestore.v1.Firestore/Write/channel", "aa": 4, "ab": false, "ba": false, "bb": false, "cb": 2, "eb": 1, "fb": 10000, "g": null, "h": [pd], "i": [Array], "j": [Sb], "l": [Z], "la": [Object], "m": null, "ma": undefined, "na": "", "o": null, "oa": null, "pa": 8, "s": null, "sa": -1, "u": null, "ua": undefined, "v": null, "va": [U], "wa": 600000}, "h": {"database": "projects/fir-auth-7be2f/databases/(default)"}, "i": {"g": [Object], "h": 4, "src": [Circular]}, "j": {"g": [Circular]}, "l": "https://firestore.googleapis.com/google.firestore.v1.Firestore/Write/channel", "o": undefined, "s": false, "v": true}, "type": "c"}
Here is my config.js file code:
`import { initializeApp } from "firebase/app";
import { getFirestore } from "firebase/firestore";
import { getAuth } from "firebase/auth";
const firebaseConfig = {
apiKey: "my_project_api_key",
authDomain: "fir-auth-7be2f.firebaseapp.com",
projectId: "fir-auth-7be2f",
storageBucket: "fir-auth-7be2f.appspot.com",
messagingSenderId: "180812418171",
appId: "1:180812418171:web:88c2ff1f9e363ede8066de"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const auth = getAuth(app)
const db = getFirestore(app);
export { db, auth };
`
My Project Versions are:
firebase: "^9.16.0"
react: "18.2.0",
react-native: "0.71.0"
One thing to note that I am running my app on real device (not emulator) while coding and using cli.
The text was updated successfully, but these errors were encountered: