Skill 07 · Clickhouse Js Node Troubleshooting
Subchapter 7.7
reference/readonly-users.mdMarkdown1 KBView on GitHub
Applies to: all versions. In
>= 1.0.0,compression.responsewas changed to disabled by default specifically to avoid this confusing error for read-only users. If you are on , response compression was enabled by default and you must explicitly disable it.
< 1.0.0Symptom: Error when using compression: { response: true } with a readonly=1 user.
Cause: Response compression requires the enable_http_compression setting, which readonly=1 users cannot change. Note: request compression (compression: { request: true }) is unaffected by this restriction — only response compression triggers the error.
Fix: Remove response compression for read-only users:
import { createClient } from "@clickhouse/client";
// Don't do this with a readonly=1 user:
// compression: { response: true }
const client = createClient({
username: "my_readonly_user",
password: "...",
// compression omitted, or explicitly set to false
compression: {
response: false,
},
});