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

Error running ODS file as source #221

Closed nekromoff closed 2 years ago

nekromoff commented 2 years ago
Error evaluating panel:
Error: [INFO] 2022-04-13T11:25:57 DataStation Runner (Go) development
[INFO] 2022-04-13T11:25:57 Evaling file panel
[INFO] 2022-04-13T11:25:57 Assumed 'application/vnd.oasis.opendocument.spreadsheet' from 'application/vnd.oasis.opendocument.spreadsheet' given '/home/XXXX.ods' when loading file
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/multiprocessio/datastation/runner.writeSheet({0xc0008ad880, 0x23, 0x416585}, 0x1a3c0a0)
    /home/runner/work/datastation/datastation/runner/file.go:195 +0x1c5
github.com/multiprocessio/datastation/runner.transformOpenOfficeSheet.func2.1(0xe)
    /home/runner/work/datastation/datastation/runner/file.go:291 +0x3c
github.com/multiprocessio/datastation/runner.withJSONArrayOutWriter({0x1e772e0, 0xc00011ef68}, 0xc000e1f4a0)
    /home/runner/work/datastation/datastation/runner/json.go:36 +0xf6
github.com/multiprocessio/datastation/runner.transformOpenOfficeSheet.func2()
    /home/runner/work/datastation/datastation/runner/file.go:290 +0x1d6
github.com/multiprocessio/datastation/runner.withJSONOutWriter({0x1e772e0, 0xc00011ef68}, {0x1e50330, 0xc0007ca801}, {0x1e50334, 0x1}, 0xc000e1f590)
    /home/runner/work/datastation/datastation/runner/json.go:21 +0xb7
github.com/multiprocessio/datastation/runner.transformOpenOfficeSheet(0xc00052ca48, {0x1e772e0, 0xc00011ef68})
    /home/runner/work/datastation/datastation/runner/file.go:275 +0xcf
github.com/multiprocessio/datastation/runner.transformOpenOfficeSheetFile({0xc00052ca48, 0x4}, {0x1e772e0, 0xc00011ef68})
    /home/runner/work/datastation/datastation/runner/file.go:308 +0x65
github.com/multiprocessio/datastation/runner.TransformFile({0xc00052ca48, 0x4a}, {{0xc00052cabc, 0x1}, {0xc00052cb00, 0xc}}, {0x1e772e0, 0xc00011ef68})
    /home/runner/work/datastation/datastation/runner/file.go:616 +0x535
github.com/multiprocessio/datastation/runner.EvalContext.evalFilePanel({{{0xc0007ca007, 0x24}, 0xc000b0e5e0, 0xc000ae5920, {0xc0007ca11c, 0x2a}, 0x1388, {0x0, 0x0}, {0x2fc0d70, ...}}, ...}, ...)
    /home/runner/work/datastation/datastation/runner/file.go:653 +0x409
github.com/multiprocessio/datastation/runner.EvalContext.Eval({{{0xc0007ca007, 0x24}, 0xc000b0e5e0, 0xc000ae5920, {0xc0007ca11c, 0x2a}, 0x1388, {0x0, 0x0}, {0x2fc0d70, ...}}, ...}, ...)
    /home/runner/work/datastation/datastation/runner/eval.go:154 +0x3b0
main.main()
    /home/runner/work/datastation/datastation/runner/cmd/main.go:71 +0x518

    at ChildProcess.<anonymous> (/home/Downloads/DataStation Community Edition-linux-x64/resources/app.asar/desktop/panel/eval.ts:178:28)
    at ChildProcess.emit (node:events:390:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)

Also would it be possible to provide error stacktrace copy to clipboard on click (or a button to do so)?

eatonphil commented 2 years ago

Hey thanks for the bug report! There are automated tests for ODS so it seems like you found an edge case. Could you provide an ODS file that reproduces this?

Also would it be possible to provide error stacktrace copy to clipboard on click (or a button to do so)?

That's a good idea!

Thank you!

nekromoff commented 2 years ago

I am sorry but due to the privacy issues I can not post this sheet.

But if you can provide tips on what to look into with this ODS document, I can check it.

eatonphil commented 2 years ago

I think I found the issue. Should be fixed in the next release.