Gel UI gives consistent "Failed to fetch data" errors
This seems to have started happening when I upgraded my local instance to Gel 6.3. I thought it was my database, but when I loaded up the example database it had the same issue.
The actual error from the console is an assertion error:
hook.js:608 QueryError: possibly not a distinct set returned by an expression for a computed link '__count_watchlist_1'
|
8 | __count_watchlist_1 := (for g in (
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9 | group .watchlist
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 | using typename := .__type__.name
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | by typename
| ^^^^^^^^^^^^^^^^^^^^^^^^^
12 | ) union {
| ^^^^^^^^^^^^^^^^^^^^^
13 | typename := g.key.typename,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 | count := <std::float64>count(g.elements)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 | })
| ^^^^^^^^^^^^^
Hint: You can use assert_distinct() around the expression to turn this into a runtime assertion, or the DISTINCT operator to silently discard duplicate elements.
The result is no data loading in the data viewer (though the schema viewer works just fine). This happens on all tables, though the error is of course marginally different each time, e.g. when I load the example "Movies" table, the error is instead about the actor computed link:
QueryError: possibly not a distinct set returned by an expression for a computed link '__count_actors_2'
|
9 | __count_actors_2 := (for g in (
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 | group .actors
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | using typename := .__type__.name
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | by typename
| ^^^^^^^^^^^^^^^^^^^^^^^^^
13 | ) union {
| ^^^^^^^^^^^^^^^^^^^^^
14 | typename := g.key.typename,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 | count := <std::float64>count(g.elements)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 | })
| ^^^^^^^^^^^^^
Hint: You can use assert_distinct() around the expression to turn this into a runtime assertion, or the DISTINCT operator to silently discard duplicate elements.
Hit this as well. Every 'table' in Data Explorer throws this:
QueryError: possibly not a distinct set returned by an expression for a computed link '__count_events_9'
|
16 | __count_events_9 := (for g in (
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 | group .events
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 | using typename := .__type__.name
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 | by typename
| ^^^^^^^^^^^^^^^^^^^^^^^^^
20 | ) union {
| ^^^^^^^^^^^^^^^^^^^^^
21 | typename := g.key.typename,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 | count := <std::float64>count(g.elements)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 | }),
| ^^^^^^^^^^^^^
Hint: You can use assert_distinct() around the expression to turn this into a runtime assertion, or the DISTINCT operator to silently discard duplicate elements.
QueryError: possibly not a distinct set returned by an expression for a computed link '__count_children_7'
|
14 | __count_children_7 := (for g in (
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 | group .children
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 | using typename := .__type__.name
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
17 | by typename
| ^^^^^^^^^^^^^^^^^^^^^^^^^
18 | ) union {
| ^^^^^^^^^^^^^^^^^^^^^
19 | typename := g.key.typename,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 | count := <std::float64>count(g.elements)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 | })
| ^^^^^^^^^^^^^
Hint: You can use assert_distinct() around the expression to turn this into a runtime assertion, or the DISTINCT operator to silently discard duplicate elements.
Gel version: Gel 6.3+942383c (repl 7.1.1+616a110) Server version: 6.3+942383c
This is a regression in 6.3: geldata/gel#8481
Confirming that upgrade to 6.4 fixes the issue.