question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MockRequest instance has no attribute 'fs'

See original GitHub issue

Hue version 4.8.0 (docker)

When I execute a script in PIG editor or a spark program in SPARK editor, I always get the message “MockRequest instance has no attribute ‘fs’”. It seems that there’s no impact on the behaviour. In the logs, there’s this error:

[09/Feb/2021 10:30:48 +0100] decorators   ERROR    Error running fetch_result_data
Traceback (most recent call last):
  File "/usr/share/hue/desktop/libs/notebook/src/notebook/decorators.py", line 114, in wrapper
    return f(*args, **kwargs)
  File "/usr/share/hue/desktop/libs/notebook/src/notebook/api.py", line 318, in fetch_result_data
    response = _fetch_result_data(request.user, notebook, snippet, operation_id, rows=rows, start_over=start_over)
  File "/usr/share/hue/desktop/libs/notebook/src/notebook/api.py", line 329, in _fetch_result_data
    'result': get_api(request, snippet).fetch_result(notebook, snippet, rows, start_over)
  File "/usr/share/hue/desktop/libs/notebook/src/notebook/models.py", line 517, in get_api
    return ApiWrapper(request, snippet)
  File "/usr/share/hue/desktop/libs/notebook/src/notebook/models.py", line 503, in __init__
    self.api = _get_api(request, snippet)
  File "/usr/share/hue/desktop/libs/notebook/src/notebook/connectors/base.py", line 436, in get_api
    return OozieApi(user=request.user, request=request)
  File "/usr/share/hue/desktop/libs/notebook/src/notebook/connectors/oozie_batch.py", line 58, in __init__
    self.fs = self.request.fs
AttributeError: MockRequest instance has no attribute 'fs'

What is the reason of this message ? Maybe a miss configuration in HUE ? thanks in advance

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
romainrcommented, Feb 9, 2021

Thanks for the report!

This is probably related to: https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/models.py#L276

And we could add in the init()? https://github.com/cloudera/hue/blob/master/desktop/libs/notebook/src/notebook/models.py#L727

class MockRequest():
  def __init__(self, user, fs=None, jt=None):
    self.user = user
    self.fs = fs
    self.jt = jt
    self.POST = {}

Would you be able to send a PR for it?

Note: it fails in the the result result, but IIRC there is no results with this API, only a dump of the log output Note 2: there are also some other MockRequest classes we could unify, but can be done in Hue 5 in a an easier way

0reactions
stephbatcommented, Feb 18, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I get "Instance has no attribute _caller" error while ...
response is one of the globals that web2py uses; your code just stomped on it, which breaks the controller.
Read more >
nock - npm
For instance, if a module performs HTTP requests to a CouchDB ... Here is a list of past nock versions with respective node...
Read more >
Intent - Android Developers
In addition to these primary attributes, there are a number of secondary attributes that you can also include with an intent:.
Read more >
urllib.request.urlopen, specific content not returned
With this request I get back the page source, but the IP-Address/Hostname/Location ... txt = str(s) fs = open('myip-net.htm', 'w') fs.write(txt) fs.close().
Read more >
Blog - In Plain English
Content specialists in the programming, software development, and tech space, IPE empowers people with accessible, educational media.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found