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

An error occurs only in some commands #31

Open
cavernaria opened this issue Jul 13, 2020 · 5 comments
Open

An error occurs only in some commands #31

cavernaria opened this issue Jul 13, 2020 · 5 comments

Comments

@cavernaria
Copy link

Only some commands give me an error. How can I get rid of this error?

Environment

  • It happens on both Windows and Mac.
  • Python 3.7.5
  • henry 0.2.2
  • looker-sdk 0.1.3b7

Successful commands

  • pulse
  • analyze projects

Error command

Other than the above

Error Message

Any command can be shared and the following error occurs (also on a Mac).

/Traceback (most recent call last):
  File "c:\python37\lib\site-packages\henry\modules\fetcher.py", line 153, in get_explores
    for e in m.explores
  File "c:\python37\lib\site-packages\henry\modules\fetcher.py", line 153, in <listcomp>
    for e in m.explores
  File "c:\python37\lib\site-packages\looker_sdk\sdk\methods.py", line 3306, in lookml_model_explore
    transport_options=transport_options,
  File "c:\python37\lib\site-packages\looker_sdk\rtl\api_methods.py", line 134, in get
    return self._return(response, structure)
  File "c:\python37\lib\site-packages\looker_sdk\rtl\api_methods.py", line 78, in _return
    raise error.SDKError(response.value.decode(encoding=encoding))
looker_sdk.error.SDKError: {"message":"Not found","documentation_url":"http://docs.looker.com/"}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Python37\Scripts\henry.exe\__main__.py", line 9, in <module>
  File "c:\python37\lib\site-packages\henry\cli.py", line 18, in main
    analyze.Analyze.run(user_input)
  File "c:\python37\lib\site-packages\henry\commands\analyze.py", line 14, in run
    result = analyze.models(project=user_input.project, model=user_input.model)
  File "c:\python37\lib\contextlib.py", line 74, in inner
    return func(*args, **kwds)
  File "c:\python37\lib\site-packages\henry\commands\analyze.py", line 67, in models
    "# Unused Explores": len(self.get_unused_explores(model=m.name)),
  File "c:\python37\lib\site-packages\henry\modules\fetcher.py", line 194, in get_unused_explores
    _all = self.get_explores(model=model)
  File "c:\python37\lib\site-packages\henry\modules\fetcher.py", line 158, in get_explores
    "An error occured while getting models/explores."
henry.modules.exceptions.NotFoundError: An error occured while getting models/explores.
@bryan-at-looker
Copy link

bryan-at-looker commented Jul 31, 2020

I ran into this fixing a different issue. One culprit was the system__activity model, but there are other cases too I wasn't able to track down.

Here's a consistent failure of this nature:
henry analyze explores --model system__activity --config-file ../looker.ini

In this case we're failing here on explores = [self.sdk.lookml_model_explore(model, explore)] here

@emilywilson2
Copy link

I'm also getting the same errors on all commands except pulse and analyze projects

Python 3.7.0
henry 0.2.2
looker-sdk 0.1.3b7

@nishiogawakun
Copy link

Same set up, same errors as above.

@TiagoCruz1989
Copy link

TiagoCruz1989 commented Nov 4, 2020

Same here.
If i use the name of some models as a parameter it works.
If not i get the same errors.

@jcarah
Copy link

jcarah commented Nov 30, 2020

There is some unknown condition under which Looker's API will return explores in the call to the /models/ endpoint, but those explores can't be found when you make a call the /models/explores endpoint.

Henry makes these call successively, in fetcher.py. On line 157, I updated the except block to simply ignore these mismatches.

except error.SDKError:
    # raise exceptions.NotFoundError(
    #     "An error occured while getting models/explores."
    # )
    print("Could not find explore...skipping.")

@josephaxisa I wonder if you have any idea what's going on and whether you think this is an acceptable workaround. I can make a PR if so.

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

6 participants