Cerberus112 commented on issue #27160:
URL: https://github.com/apache/superset/issues/27160#issuecomment-1971580842

   UPDATE:
   
   Finally, I found that the redirection was due to the WEBDRIVER_BASEURL not 
being configured at the service level.
   ```
   WEBDRIVER_BASEURL = "http://{{ template "superset.fullname" . }}:8088/"
   ```
   However, I now encounter receiving 400 errors due to missing CSRF when 
trying to warm up the cache, both from the worker and externally using the API. 
   ```
   {'errors': [{'message': '400 Bad Request: The CSRF session token is 
missing.', 'error_type': 'GENERIC_BACKEND_ERROR', 'level': 'error', 'extra': 
{'issue_codes': [{'code': 1011, 'message': 'Issue 1011 - Superset encountered 
an unexpected error.'}]}}]}
   ```
   If I disable CSRF:
   ```
   WTF_CSRF_ENABLED = False
   ```
   it returns 302:
   ```
   [2024-02-29 17:00:00,368: INFO/ForkPoolWorker-2] 
fetch_url[356f2e18-4069-4f16-a8aa-d3bee8323296]: Fetching 
http://superset:8088/api/v1/chart/warm_up_cache with payload {"chart_id": 49}
   [2024-02-29 17:00:00,377: ERROR/ForkPoolWorker-3] 
fetch_url[ba8a1804-8ea0-460a-8892-da8f8fa9b733]: Error warming up cache!
   Traceback (most recent call last):
     File "/app/superset/tasks/cache.py", line 242, in fetch_url
       response = request.urlopen(  # pylint: disable=consider-using-with
     File "/usr/local/lib/python3.9/urllib/request.py", line 214, in urlopen
       return opener.open(url, data, timeout)
     File "/usr/local/lib/python3.9/urllib/request.py", line 523, in open
       response = meth(req, response)
     File "/usr/local/lib/python3.9/urllib/request.py", line 632, in 
http_response
       response = self.parent.error(
     File "/usr/local/lib/python3.9/urllib/request.py", line 555, in error
       result = self._call_chain(*args)
     File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
       result = func(*args)
     File "/usr/local/lib/python3.9/urllib/request.py", line 726, in 
http_error_302
       new = self.redirect_request(req, fp, code, msg, headers, newurl)
     File "/usr/local/lib/python3.9/urllib/request.py", line 664, in 
redirect_request
       raise HTTPError(req.full_url, code, msg, headers, fp)
   urllib.error.HTTPError: HTTP Error 302: FOUND
   [2024-02-29 17:00:00,378: ERROR/ForkPoolWorker-2] 
fetch_url[356f2e18-4069-4f16-a8aa-d3bee8323296]: Error warming up cache!
   Traceback (most recent call last):
     File "/app/superset/tasks/cache.py", line 242, in fetch_url
       response = request.urlopen(  # pylint: disable=consider-using-with
     File "/usr/local/lib/python3.9/urllib/request.py", line 214, in urlopen
       return opener.open(url, data, timeout)
     File "/usr/local/lib/python3.9/urllib/request.py", line 523, in open
       response = meth(req, response)
     File "/usr/local/lib/python3.9/urllib/request.py", line 632, in 
http_response
       response = self.parent.error(
     File "/usr/local/lib/python3.9/urllib/request.py", line 555, in error
       result = self._call_chain(*args)
     File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
       result = func(*args)
     File "/usr/local/lib/python3.9/urllib/request.py", line 726, in 
http_error_302
       new = self.redirect_request(req, fp, code, msg, headers, newurl)
     File "/usr/local/lib/python3.9/urllib/request.py", line 664, in 
redirect_request
       raise HTTPError(req.full_url, code, msg, headers, fp)
   urllib.error.HTTPError: HTTP Error 302: FOUND
   ```
   
   Related errors reported before: 
https://github.com/apache/superset/issues/24717#issue-1808086329 
https://github.com/apache/superset/issues/24579#issue-1786075530


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to