Giter VIP home page Giter VIP logo

Comments (4)

craig-rueda avatar craig-rueda commented on May 24, 2024

Could be an issue with the worker's webdriver config or something. Unclear from the logs as to what the initial cause of the 308 is.

from superset.

Cerberus112 avatar Cerberus112 commented on May 24, 2024

Could be an issue with the worker's webdriver config or something. Unclear from the logs as to what the initial cause of the 308 is.

I also considered this possibility, but the reports are being sent correctly, and they utilize the webdriver. For example:

[2024-02-21 09:32:00,077: INFO/ForkPoolWorker-1] Scheduling alert test_report eta: 2024-02-21 09:32:00
Executing alert/report, task id: 4a38bbbe-0f97-4031-afb1-6829668a754b, scheduled_dttm: 2024-02-21T09:32:00
[2024-02-21 09:32:00,082: INFO/ForkPoolWorker-1] Executing alert/report, task id: 4a38bbbe-0f97-4031-afb1-6829668a754b, scheduled_dttm: 2024-02-21T09:32:00
session is validated: id 9, executionid: 4a38bbbe-0f97-4031-afb1-6829668a754b
[2024-02-21 09:32:00,083: INFO/ForkPoolWorker-1] session is validated: id 9, executionid: 4a38bbbe-0f97-4031-afb1-6829668a754b
Running report schedule 4a38bbbe-0f97-4031-afb1-6829668a754b as user admin
[2024-02-21 09:32:00,116: INFO/ForkPoolWorker-1] Running report schedule 4a38bbbe-0f97-4031-afb1-6829668a754b as user admin
Report sent to email, notification content is {'notification_type': 'Report', 'notification_source': <ReportSourceFormat.DASHBOARD: 'dashboard'>, 'notification_format': 'PNG', 'chart_id': None, 'dashboard_id': 3, 'owners': [Superset Admin]}
[2024-02-21 09:32:14,119: INFO/ForkPoolWorker-1] Report sent to email, notification content is {'notification_type': 'Report', 'notification_source': <ReportSourceFormat.DASHBOARD: 'dashboard'>, 'notification_format': 'PNG', 'chart_id': None, 'dashboard_id': 3, 'owners': [Superset Admin]}

Anyway, I'll also include the configuration of the superset worker:

supersetWorker:
  affinity: {}
  autoscaling:
    enabled: false
    maxReplicas: 100
    minReplicas: 1
    targetCPUUtilizationPercentage: 80
  command:
  - /bin/sh
  - -c
  - |
    # Install chrome webdriver
    # See https://github.com/apache/superset/blob/4fa3b6c7185629b87c27fc2c0e5435d458f7b73d/docs/src/pages/docs/installation/email_reports.mdx
    apt-get update
    apt-get install wget unzip zip -y
    wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
    apt-get install -y --no-install-recommends ./google-chrome-stable_current_amd64.deb
    wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/121.0.6167.85/linux64/chromedriver-linux64.zip
    #unzip chromedriver_linux64.zip
    #chmod +x chromedriver
    #mv chromedriver /usr/bin
    unzip chromedriver-linux64.zip
    chmod +x chromedriver-linux64/chromedriver
    mv chromedriver-linux64/chromedriver /usr/bin
    apt-get autoremove -yqq --purge
    apt-get clean
    #rm -f google-chrome-stable_current_amd64.deb chromedriver-linux64.zip

    # Run
    . {{ .Values.configMountPath }}/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app worker
  containerSecurityContext: {}
  deploymentAnnotations: {}
  deploymentLabels: {}
  extraContainers: []
  forceReload: false
  initContainers:
  - command:
    - /bin/sh
    - -c
    - dockerize -wait "tcp://$DB_HOST:$DB_PORT" -wait "tcp://$REDIS_HOST:$REDIS_PORT"
      -timeout 120s
    envFrom:
    - secretRef:
        name: '{{ tpl .Values.envFromSecret . }}'
    image: '{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}'
    imagePullPolicy: '{{ .Values.initImage.pullPolicy }}'
    name: wait-for-postgres-redis
  livenessProbe:
    exec:
      command:
      - sh
      - -c
      - celery -A superset.tasks.celery_app:app inspect ping -d celery@$HOSTNAME
    failureThreshold: 3
    initialDelaySeconds: 120
    periodSeconds: 60
    successThreshold: 1
    timeoutSeconds: 60
  podAnnotations: {}
  podLabels: {}
  podSecurityContext: {}
  readinessProbe: {}
  replicaCount: 1
  resources: {}
  startupProbe: {}
  strategy: {}
  topologySpreadConstraints: []

and the worker's startup logs:

Saving to: ‘chromedriver-linux64.zip’
Archive:  chromedriver-linux64.zip
  inflating: chromedriver-linux64/LICENSE.chromedriver  
  inflating: chromedriver-linux64/chromedriver  
logging was configured successfully
2024-02-21 09:21:34,875:INFO:superset.utils.logging_configurator:logging was configured successfully
2024-02-21 09:21:34,878:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
/usr/local/lib/python3.9/site-packages/flask_limiter/extension.py:293: UserWarning: Using the in-memory storage for tracking rate limits as no storage was explicitly specified. This is not recommended for production use. See: https://flask-limiter.readthedocs.io#configuring-a-storage-backend for documentation about configuring the storage backend.
  warnings.warn(
/usr/local/lib/python3.9/site-packages/celery/platforms.py:840: SecurityWarning: You're running the worker with superuser privileges: this is
absolutely not recommended!

Please specify a different user using the --uid option.

User information: uid=0 euid=0 gid=0 egid=0

  warnings.warn(SecurityWarning(ROOT_DISCOURAGED.format(
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
 
 -------------- celery@superset-worker-7db568d57c-dht8w v5.2.2 (dawn-chorus)
--- ***** ----- 
-- ******* ---- Linux-3.10.0-1160.71.1.el7.x86_64-x86_64-with-glibc2.36 2024-02-21 09:21:36
- *** --- * --- 
- ** ---------- [config]
- ** ---------- .> app:         __main__:0x7f0fd54bbb20
- ** ---------- .> transport:   redis://superset-redis-headless:6379/0
- ** ---------- .> results:     redis://superset-redis-headless:6379/0
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- 
 -------------- [queues]
                .> celery           exchange=celery(direct) key=celery

from superset.

Cerberus112 avatar Cerberus112 commented on May 24, 2024

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: #24717 (comment) #24579 (comment)

from superset.

dmuldoonadl avatar dmuldoonadl commented on May 24, 2024

I'm experiencing the same issue.

from superset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.