Cache warmup does not work
See original GitHub issueThe cache warmup task does not work as it tries to access the webserver without a scheme.
In commit d65b039219c9825ad50ec03ad73a1638710c73c9, 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
- Setup cache warming task in Superset configuration
- Wait for the task to trigger
- 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 Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
warm up cache does not work · Issue #18933 · apache/superset
I actually setup a cookie in the request to login in with a warmup user. If I do not add this cookie, it...
Read more >Symfony cache warm up error on production - Stack Overflow
It seems that only on the production server warming up the cache causes an error. This is how I try to warm up...
Read more >What is Cache Warming? - Section.io
Cache warming is when websites artificially fill the cache so that real visitors will always get a cache hit. Essentially, sites that engage...
Read more >Warm the cache to improve performance from cold start - Neo4j
This is because on cold boot, a server node has nothing cached yet, and needs to go to disk for all records. Once...
Read more >New in Symfony 3.3: Deprecated cache clear with warmup
However, the warmup part of the cache:clear command does not work well, and does not deliver the guarantee that the generated cache is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As a temporary workaround, I had to set
SUPERSET_WEBSERVER_ADDRESS = 'http://0.0.0.0'
in mysuperset_config.py
.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.