I followed this deno tutorial to create a simple web server that interacts with firebase.
I created a copy of my deno project here.
If I make an api call to the endpoint to /user-requests
, I get an error:
@firebase/firestore: Firestore (9.20.0): Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds.
This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
I use these rules for Firestore database:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write: if request.auth != null;
}
}
}
What is really strange I don't get this error for the copy of my deno project. I commented the rest of the code in my original deno project, but I am getting the error there.
How is it possible I am getting this error in one deno project, but I am not getting it in another deno project? Deno projects have the same source code and firebase projects configuration is the same.
Another question is why I am getting this error? I tried experimentalForceLongPolling
option, experimentalAutoDetectLongPolling
, and also this and nothing helped. Sometimes it's working, sometimes I am getting the error.
This is the output from debug-my.firebaseapp
[ 0.000s] [diagnostic]
********************************************************
[TEST 1/9: webchannel.googleapis.com with default options] STARTING at 2023-05-03T09:32:13.957Z]
********************************************************
[ 0.006s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] createWebChannel("https://webchannel.googleapis.com/staging/channel/generator", {"backgroundChannelTest":true,"httpSessionIdParam":"gsessionid","initMessageHeaders":{},"sendRawJson":true,"supportsCrossDomainXhr":true,"internalChannelParams":{"forwardChannelRequestTimeoutMs":600000},"httpHeadersOverwriteParam":"$httpHeaders","disableRedact":true})
[ 0.006s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] open()
[ 0.006s] [goog.labs.net.webChannel.WebChannelDebug] connect()
[ 0.007s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials enabled.
[ 0.007s] [goog.labs.net.webChannel.WebChannelDebug] connectChannel_()
[ 0.007s] [goog.labs.net.webChannel.WebChannelDebug] GetForwardChannelUri: https://webchannel.googleapis.com/staging/channel/generator?VER=8
[ 0.008s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] channel.send({"message":"Hello","message_size":0,"delay_ms":0,"num_messages":5,"message_interval":200,"server_send_raw":0,"server_close":0,"server_half_close":0,"shutdown_server":0})
[ 0.008s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials invoked: https://webchannel.googleapis.com/staging/channel/generator
[ 0.008s] [goog.labs.net.webChannel.WebChannelDebug] startForwardChannel_
[ 0.008s] [goog.labs.net.webChannel.WebChannelDebug] open_()
[ 0.009s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP REQ (16929) [attempt 1]: POST
https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=16929&CVER=22&X-HTTP-Session-Id=gsessionid&zx=ow14gob5mhvs&t=1
count=1&ofs=0&req0___data__=%7B%22message%22%3A%22Hello%22%2C%22message_size%22%3A0%2C%22delay_ms%22%3A0%2C%22num_messages%22%3A5%2C%22message_interval%22%3A200%2C%22server_send_raw%22%3A0%2C%22server_close%22%3A0%2C%22server_half_close%22%3A0%2C%22shutdown_server%22%3A0%7D
[ 19.954s] [goog.labs.net.webChannel.WebChannelDebug] No response text for uri https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=16929&CVER=22&X-HTTP-Session-Id=gsessionid&zx=ow14gob5mhvs&t=1 status 0
[ 19.955s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP RESP (16929) [ attempt 1]: POST
https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=16929&CVER=22&X-HTTP-Session-Id=gsessionid&zx=ow14gob5mhvs&t=1
4 0
[ 19.956s] [diagnostic] RequestStat event: 13
[ 19.956s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP Bad status 0 (16929)
[ 19.957s] [goog.labs.net.webChannel.WebChannelDebug] Request complete
[ 19.957s] [goog.labs.net.webChannel.WebChannelDebug] Maybe retrying, last error: Non-200 return code (0)
[ 19.957s] [goog.labs.net.webChannel.WebChannelDebug] Exceeded max number of retries
[ 19.958s] [goog.labs.net.webChannel.WebChannelDebug] Error: HTTP request failed
[ 19.958s] [goog.labs.net.webChannel.WebChannelDebug] Error code 2
[ 19.958s] [goog.labs.net.webChannel.WebChannelDebug] TestLoadImage: loading https://www.google.com/images/cleardot.gif?zx=5gkge2f6thcv
[ 19.959s] [goog.labs.net.webChannel.WebChannelDebug] HttpChannel: error - 2
[ 19.959s] [goog.labs.net.webChannel.WebChannelBaseTransport] WebChannel aborted on https://webchannel.googleapis.com/staging/channel/generator due to channel error: 2
[ 19.959s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] channel error: 1
[ 19.959s] [goog.labs.net.webChannel.WebChannelDebug] Number of undelivered maps, pending: 1, outgoing: 0
[ 19.959s] [goog.labs.net.webChannel.WebChannelBaseTransport] WebChannel closed on https://webchannel.googleapis.com/staging/channel/generator
[ 19.960s] [diagnostic] >>> [TEST 1/9: webchannel.googleapis.com with default options] channel closed
[ 19.960s] [diagnostic]
********************************************************
Channel closed before test finished.
********************************************************
[ 20.026s] [goog.labs.net.webChannel.WebChannelDebug] TestLoadImage: loaded
[ 20.026s] [goog.labs.net.webChannel.WebChannelDebug] Successfully pinged google.com
[ 20.026s] [diagnostic] RequestStat event: 2
[ 21.462s] [diagnostic]
********************************************************
[TEST 2/9: webchannel.googleapis.com with detectBufferingProxy] STARTING at 2023-05-03T09:32:35.419Z]
********************************************************
[ 21.464s] [diagnostic] >>> [TEST 2/9: webchannel.googleapis.com with detectBufferingProxy] createWebChannel("https://webchannel.googleapis.com/staging/channel/generator", {"backgroundChannelTest":true,"httpSessionIdParam":"gsessionid","initMessageHeaders":{},"sendRawJson":true,"supportsCrossDomainXhr":true,"internalChannelParams":{"forwardChannelRequestTimeoutMs":600000},"httpHeadersOverwriteParam":"$httpHeaders","disableRedact":true,"detectBufferingProxy":true})
[ 21.465s] [diagnostic] >>> [TEST 2/9: webchannel.googleapis.com with detectBufferingProxy] open()
[ 21.466s] [goog.labs.net.webChannel.WebChannelDebug] connect()
[ 21.466s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials enabled.
[ 21.466s] [diagnostic] RequestStat event: 0
[ 21.466s] [goog.labs.net.webChannel.WebChannelDebug] connectChannel_()
[ 21.467s] [goog.labs.net.webChannel.WebChannelDebug] GetForwardChannelUri: https://webchannel.googleapis.com/staging/channel/generator?VER=8
[ 21.467s] [diagnostic] >>> [TEST 2/9: webchannel.googleapis.com with detectBufferingProxy] channel.send({"message":"Hello","message_size":0,"delay_ms":0,"num_messages":5,"message_interval":200,"server_send_raw":0,"server_close":0,"server_half_close":0,"shutdown_server":0})
[ 21.468s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials invoked: https://webchannel.googleapis.com/staging/channel/generator
[ 21.468s] [goog.labs.net.webChannel.WebChannelDebug] startForwardChannel_
[ 21.468s] [goog.labs.net.webChannel.WebChannelDebug] open_()
[ 21.470s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP REQ (60189) [attempt 1]: POST
https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=60189&CVER=22&X-HTTP-Session-Id=gsessionid&zx=j2g22vcbmfw&t=1
count=1&ofs=0&req0___data__=%7B%22message%22%3A%22Hello%22%2C%22message_size%22%3A0%2C%22delay_ms%22%3A0%2C%22num_messages%22%3A5%2C%22message_interval%22%3A200%2C%22server_send_raw%22%3A0%2C%22server_close%22%3A0%2C%22server_half_close%22%3A0%2C%22shutdown_server%22%3A0%7D
[ 41.336s] [goog.labs.net.webChannel.WebChannelDebug] No response text for uri https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=60189&CVER=22&X-HTTP-Session-Id=gsessionid&zx=j2g22vcbmfw&t=1 status 0
[ 41.336s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP RESP (60189) [ attempt 1]: POST
https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=60189&CVER=22&X-HTTP-Session-Id=gsessionid&zx=j2g22vcbmfw&t=1
4 0
[ 41.337s] [diagnostic] RequestStat event: 13
[ 41.337s] [diagnostic] RequestStat event: 13
[ 41.337s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP Bad status 0 (60189)
[ 41.337s] [goog.labs.net.webChannel.WebChannelDebug] Request complete
[ 41.337s] [goog.labs.net.webChannel.WebChannelDebug] Maybe retrying, last error: Non-200 return code (0)
[ 41.337s] [goog.labs.net.webChannel.WebChannelDebug] Exceeded max number of retries
[ 41.338s] [goog.labs.net.webChannel.WebChannelDebug] Error: HTTP request failed
[ 41.338s] [goog.labs.net.webChannel.WebChannelDebug] Error code 2
[ 41.338s] [goog.labs.net.webChannel.WebChannelDebug] TestLoadImage: loading https://www.google.com/images/cleardot.gif?zx=2mkiby1wph8f
[ 41.338s] [goog.labs.net.webChannel.WebChannelDebug] HttpChannel: error - 2
[ 41.338s] [goog.labs.net.webChannel.WebChannelBaseTransport] WebChannel aborted on https://webchannel.googleapis.com/staging/channel/generator due to channel error: 2
[ 41.338s] [diagnostic] >>> [TEST 2/9: webchannel.googleapis.com with detectBufferingProxy] channel error: 1
[ 41.338s] [goog.labs.net.webChannel.WebChannelDebug] Number of undelivered maps, pending: 1, outgoing: 0
[ 41.338s] [goog.labs.net.webChannel.WebChannelBaseTransport] WebChannel closed on https://webchannel.googleapis.com/staging/channel/generator
[ 41.339s] [diagnostic] >>> [TEST 2/9: webchannel.googleapis.com with detectBufferingProxy] channel closed
[ 41.339s] [diagnostic]
********************************************************
Channel closed before test finished.
********************************************************
[ 41.371s] [goog.labs.net.webChannel.WebChannelDebug] TestLoadImage: loaded
[ 41.371s] [goog.labs.net.webChannel.WebChannelDebug] Successfully pinged google.com
[ 41.371s] [diagnostic] RequestStat event: 2
[ 41.371s] [diagnostic] RequestStat event: 2
[ 43.483s] [diagnostic]
********************************************************
[TEST 3/9: webchannel.googleapis.com with forceLongPolling] STARTING at 2023-05-03T09:32:57.440Z]
********************************************************
[ 43.484s] [diagnostic] >>> [TEST 3/9: webchannel.googleapis.com with forceLongPolling] createWebChannel("https://webchannel.googleapis.com/staging/channel/generator", {"backgroundChannelTest":true,"httpSessionIdParam":"gsessionid","initMessageHeaders":{},"sendRawJson":true,"supportsCrossDomainXhr":true,"internalChannelParams":{"forwardChannelRequestTimeoutMs":600000},"httpHeadersOverwriteParam":"$httpHeaders","disableRedact":true,"forceLongPolling":true})
[ 43.484s] [diagnostic] >>> [TEST 3/9: webchannel.googleapis.com with forceLongPolling] open()
[ 43.484s] [goog.labs.net.webChannel.WebChannelDebug] connect()
[ 43.485s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials enabled.
[ 43.485s] [diagnostic] RequestStat event: 0
[ 43.485s] [diagnostic] RequestStat event: 0
[ 43.485s] [goog.labs.net.webChannel.WebChannelDebug] connectChannel_()
[ 43.485s] [goog.labs.net.webChannel.WebChannelDebug] GetForwardChannelUri: https://webchannel.googleapis.com/staging/channel/generator?VER=8
[ 43.485s] [diagnostic] >>> [TEST 3/9: webchannel.googleapis.com with forceLongPolling] channel.send({"message":"Hello","message_size":0,"delay_ms":0,"num_messages":5,"message_interval":200,"server_send_raw":0,"server_close":0,"server_half_close":0,"shutdown_server":0})
[ 43.485s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials invoked: https://webchannel.googleapis.com/staging/channel/generator
[ 43.486s] [goog.labs.net.webChannel.WebChannelDebug] startForwardChannel_
[ 43.486s] [goog.labs.net.webChannel.WebChannelDebug] open_()
[ 43.486s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP REQ (79636) [attempt 1]: POST
https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=79636&CVER=22&X-HTTP-Session-Id=gsessionid&zx=xwh5osvk80lb&t=1
count=1&ofs=0&req0___data__=%7B%22message%22%3A%22Hello%22%2C%22message_size%22%3A0%2C%22delay_ms%22%3A0%2C%22num_messages%22%3A5%2C%22message_interval%22%3A200%2C%22server_send_raw%22%3A0%2C%22server_close%22%3A0%2C%22server_half_close%22%3A0%2C%22shutdown_server%22%3A0%7D
[ 63.345s] [goog.labs.net.webChannel.WebChannelDebug] No response text for uri https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=79636&CVER=22&X-HTTP-Session-Id=gsessionid&zx=xwh5osvk80lb&t=1 status 0
[ 63.347s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP RESP (79636) [ attempt 1]: POST
https://webchannel.googleapis.com/staging/channel/generator?VER=8&RID=79636&CVER=22&X-HTTP-Session-Id=gsessionid&zx=xwh5osvk80lb&t=1
4 0
[ 63.348s] [diagnostic] RequestStat event: 13
[ 63.349s] [diagnostic] RequestStat event: 13
[ 63.349s] [diagnostic] RequestStat event: 13
[ 63.349s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP Bad status 0 (79636)
[ 63.349s] [goog.labs.net.webChannel.WebChannelDebug] Request complete
[ 63.350s] [goog.labs.net.webChannel.WebChannelDebug] Maybe retrying, last error: Non-200 return code (0)
[ 63.350s] [goog.labs.net.webChannel.WebChannelDebug] Exceeded max number of retries
[ 63.350s] [goog.labs.net.webChannel.WebChannelDebug] Error: HTTP request failed
[ 63.350s] [goog.labs.net.webChannel.WebChannelDebug] Error code 2
[ 63.351s] [goog.labs.net.webChannel.WebChannelDebug] TestLoadImage: loading https://www.google.com/images/cleardot.gif?zx=5gpyxapaqw36
[ 63.351s] [goog.labs.net.webChannel.WebChannelDebug] HttpChannel: error - 2
[ 63.351s] [goog.labs.net.webChannel.WebChannelBaseTransport] WebChannel aborted on https://webchannel.googleapis.com/staging/channel/generator due to channel error: 2
[ 63.352s] [diagnostic] >>> [TEST 3/9: webchannel.googleapis.com with forceLongPolling] channel error: 1
[ 63.352s] [goog.labs.net.webChannel.WebChannelDebug] Number of undelivered maps, pending: 1, outgoing: 0
[ 63.352s] [goog.labs.net.webChannel.WebChannelBaseTransport] WebChannel closed on https://webchannel.googleapis.com/staging/channel/generator
[ 63.352s] [diagnostic] >>> [TEST 3/9: webchannel.googleapis.com with forceLongPolling] channel closed
[ 63.353s] [diagnostic]
********************************************************
Channel closed before test finished.
********************************************************
[ 63.390s] [goog.labs.net.webChannel.WebChannelDebug] TestLoadImage: loaded
[ 63.391s] [goog.labs.net.webChannel.WebChannelDebug] Successfully pinged google.com
[ 63.391s] [diagnostic] RequestStat event: 2
[ 63.391s] [diagnostic] RequestStat event: 2
[ 63.392s] [diagnostic] RequestStat event: 2
[ 65.239s] [diagnostic]
********************************************************
[TEST 4/9: webchannel.sandbox.google.com with default options] STARTING at 2023-05-03T09:33:19.196Z]
********************************************************
[ 65.241s] [diagnostic] >>> [TEST 4/9: webchannel.sandbox.google.com with default options] createWebChannel("https://webchannel.sandbox.google.com/staging/channel/generator", {"backgroundChannelTest":true,"httpSessionIdParam":"gsessionid","initMessageHeaders":{},"sendRawJson":true,"supportsCrossDomainXhr":true,"internalChannelParams":{"forwardChannelRequestTimeoutMs":600000},"httpHeadersOverwriteParam":"$httpHeaders","disableRedact":true})
[ 65.242s] [diagnostic] >>> [TEST 4/9: webchannel.sandbox.google.com with default options] open()
[ 65.243s] [goog.labs.net.webChannel.WebChannelDebug] connect()
[ 65.243s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials enabled.
[ 65.243s] [diagnostic] RequestStat event: 0
[ 65.243s] [diagnostic] RequestStat event: 0
[ 65.244s] [diagnostic] RequestStat event: 0
[ 65.244s] [goog.labs.net.webChannel.WebChannelDebug] connectChannel_()
[ 65.244s] [goog.labs.net.webChannel.WebChannelDebug] GetForwardChannelUri: https://webchannel.sandbox.google.com/staging/channel/generator?VER=8
[ 65.244s] [diagnostic] >>> [TEST 4/9: webchannel.sandbox.google.com with default options] channel.send({"message":"Hello","message_size":0,"delay_ms":0,"num_messages":5,"message_interval":200,"server_send_raw":0,"server_close":0,"server_half_close":0,"shutdown_server":0})
[ 65.244s] [goog.labs.net.webChannel.WebChannelDebug] Origin Trials invoked: https://webchannel.sandbox.google.com/staging/channel/generator
[ 65.244s] [goog.labs.net.webChannel.WebChannelDebug] startForwardChannel_
[ 65.245s] [goog.labs.net.webChannel.WebChannelDebug] open_()
[ 65.245s] [goog.labs.net.webChannel.WebChannelDebug] XMLHTTP REQ (5003) [attempt 1]: POST
https://webchannel.sandbox.google.com/staging/channel/generator?VER=8&RID=5003&CVER=22&X-HTTP-Session-Id=gsessionid&zx=5a6p42fbn0x4&t=1
count=1&ofs=0&req0___data__=%7B%22message%22%3A%22Hello%22%2C%22message_size%22%3A0%2C%22delay_ms%22%3A0%2C%22num_messages%22%3A5%2C%22message_interval%22%3A200%2C%22server_send_raw%22%3A0%2C%22server_close%22%3A0%2C%22server_half_close%22%3A0%2C%22shutdown_server%22%3A0%7D
edit:// seems like this issue is deno related, because I don't have this issue when I deployed my back-end in aws.