Hey team, we started experiencing an issue today w...
# support
a
Hey team, we started experiencing an issue today with Rudderstack where all server pods are in a CrashBackLoop, error logs are things such as
Copy code
panic: driver: bad connection [recovered]
	panic: driver: bad connection [recovered]
	panic: driver: bad connection
Copy code
WARN	warehouse/warehouse.go:1258	Failed to setup WH db tables: Error while getting destination driver for migrator: try lock failed in line 0: SELECT pg_advisory_lock($1) (details: driver: bad connection), retrying after 546.110484ms
Copy code
panic({0x1d0d520, 0xc00003b160})
	/usr/local/go/src/runtime/panic.go:838 +0x207
github.com/rudderlabs/rudder-server/gateway.(*HandleT).dbWriterWorkerProcess(0xc000317b00)
	/rudder-server/gateway/gateway.go:338 +0x3fa
github.com/rudderlabs/rudder-server/gateway.(*HandleT).initDBWriterWorkers.func1()
	/rudder-server/gateway/gateway.go:257 +0x1d
github.com/rudderlabs/rudder-server/utils/misc.WithBugsnag.func1()
	/rudder-server/utils/misc/misc.go:1260 +0x70
golang.org/x/sync/errgroup.(*Group).Go.func1()
	/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
	/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x8d
RS server version
Copy code
{
  "BuildDate": "2022-09-23,06:14:35",
  "BuiltBy": "a56e2b38ba56296eab924520c6f243368c69b8f0",
  "Commit": "a56e2b38ba56296eab924520c6f243368c69b8f0",
  "DatabricksVersion": "Unable to read response from databricks.",
  "GitUrl": "",
  "Major": "",
  "Minor": "",
  "Patch": "",
  "TransformerVersion": "05072022.140359",
  "Version": "1.1.2"
}
s
Hi @acceptable-lion-84959
Did you raise the P0?
a
Hey @shy-kite-21035, indeed, I’ve been trying to debug the issue the past few hours but still no luck
yes we are, for about 7 months now
running pretty stable since July was our last incident, then around 5 hours ago our pods have been stuck in a crashloop
rs hosted control plane
current images in our helm chart
Copy code
repository: rudderlabs/rudder-server
    version: "1.1.2@sha256:dc9c66d97526a9bbf604e38431fa838466672596ea920d128bd0b3446e7fc29d"

repository: rudderlabs/rudder-transformer
    version: 05072022.140359@sha256:5f202a918f722478db0f8782b9e913697948db8b7e0f5b81bf57443dcf5cdabe
thanks @shy-kite-21035
please do let me know if you need more information to help
current size of different postgres pods 1. rudderstack-postgresql-0 1117 MB 2. rudderstack-postgresql-1 699 MB 3. rudderstack-postgresql-2 3380 MB 4. rudderstack-postgresql-3 3035 MB
s
Hi Sahil, • Is database accepting connections? • Can you verify the credentials ? • Did anything change in your setup?
a
Hey Raganath, no changes, seems to be traffic related
s
Can you share the postgres logs?
Can you run these commands ?
kubectl port-forward <postgres-pod> 7432:5432
psql -h localhost -U rudder -d jobsdb -p 7432
Change the postgres-pod to the respective pod
a
hey Raganth, we were getting hanging queries on tables which I tried to run
ANALYZE
on. In the end we had to double our pods to make it stable again
running 8 pods and it seems to have recovered now
we’re experiencing this sort of thing once a quarter, it’s hard to debug as it seems a one off event triggers a db failure and that sets of a chain of events with all the pods failing. What could we do to reduce the risk with this sort of thing? Our current sub batch size is 2000, are there any other settings we can tweak to make RS more reliable?
s
Hi Sahil, just to confirm • Your pods seem to stable now? • However, you are facing such pod crash issues every few months? I will ask the team to take this up and do RCA as to why this is happening. Also if you have faced this issue before, can you share the issue link?
a
Hey Raganath, yes stable now. We get them every 3 months so far which isn’t ideal. This seemed to be the common log error before crashes today
Copy code
ERROR: unexpected message type 0x58 during COPY from stdin
This was our last issue back in July but it was a code issue https://rudderstack.slack.com/archives/C01E4PLB135/p1657063409489839 where we understood what was wrong and had to fix some of the underlying data. On other instances like today it’s different since we solve it by scaling up and don’t really know what went wrong and the problem goes away. As a first do you recommend we upgrade our tags:
Copy code
repository: rudderlabs/rudder-server
    version: "1.1.2@sha256:dc9c66d97526a9bbf604e38431fa838466672596ea920d128bd0b3446e7fc29d"

to

    version: "1.4.4@sha256:a26b96e8a89f9049bc32de0963116deed0adcd6ccf80e5c381695cbc15afbc4c"
Copy code
repository: rudderlabs/rudder-transformer
    version: 05072022.140359@sha256:5f202a918f722478db0f8782b9e913697948db8b7e0f5b81bf57443dcf5cdabe

to

    version: 06122022.092752@sha256:b389103c003299038cb7512cc7b209503d35cfc1e196cdb66049adaedd452439
Are there any actions we should do prior to upgrading besides just deploying the new tags?
After a post mortem, here’s some things we found: Lots of
LOG: unexpected EOF on client connection with an open transaction
then
Copy code
LOG: could not send data to client: Broken pipe
FATAL: terminating connection because protocol synchronization was lost
Copy code
Dec 12, 2022 @ 10:32:31.205	2022-12-11 23:32:31.204 GMT [18102] ERROR: relation "batch_rt_job_status_3024_1" does not exist
Dec 12, 2022 @ 10:32:31.205	2022-12-11 23:32:31.204 GMT [18102] STATEMENT: LOCK TABLE "batch_rt_job_status_3024_1" IN ACCESS EXCLUSIVE MODE;
Copy code
Dec 12, 2022 @ 11:04:21.338	2022-12-12T00:04:21.338Z WARN warehouse/warehouse.go:1258 Failed to setup WH db tables: Error while getting destination driver for migrator: driver: bad connection, retrying after 518.303179ms
Copy code
ERROR: unexpected message type 0x58 during COPY from stdin