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

Node SDK: JSON error on empty response #1271

Open
haggholm opened this issue Mar 11, 2023 · 0 comments
Open

Node SDK: JSON error on empty response #1271

haggholm opened this issue Mar 11, 2023 · 0 comments
Assignees
Labels
bug Regression or bug p3 Priority 3 typescript Typescript or Javascript SDK issues

Comments

@haggholm
Copy link

When querying Looker using the Node SDK, we occasionally see an Error: Unexpected end of JSON input. This is coming from the parseResponse() function in nodeTransport.js:

            if (!(result instanceof Object)) {
              result = JSON.parse(result.toString());
            }

In this instance, the response is actually empty, and JSON.parse("") throws an error.

  1. The error is not particularly good or informative. In fact, I don't know whether the library should throw an error on an empty response or not, but a JSON parse error is definitely not what I'd expect.
  2. Why is the API returning an empty response in the first place? The sample query where I was able to reproduce this does not actually run in the Looker SQL editor either, failing with ERROR: Operation not allowed on schema "pg_internal". Fair enough, that's probably an error on my part with the test data; but I would have expected some kind of informative error response rather than an empty string that then causes a parse error.
    • It is not entirely clear whether all instances of this error are related to models that fail when queried from the Looker web UI; if I can obtain more information on that, I will update this ticket.
@github-actions github-actions bot added need triage p3 Priority 3 labels Mar 11, 2023
@jeremytchang jeremytchang added the typescript Typescript or Javascript SDK issues label Apr 3, 2023
@jeremytchang jeremytchang added bug Regression or bug and removed need triage labels Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Regression or bug p3 Priority 3 typescript Typescript or Javascript SDK issues
Projects
None yet
Development

No branches or pull requests

3 participants