Comments (9)
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.
from looker-sdk-ruby.
Thanks for this @dthorpe. Do you have any update on this?
from looker-sdk-ruby.
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
If you could pull that branch to your local disk and try running your code using this modified sdk, please let me know if you see error messages reported by the client sdk for try_load_swagger
. Again, for any API error response seen on the client there should be a corresponding entry in the Looker admin logs, and a copy of those would be very helpful.
Thanks,
-Danny
from looker-sdk-ruby.
@cionescu
Do you ever set sdk.shared_swagger
to true
? It defaults to false
. When set to true
, it changes the way the client loads the swagger metadata.
from looker-sdk-ruby.
Hi @dthorpe. Thanks for looking into this.
- I am not sure how to check the Looker instance admin logs.
- Do you have any idea when will your PR make it into a new gem release? I'd like to upgrade our client and perhaps monitor our application logs for that message
- I never set the shared_swagger config, so I'm assuming it's still false. An overview of the way I'm using the client is:
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)
from looker-sdk-ruby.
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.
from looker-sdk-ruby.
@dthorpe did you make any progress with this?
from looker-sdk-ruby.
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 no_method_error
can be caused by a few things including failure to connect to the looker host. If the host is not available you can still initialize the client, but that doesn't mean your connection was successful.
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 no_method_error
.
One suggestion I have is to try testing the host connection before running your dynamic method. i.e. sdk.client.alive
should return a 200 if it is available.
I would advocate for better error handling overall as no_method_error
simply implies that a swagger.json file has not been loaded.
from looker-sdk-ruby.
I'm seeing this error as well, when I think it should be an Unauthorized error (return by sdk.last_error
)
2.5.3 :018 > sdk.update_session({ workspace_id: 'dev' })
Traceback (most recent call last):
7: from /Users/daphne/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `<main>'
6: from /Users/daphne/.rvm/gems/ruby-2.5.3/bin/ruby_executable_hooks:24:in `eval'
5: from /Users/daphne/.rvm/gems/ruby-2.5.3/bin/irb:23:in `<main>'
4: from /Users/daphne/.rvm/gems/ruby-2.5.3/bin/irb:23:in `load'
3: from /Users/daphne/.rvm/gems/ruby-2.5.3/gems/irb-1.2.7/exe/irb:11:in `<top (required)>'
2: from (irb):18
1: from /Users/daphne/.rvm/gems/ruby-2.5.3/gems/looker-sdk-0.0.7/lib/looker-sdk/client/dynamic.rb:105:in `method_missing'
NoMethodError (undefined method `update_session' for #<LookerSDK::Client:0x00007fb14619a5d8>)
2.5.3 :019 > sdk.last_error
=> #<LookerSDK::Unauthorized: GET https://mycompany.looker.com/api/3.0/swagger.json: 401 - Error: Unauthorized>
sdk.alive
returns 200
from looker-sdk-ruby.
Related Issues (20)
- post/put/patch methods must specify all headers if present in options passed to method
- Login endpoint appears to be incorrect in the authentication.md file
- Dependency problem with faraday 1.0.0 HOT 3
- travis doesn't seem to work right for pull requests here
- Conversion of "date like" string data to datetime is too aggressive
- Exception thrown when calling #alive HOT 2
- Consider an option to bypass/replace Sawyer
- How do I convert my Rest webservice spring mvc application from swagger 1.0 to swagger 2.0. HOT 1
- Missing tags for looker-sdk HOT 1
- Sawyer version HOT 1
- Consider getting rid of the client CONVENIENCE_HEADERS handling
- Option to includes roles for user(user_id) and all_users? HOT 1
- Release new version of the gem HOT 4
- Reduce output volume of sdk.inspect HOT 1
- Model good error handling practices in examples HOT 11
- Faraday dependency makes the SDK incompatible with gems HOT 3
- Undefined method look or run_look for Looker::Client HOT 1
- v0.0.6 doesn't work on Ruby 1.9.3
- api key and secret should be sent via body, not query string HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from looker-sdk-ruby.