metrico / qryn

⭐️ All-in-One Polyglot Observability with OLAP Storage for Logs, Metrics, Traces & Profiles. Drop-in Grafana Cloud replacement compatible with Loki, Prometheus, Tempo, Pyroscope, Opentelemetry, Datadog and beyond :rocket:
https://qryn.dev
GNU Affero General Public License v3.0
1.19k stars 67 forks source link

Failure to create materialized view on first load #445

Closed Homulvas closed 8 months ago

Homulvas commented 8 months ago

I'm attempting to run qryn on k8s with the provided helm template (v0.1.1). On start the table creation fails midway:

> qryn@3.1.1 start
> node qryn.mjs

{"level":30,"time":1706551098613,"pid":22,"hostname":"qryn-qryn-helm-fff-p56rg","name":"qryn","msg":"Initializing DB... qryn"}
{"level":30,"time":1706551096804,"pid":22,"hostname":"qryn-qryn-helm-fff-p56rg","name":"qryn","msg":"xxh ready"}
{"level":30,"time":1706551099003,"pid":22,"hostname":"qryn-qryn-helm-fff-p56rg","name":"qryn","msg":"xxh ready"}
{"level":50,"time":1706551100701,"pid":22,"hostname":"qryn-qryn-helm-fff-p56rg","name":"qryn","msg":"rawRequest error: CREATE MATERIALIZED VIEW IF NOT EXISTS profiles_series_gin_mv ON CLUSTER `loggingtest` TO profiles_series_gin AS\n    SELECT \n      date,\n      kv.1 as key,\n      kv.2 as val,\n      type_id,\n      sample_types_units,\n      service_name,\n      fingerprint,\n    FROM profiles_series ARRAY JOIN tags as kv"}
{"level":50,"time":1706551100701,"pid":22,"hostname":"qryn-qryn-helm-fff-p56rg","name":"qryn","msg":"Code: 62. DB::Exception: Syntax error: failed at position 265 ('profiles_series') (line 10, col 10): profiles_series ARRAY JOIN tags as kv. Expected one of: token, Dot, OR, AND, BETWEEN, NOT BETWEEN, LIKE, ILIKE, NOT LIKE, NOT ILIKE, REGEXP, IN, NOT IN, GLOBAL IN, GLOBAL NOT IN, MOD, DIV, IS NULL, IS NOT NULL, alias, AS, Comma, FROM, PREWHERE, WHERE, GROUP BY, WITH, HAVING, WINDOW, ORDER BY, LIMIT, OFFSET, SETTINGS, UNION, EXCEPT, INTERSECT, COMMENT, INTO OUTFILE, FORMAT, end of query. (SYNTAX_ERROR) (version 23.3.11.5 (official build))\n"}
{"level":50,"time":1706551100702,"pid":22,"hostname":"qryn-qryn-helm-fff-p56rg","name":"qryn","err":"Error: Request failed with status code 400\nResponse: [400] undefined\nError: Request failed with status code 400\n    at createError (/app/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/app/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/app/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:530:35)\n    at endReadableNT (node:internal/streams/readable:1696:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)","msg":"Error starting qryn"}

It appears that the materialized view can be created if the trailing comma after fingerprint is removed. In case this is related to the ClickHouse version I'm currently running 23.3.11.5.

akvlad commented 8 months ago

Thanks a lot for the information. Apparently some extra commas have been unintentionally misplaced. Sorry. Will be fixed in the very next release.

akvlad commented 8 months ago

should be fixed in 3.2.0

Homulvas commented 8 months ago

Updated and can confirm that it is working as expected now.