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

Cache warmup does not work #8461

Closed
3 tasks done
EvaSDK opened this issue Oct 28, 2019 · 6 comments · Fixed by #8721
Closed
3 tasks done

Cache warmup does not work #8461

EvaSDK opened this issue Oct 28, 2019 · 6 comments · Fixed by #8721
Assignees
Labels
!deprecated-label:bug Deprecated label - Use #bug instead

Comments

@EvaSDK
Copy link

EvaSDK commented Oct 28, 2019

The cache warmup task does not work as it tries to access the webserver without a scheme.

In commit d65b039, use of requests was removed and replaced by urlopen. However at the same time, the get_url function was modified to not include HTTP scheme anymore. While this could make sense if the service is running behind a reverse proxy or if SSL is used, this is not currently configurable

Expected results

Cache warmup task is performed.

Actual results

Cache warmup fails with a traceback.

Screenshots

[2019-10-28 15:00:00,015: INFO/ForkPoolWorker-6] cache-warmup[4345da24-b272-4af8-a8bc-2c1ee924191c]: Loading strategy
[2019-10-28 15:00:00,015: INFO/ForkPoolWorker-6] cache-warmup[4345da24-b272-4af8-a8bc-2c1ee924191c]: Loading TopNDashboardsStrategy
[2019-10-28 15:00:00,017: INFO/ForkPoolWorker-6] cache-warmup[4345da24-b272-4af8-a8bc-2c1ee924191c]: Success!
[2019-10-28 15:00:00,031: INFO/ForkPoolWorker-6] cache-warmup[4345da24-b272-4af8-a8bc-2c1ee924191c]: Fetching 0.0.0.0:8088/superset/explore/?form_data=%7B%22slice_id%22%3A%201%7D
[2019-10-28 15:00:00,031: ERROR/ForkPoolWorker-6] cache-warmup[4345da24-b272-4af8-a8bc-2c1ee924191c]: Error warming up cache!
Traceback (most recent call last):
  File "/home/superset/superset/tasks/cache.py", line 285, in cache_warmup
    request.urlopen(url)
  File "/usr/local/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.6/urllib/request.py", line 549, in _open
    'unknown_open', req)
  File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.6/urllib/request.py", line 1388, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: 0.0.0.0>

How to reproduce the bug

  1. Setup cache warming task in Superset configuration
  2. Wait for the task to trigger
  3. See error

Environment

  • superset version: Installation from git commit 03b35b3
  • python version: Python 3.6.9
  • node.js version: v10.16.3
  • npm version: 6.9.0

Checklist

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.93. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the !deprecated-label:bug Deprecated label - Use #bug instead label Oct 28, 2019
@willbarrett
Copy link
Member

@EvaSDK it looks like you've determined the exact problem. Please feel free to submit a PR with the solution!

@EvaSDK
Copy link
Author

EvaSDK commented Oct 31, 2019

@willbarrett, is using requests a good option and it is better to stick to python 3 builtin modules ?

@willbarrett
Copy link
Member

@EvaSDK I think it would be better to stick with python 3 built-in modules.

@mingqianye
Copy link

As a temporary workaround, I had to set SUPERSET_WEBSERVER_ADDRESS = 'http://0.0.0.0' in my superset_config.py.

@betodealmeida betodealmeida self-assigned this Dec 2, 2019
@betodealmeida
Copy link
Member

👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants