-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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 warm-ups never succeed #9597
Comments
BTW, I noticed there is such a login procedure (with a headless browser) in the email report generator. Perhaps that procedure could be factored out and reused to warm up the cache in our case? |
@Pinimo what does your cache config look like?
but in Superset logs, I only see:
Needless to say, my charts are not being updated This is my config:
|
@jayhjha Perhaps it would be worth changing your config variable |
Any news on this? |
A colleague made a POC on this, but came to the conclusion it is already quite difficult to have the email reports working... He wanted to use part of that code (headless browser + login) to work around the login problem. I think he found out the dependencies for the feature were not included in the Dockerfile. |
To my knowledge the feature is (and will stay...) broken 😢 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
Any news from the community on this issue? |
@Pinimo any workaround you find to this issue? I am getting the same exact issue. |
@mukulsaini I have not found the time to address the issue, to my best knowledge it has not been solved yet. If you too find this issue is a real problem, I invite you to talk it over on Superset's Slack 🗨️ Here are a few educated guesses as how to solve the issue:
|
Yet another draft solution:
|
Mmmh, maybe I'm missing something, but it seems like we shouldn't have to go through the web server to do this. Refactoring / mimicking what |
@mistercrunch What I see from the previous commits, previously the route used to cache warmup in |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
Any news or workarounds for avoiding the 302 to the login endpoint? I still run into this issue using latest docker image (warm-up succeeds on worker, superset logs show redirect to login, no caches refreshed). Not being able to warm-up caches periodically feels like a missing vital feature. |
Cache Warmup is not working on my superset1.2 (docker, ubuntu 18.04), my superset log is below,
|
Yes, unfortunately the cache warmup code is missing auth. It should be fairly simple to pass auth cookies in the request though, most of the code is already in superset. There's a function that returns auth cookies given a user (can use the |
Additionally, it seems that the celery worker is reporting success since 302s do not throw |
superset 1.3.2 (ecs not docker env) I tried the warmup feature last week. And find out several problems:
And I read the cache part code in master branch and nothing change.
|
Still this issue was not fixed even with the latest image Some one please throw the light. |
I'm quite confused how this is advertised in the documentation as a way to warm the cache, yet is impossible since all the cache-warmup strategies are stuck behind the auth wall... is the community overlooking something? Tagging original author @betodealmeida and recent maintainers @graceguo-supercat & @john-bodley |
At Lyft, when I worked on this, we had a custom security manager, and we could access any endpoint using a master token that gave full permissions. |
@betodealmeida i started to explore slapping on a token, but noticed everything was cookie based so i didn't pursue much further. I managed to just grab the I just need my graphs precomputed, saw it documented and thought this would be a good fit. Not interested in forking this, maintaining it, & building images from underlying source etc. I see you work at preset.io which is based on superset; does your on-prem offering happen to have this working? |
The cache warming strategies perform unauthorized `GET` requests that are redirected to the login page. As a result, they do not work as documented. Please remove documentation references until these are ready for production use. apache#9597
The cache warming strategies perform unauthorized `GET` requests that are redirected to the login page apache#9597
The cache warming strategies perform unauthorized `GET` requests that are redirected to the login page apache#9597
Maybe i can do something with superset/superset/security/api.py Lines 113 to 162 in b08e21e
But looks like it would need to be regenerated whenever a new dashboard is added superset/superset/security/manager.py Lines 1334 to 1349 in b08e21e
|
Ah, you're right, I don't think there's an easy way to customize the celery workers to pass a custom token in the request. Let me take another look at this, it's been a couple years. |
@ajwhite @betodealmeida I sent a PR to address this issue, which is working in my environment. |
The cache warming strategies perform unauthorized `GET` requests that are redirected to the login page #9597
Globally: the cache warm-up tasks launched by Celery workers all silently fail. Indeed, they perform
GET
s on the main server's URL without providing the required authentication. However, dashboards may not be loaded without being logged in.Related bugs:
--beat
flag to listen on CeleryBeat schedules (cfdocker-compose.yml
configuration)At stake: long dashboard load times for our users, or outdated dashboards.
Main files to be fixed:
superset/tasks/cache.py
Expected results
When the Celery worker logs this (notice
'errors': []
):... we would expect to have something (more or less) like this in the Superset server logs:
Of course, we also hope to have a bunch of items in the Redis logs, and that loading dashboards is lightning-quick.
Actual results
But we get these logs instead, which show there is a 302 redirect to the login page, followed by a 200 on the login page. This redirect is interpreted as a success by the tests.
(I added a few line returns)
In the Redis, here is the only stored key:
Last, the dashboards take time loading the data on the first connection.
Screenshots
None
How to reproduce the bug
I had to patch the master branch to get this to work. In particular, I have to admit it was not very clear to me whether the config was read from file
docker/pythonpath_dev/superset_config.py
or filesuperset/config.py
. So I kind of adaptedsuperset/config.py
and copied it over to thepythonpath
one (which looks like it is read by the celery worker, but not the server).Anyway, this reproduces the bug:
$ docker system prune --all
to remove all dangling images, exited containers and volumes.$ git checkout master && git pull origin master
$ wget -O configs.patch https://gist.githubusercontent.com/Pinimo/c339ea828974d2141423b6ae64192aa4/raw/e449c97c11f81f7270d6e0b2369d55ec41b079a9/0001-bug-Patch-master-to-reproduce-sweetly-the-cache-warm.patch && git apply configs.patch
This will apply patches to master to make the scenario work out neatly, in particular add the
--beat
flag and specify a cache warmup task on all dashboards every minute.$ docker-compose up -d
$ docker-compose logs superset-worker | grep cache-warmup
$ docker-compose logs superset | grep slice
$ docker-compose exec redis redis-cli
then typeKEYS *
Environment
(please complete the following information):
Checklist
The text was updated successfully, but these errors were encountered: