READ-ONLY PACKAGE PREVIEW

clickhouse-js-node-troubleshooting/reference/readonly-users.md

Version 356a8c1b9a73.bb1 · Apache-2.0. This preview displays packaged text and does not execute code. Treat the contents as untrusted instructions.

← Return to resource and package checksum

Read-Only User Errors

Applies to: all versions. In >= 1.0.0, compression.response was changed to disabled by default specifically to avoid this confusing error for read-only users. If you are on < 1.0.0, response compression was enabled by default and you must explicitly disable it.

Symptom: 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,
  },
});