multiprocessio / datastation

App to easily query, script, and visualize data from every database, file, and API.
https://datastation.multiprocess.io
Other
2.9k stars 112 forks source link

Failed to eval: json: cannot unmarshal string into Go struct field #189

Closed fosron closed 2 years ago

fosron commented 2 years ago

Hey,

so it's seems that after returning to an already existing project im getting this error (for every panel, im using TimescaleDB via SSH, PostgreSQL via SSH, Code SQL and Table outputs)

Error: [INFO] 2022-03-01T11:39:27 DataStation Runner (Go) development
[INFO] 2022-03-01T11:39:27 Failed to eval: json: cannot unmarshal string into Go struct field PanelResult.pages.panels.resultMeta.shape of type map[string]interface {}

    at evalInSubprocess (/Applications/DataStation Community Edition.app/Contents/Resources/app.asar/desktop/panel/eval.ts:190:27)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at IpcMainImpl.<anonymous> (/Applications/DataStation Community Edition.app/Contents/Resources/app.asar/desktop/rpc.ts:83:9)

The only remedy i found is to copy everything to a new project, not even new tabs work. I guess this is has something to do with how existing data is stored.

Also there's this in Table type:

Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=Fri%20Sep%2011%202020%2015%3A41%3A10%20GMT%2B0300%20(Eastern%20European%20Summer%20Time) for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at e2 (file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:8:45157)
    at file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:8:50040
    at ci (file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:8:61034)
    at dz (file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:12:10488)
    at az (file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:12:950)
    at ej (file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:12:878)
    at tu (file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:12:731)
    at Sm (file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:10:10893)
    at file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:8:38812
    at ro.unstable_runWithPriority (file:///Applications/DataStation%20Community%20Edition.app/Contents/Resources/app.asar/build/ui.js:4:12622)

Datastation v0.7.0 MacOS 12.2.1 (21D62) Intel Mac (MacBook Pro (13-inch, 2019, Four Thunderbolt 3 ports))

 ~  node -v
v14.17.0
 ~  go version
go version go1.17.3 darwin/amd64
fosron commented 2 years ago

I think having an option to not save (or clear existing) result/inferred schema would be more than enough. That way project does not hold too much data.

eatonphil commented 2 years ago

Thank you for the report! It would also help if you could send me a .dsproj file that has this issue.

When I upgrade myself it normally works for me so it's concerning you've been having issues upgrading!

fosron commented 2 years ago

It's not about the upgrade, i'm creating new projects, they all do act the same after some time. As for sending a .dsproj, i need to come up with something that has no personal data and fails.

eatonphil commented 2 years ago

Ok I'm going to introduce a workaround where it will not error out if the shape becomes bad. Hopefully that will allow you to re-run and fill it with a valid shape.

I can't solve the actual issue until I see an example dsproj if you can send one, since I've never had this for me (though you've clearly demonstrated it does happen).

eatonphil commented 2 years ago

Just an update on the underlying issue, all the data is driven by the UI at the moment and stored in JSON on disk in a single giant blob.

I'm splitting this out to be more reliable/sane, also moving to store all project data (not the results data) in SQLite. That should be out next month and should deal with the many subtle storage bugs there are right now.

fosron commented 2 years ago

Sounds great, thanks!