I got same error, and got it down to faulty mongo_eval function in mongo.sh:
mongo --quiet --eval "${1?}"
mongo returns extra line which mongo_eval returns (instead of just 1) when called for ping:
rocketchat-server.mongo --quiet --eval 'db.adminCommand({ ping: 1 }).ok'
{"t":{"$date":"2025-04-14T11:15:41.330Z"},"s":"I", "c":"NETWORK", "id":5693100, "ctx":"js","msg":"Asio socket.set_option failed with std::system_error","attr":{"note":"connect (sync) TCP fast open","option":{"level":6,"name":30,"data":"01 00 00 00"},"error":{"what":"set_option: Protocol not available","message":"Protocol not available","category":"asio.system","value":92}}}
1
This could easy be fixed by changing mongo_eval… which i can’t in a snap, so refresh fails.
I tried setting net.ipv4.tcp_fastopen to 3 or even 0, but didn’t help.