running chirpstack after a whole night, i found all the uplink data was lost from yesterday night (the webUI show the gateway last seem at yesterday night); i check my network and it is available.
my devices are trigger with schedule uplink, it seems like just suddenly disconnected.
i restart gateway but cannot connect to chirpstack, i try restart chirpstack docker and finally it connected.
could anyone tell me what happened?
here are the docker logs from chirpstack docker(at midnight)
I seem to have encountered the same issue. Running chirpstack v4 using a slightly modified docker compose (but no changes to the redis section), overnight it looks like chirpstack lost connection to⌠something - perhaps redis? Everything was proceeding as normal, and then all of a sudden we start to see timeout errors. No other logs show anything strange at that time.
chirpstack-docker-redis-1 | 1:M 21 Sep 2022 01:43:18.077 * Background saving terminated with success
chirpstack-docker-redis-1 | 1:M 21 Sep 2022 01:59:15.864 * 100 changes in 300 seconds. Saving...
chirpstack-docker-redis-1 | 1:M 21 Sep 2022 01:59:15.864 * Background saving started by pid 61
chirpstack-docker-redis-1 | 61:C 21 Sep 2022 01:59:15.872 * DB saved on disk
chirpstack-docker-redis-1 | 61:C 21 Sep 2022 01:59:15.872 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
chirpstack-docker-redis-1 | 1:M 21 Sep 2022 01:59:15.965 * Background saving terminated with success
chirpstack-docker-redis-1 | 1:M 21 Sep 2022 02:59:16.075 * 1 changes in 3600 seconds. Saving...
chirpstack-docker-redis-1 | 1:M 21 Sep 2022 02:59:16.075 * Background saving started by pid 62
chirpstack-docker-redis-1 | 62:C 21 Sep 2022 02:59:16.082 * DB saved on disk
chirpstack-docker-redis-1 | 62:C 21 Sep 2022 02:59:16.082 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
chirpstack-docker-redis-1 | 1:M 21 Sep 2022 02:59:16.177 * Background saving terminated with success
UPDATE: it appears that restarting redis (docker compose restart redis) allowed chirpstack to reconnect, but itâs still somewhat concerning.
I was able to connect to redis while this issue was happening, and it didnât look like there was anything going on that would have caused the timeout. I see that there are 100 open redis connections that are made between chirpstack and redis, but this doesnât seem to be bumping up against any limits as far as I can tell.
i try to restart chirpstack itself (docker compose restart chirpstack) will reconnect success, but i keep facing the same problem from chirpstack v4; no matter in rc version or v4 release version.
i try to use redis locally(not in chirpstack docker, on my local machine), the problem still occuried.
i donât have any idea to deal with.
my test env:
I have two gateways, two devices, connect to a chirpstack instance, but the two devices send at high frequency (about 5s once), after a night I can see about 228 devaddrs in redis.
@brocaar Maybe you have some more insights into how redis is being used. In debugging I checked my client list when everything was blocked and saw every connection looked like this (all the connections have xread as their last command):
I then issued a CLIENT KILL TYPE normal to kill all the connection and chirpstack did reconnect and all my new connections look like the following, and the interface is once again working:
@zeara One question for you: when youâve found this issue, have you had your browser open on one of the either gateway or device âframesâ pages? I just realized that Iâve been sitting on those pages polling - I wonder if over time something is happening internally and those connections arenât getting killed properly and just end up blocking.
@brocaar This continues to happen to us. Our current configuration has nginx as a reverse proxy in front of Chirpstack using grpc_pass for the API calls. When watching the frames page for one of our gateways, I would hit a minute with no traffic coming through the gateway, or no payloads from a device (if we were on that page), and nginx would close the connection due to a timeout.
My suspicion is in these cases, nginx never receives a response from the grpc call (because itâs waiting on traffic from the gateway, which isnât returning in the 60s default) and then is closing the connection to the client saying that itâs closed. But perhaps Chirpstack is not closing the connection once nginx does, and so itâs just keeping that connection to redis open, waiting for frames to come in to send upstream (which is now gone).
Is there a way to ask a running Chirpstack instance how many grpc calls itâs currently serving? Or alternately, figuring out a way for Chirpstack to let go of these redis connections once the proxying connection goes away?
Thanks for all the feedback. Based on the above info, I will try to reproduce this issue at my side again. Given that all the connections are using the xread as their command looks like this is related to the streaming logs and events.