Random ConnectionShutdown, CRC mismatch on header when cqlsh tries to connect to Cassandra 4.0.x

Description

We observe a random rare issue when a connection to Cassandra 4.0.x (for example - 4.0.5) from cqlsh (uses 3.25.0 Python driver version) fails with:

Connection error: ('Unable to connect to any servers', {'192.168.1.62:9042': ConnectionShutdown('CRC mismatch on header 85ba. Received 80b00\", computed 1bbf10.

From Cassandra server point of view it looks like during a CQL connection establishment handshake a remote client decided to close connection by itself:

We have not found a way to reproduce the issue reliably. The issue is observed on different physical environments.

A similar issue reported in StackOverflow:

Environment

None

Pull Requests

None

Activity

Dmitry Konstantinov 
May 31, 2023 at 1:13 PM

Do you have a more recent capture of this error?

We face it randomly and I have not found a way to reproduce it stably. Running of a cqlsh in a bash loop for 1000 times does not give a reliable reproduction (I can get an error sometimes if I am very lucky). As of now we have applied a retry in our wrapping logic on top of cqlsh invocation to work around this issue. We haven’t seen such kind of issue for 3.x versions of Cassandra.

Daniil Azarnov 
May 24, 2023 at 2:02 PM

Using Cassandra Medusa, we also met this problem for the 3.25.0 and 3.27.0 python cassandra driver.

Do you need more details? Also, I started Issue in Cassandra Medusa Github about this problem:

Wei Deng 
March 29, 2023 at 1:10 AM

Thanks for reporting this issue. Do you have a more recent capture of this error? Looks like the timestamp was from 16 months ago.

Details

Assignee

Reporter

Affects versions

Priority

Created March 28, 2023 at 4:20 PM
Updated May 31, 2023 at 1:13 PM