brimdata / zed

A novel data lake based on super-structured data
https://zed.brimdata.io/
BSD 3-Clause "New" or "Revised" License
1.34k stars 67 forks source link

Describe of Zed with statements causes "unsupported source type *dag.Scope" #5153

Closed philrz closed 5 days ago

philrz commented 5 days ago

tl;dr

$ curl -X POST -H "content-type: application/json" -d '{"query":"type socket = {addr:ip,port:port=uint16}\nfrom sample.zng","head":null}' http://localhost:9867/query/describe
{"type":"Error","kind":"invalid operation","error":"unsupported source type *dag.Scope"}

Details

Repro is with GA Zui tagged v1.16.0.

The high-level symptom was reported by a zync community user that was running Zui Insiders. Via binary search I've confirmed the problem started to appear at Zui commit 21abbf6 which is associated with the changes in https://github.com/brimdata/zui/pull/3085. In essence, a Zed program with a leading statement such as type produces an error and no query output.

image

Studying packet captures reveals that what's being shown is from an HTTP 400 response on the "describe" endpoint, which can be reproduced at the shell.

$ curl -X POST -H "content-type: application/json" -d '{"query":"type socket = {addr:ip,port:port=uint16}\nfrom sample.zng","head":null}' http://localhost:9867/query/describe
{"type":"Error","kind":"invalid operation","error":"unsupported source type *dag.Scope"}

At prior Zui commits, it appears that response was effectively being ignored. But since the query is valid, it does seem the fix should come from the Zed side.

philrz commented 5 days ago

Verified with Zui commit 39550b3 which uses Zed commit ab603fa.

Now that the API sends a non-error response, the query output is visible.

image

Thanks @mattnibs!