Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library panics at certain query failures #81

Closed
w1ndy opened this issue Mar 16, 2022 · 1 comment
Closed

Library panics at certain query failures #81

w1ndy opened this issue Mar 16, 2022 · 1 comment
Assignees

Comments

@w1ndy
Copy link
Contributor

w1ndy commented Mar 16, 2022

Looks like v2.rawToOneAPIErr expects that errors are of type map[string]interface {} but actually an array of interfaces is returned...

panic: interface conversion: interface {} is []interface {}, not map[string]interface {}

goroutine 46 [running]:
github.com/Azure/azure-kusto-go/kusto/internal/frames/v2.rawToOneAPIErr({0xc000166000, 0x3bdd, 0x3e00}, 0xe800)
        /home/diweng/go/pkg/mod/github.com/!azure/[email protected]/kusto/internal/frames/v2/v2.go:217 +0x113
github.com/Azure/azure-kusto-go/kusto/internal/frames/v2.(*DataTable).UnmarshalRaw(0xc0001142d0, {0xc000166000, 0x3bdd, 0x3e00})
        /home/diweng/go/pkg/mod/github.com/!azure/[email protected]/kusto/internal/frames/v2/v2.go:61 +0x127
github.com/Azure/azure-kusto-go/kusto/internal/frames/v2.(*Decoder).decode(0xc000218380, {0x92a968, 0xc0002e2e40}, 0xc00005ae88)
        /home/diweng/go/pkg/mod/github.com/!azure/[email protected]/kusto/internal/frames/v2/decoder.go:117 +0x81f
github.com/Azure/azure-kusto-go/kusto/internal/frames/v2.(*Decoder).decodeFrames(0xc000218380, {0x92a968, 0xc0002e2e40}, 0x0)
        /home/diweng/go/pkg/mod/github.com/!azure/[email protected]/kusto/internal/frames/v2/decoder.go:83 +0x66
github.com/Azure/azure-kusto-go/kusto/internal/frames/v2.(*Decoder).Decode.func1()
        /home/diweng/go/pkg/mod/github.com/!azure/[email protected]/kusto/internal/frames/v2/decoder.go:60 +0x37e
created by github.com/Azure/azure-kusto-go/kusto/internal/frames/v2.(*Decoder).Decode
        /home/diweng/go/pkg/mod/github.com/!azure/[email protected]/kusto/internal/frames/v2/decoder.go:33 +0x1af
exit status 2

The query response is as follows

{
    "FrameType": "DataTable",
    "TableId": 1,
    "TableKind": "PrimaryResult",
    "TableName": "PrimaryResult",
    "Columns": ["..."],
    "Rows": ["...", {
            "OneApiErrors": [
                {
                    "error": {
                        "code": "Internal service error",
                        "message": "Request aborted due to an internal service error.",
                        "@type": "System.AggregateException",
                        "@message": "...",
                        "@context": {
                            "timestamp": "2022-03-16T11:29:08.7676558Z",
                            "serviceAlias": "...",
                            "machineName": "KENGINE000004",
                            "processName": "Kusto.WinSvc.Svc",
                            "processId": 5180,
                            "threadId": 3784,
                            "appDomainName": "Kusto.WinSvc.Svc.exe",
                            "clientRequestId": "KGC.execute;c6525dc6-b281-42b8-9250-0da3d7c2b3ef",
                            "activityId": "f924dcd6-3176-4b37-986c-80413bff1e9b",
                            "subActivityId": "f924dcd6-3176-4b37-986c-80413bff1e9b",
                            "activityType": "PO.OWIN.CallContext",
                            "parentActivityId": "f924dcd6-3176-4b37-986c-80413bff1e9b",
                            "activityStack": "(Activity stack: CRID=KGC.execute;c6525dc6-b281-42b8-9250-0da3d7c2b3ef ARID=f924dcd6-3176-4b37-986c-80413bff1e9b > PO.OWIN.CallContext/f924dcd6-3176-4b37-986c-80413bff1e9b)"
                        },
                        "@permanent": false
                    }
                }
            ]
        }
    ]
}
@AsafMah
Copy link
Contributor

AsafMah commented Apr 12, 2022

Solved in 0.6.0, feel free to re-open if you have issues.

@AsafMah AsafMah closed this as completed Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants