4

Applications were using readonly user when the following exception was thrown:

<Error> HTTPHandler: Code: 164, e.displayText() = DB::Exception: Cannot modify 'result_overflow_mode' setting in readonly mode

I read ClickHouse code and found that when query goes with set setting, if the user is read-only, this error will be thrown.

I checked the configuration of my read-only-user in users.xml and found that max_result_rows/bytes and result_overflow_mode were not actively set.

However, my query does not go with set setting.

So what logic triggers the change of this setting?

Winter Z.
  • 73
  • 1
  • 13
  • Please check the below answer. https://stackoverflow.com/a/52549395/2536745 – raghu777 Mar 17 '20 at 07:04
  • you need https://clickhouse.tech/docs/en/operations/settings/permissions_for_queries/#settings_readonly readonly mode 2 and http post – Denny Crane Mar 17 '20 at 14:18
  • 1
    Thanks, guys! But I'm wondering what logic triggers the change of this `result_overflow_mode` setting cause I didn't do it explicitly. – Winter Z. Mar 18 '20 at 08:37

1 Answers1

5

Try to specify <readonly>2</readonly>.

Description of readonly parameter: https://clickhouse.tech/docs/en/operations/settings/permissions_for_queries/#settings_readonly

Possible values:
0 — All queries are allowed.
1 — Only read data queries are allowed.
2 — Read data and change settings queries are allowed.

So, with readonly=2 you are let to you client to set result_overflow_mode but dont let to execute inserts and other requests of modifying data.

Nick
  • 9,735
  • 7
  • 59
  • 89
  • Thank you! Your answer is very detailed. Do you have any idea about what logic may trigger the change of this `result_overflow_mode setting` cause I didn't do it explicitly. – Winter Z. May 14 '20 at 10:56
  • 1
    In my case my client DBeaver sets `result_overflow_mode` – Nick May 14 '20 at 11:36