{"record":{"id":"89a65f861c026f69","repo":"nats-io/nats-server","slug":"unsupported-route-compression-mode-q","errorCode":null,"errorMessage":"unsupported route compression mode %q","messagePattern":"unsupported route compression mode %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/server.go","lineNumber":608,"sourceCode":"\t\treturn scm, nil\n\tcase CompressionS2Auto, CompressionS2Uncompressed, CompressionS2Fast, CompressionS2Better, CompressionS2Best:\n\t\t// This case is here to make sure that if we don't recognize a\n\t\t// compression setting, we error out.\n\t\tif scm == CompressionAccept {\n\t\t\t// If our compression mode is \"accept\", then we will use the remote\n\t\t\t// compression mode, except if it is \"auto\", in which case we will\n\t\t\t// default to \"fast\". This is not a configuration (auto in one\n\t\t\t// side and accept in the other) that would be recommended.\n\t\t\tif rcm == CompressionS2Auto {\n\t\t\t\treturn CompressionS2Fast, nil\n\t\t\t}\n\t\t\t// Use their compression mode.\n\t\t\treturn rcm, nil\n\t\t}\n\t\t// Otherwise use our compression mode.\n\t\treturn scm, nil\n\tdefault:\n\t\treturn _EMPTY_, fmt.Errorf(\"unsupported route compression mode %q\", rcm)\n\t}\n}\n\n// If the configured compression mode is \"auto\" then will return that,\n// otherwise will return the given `cm` compression mode.\nfunc compressionModeForInfoProtocol(co *CompressionOpts, cm string) string {\n\tif co.Mode == CompressionS2Auto {\n\t\treturn CompressionS2Auto\n\t}\n\treturn cm\n}\n\n// Given a connection RTT and a list of thresholds durations, this\n// function will return an S2 compression level such as \"uncompressed\",\n// \"fast\", \"better\" or \"best\". For instance, with the following slice:\n// [5ms, 10ms, 15ms, 20ms], a RTT of up to 5ms will result\n// in the compression level \"uncompressed\", ]5ms..10ms] will result in\n// \"fast\" compression, etc..","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/server.go#L590-L626","documentation":"Route compression negotiation (processCompressionOption/selectedCompression helper in server.go): the remote peer advertised a compression mode this server does not recognize among the known S2 modes (uncompressed/fast/better/best/auto). Fired while setting up a route connection when the two servers disagree on supported compression identifiers — usually a version mismatch with a newer/older peer.","triggerScenarios":"Thrown at server/server.go:608 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Upgrade both route peers to compatible nats-server versions","Disable compression on the route/cluster to avoid negotiation","Pin a commonly supported mode (e.g. fast) on both sides"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}