-
Notifications
You must be signed in to change notification settings - Fork 43
NoMethodError for LookerSDK::Client #82
Comments
Thanks for logging this issue. I'll be investigating this in more detail, but my best guess right now is that the swagger.json is failing to download for some reason, and the client sdk isn't handling that case well. Beefing up the error reporting in this area will be my first step. |
Thanks for this @dthorpe. Do you have any update on this? |
HTTP 500 Server Error is not an error to be expected from login or swagger.json. Please check the Looker instance's admin logs for 500 Server Error log entries. These log entries should contain stack traces. If you find such entries in the logs, please copy them into a message here to help me better understand what's failing. I've added some diagnostic messages to the client sdk in this PR: #83 Thanks, |
@cionescu |
Hi @dthorpe. Thanks for looking into this.
def client
@_client ||= LookerSDK::Client.new(
client_id: Settings.looker.client_id,
client_secret: Settings.looker.client_secret,
api_endpoint: Settings.looker.api_endpoint,
connection_options: {
request: {
timeout: 360,
open_timeout: 30,
},
},
)
end
# ... and then ..
client.run_inline_query("json", query).map(&:to_h) |
Hi @cionescu thanks for the follow-up. Your code looks fine. The Looker instance admin logs can be found in the Looker web app under the Admin menu. Scroll all the way to the bottom and select Log, under the Server section header. If you don't have admin rights, ask your Looker admin to view the log with you. It will help to have the log window open while you run your API script. |
@dthorpe did you make any progress with this? |
I'm working with the looker-sdk right now and am writing out specs for an implementation that configures users, groups, and permissions for use with embedding. What I can say in the little time I've been using the SDK is that the If you try to execute a dynamically created method with a bad host connection it will fail to load the swagger json and throw the One suggestion I have is to try testing the host connection before running your dynamic method. i.e. I would advocate for better error handling overall as |
I'm seeing this error as well, when I think it should be an Unauthorized error (return by
|
Hello,
I noticed some strange behavior with the client sdk.
I am configuring the client as:
when using the client, I sometimes get
NoMethodError: undefined method
run_inline_query' for #<LookerSDK::Client:0x0000000130cbd0> from looker-sdk/client/dynamic.rb:62:in
method_missing'I have not been able to find a better stack trace for this (even adding breakpoints in your client was not enough to figure this out). I was able to narrow down the failure to this test case:
How should I handle this? My understanding is that a 500 during the login or when fetching swagger.json would make
@swagger
be nil, proppingfind_entry(method_name)
in dynamic.rb return false. The 500 during either the login or fetching the config json is something to be expected, but I would expect a LookerSDK::ServerError instead of a NoMethodErrorThe text was updated successfully, but these errors were encountered: