amancevice / docker-superset

Docker image for Airbnb's Superset
https://hub.docker.com/r/amancevice/superset/
MIT License
952 stars 418 forks source link

Cannot send alerts / reports (only in Amancevice build) #204

Closed leocape closed 3 years ago

leocape commented 3 years ago

After creating an alert or report in 1.0.1 the alert/report fails to send. The logs on the superset container show cron_descriptor.GetText:Failed to find locale en_US and the alert/report is not be sent.

This does not happen in the Apache build, only in the Amancevice build, so I'm guessing its something to do with the way the image has been built / extended.

(The locale of the machine appears to irrelevant to this issue)

Version: 1.0.1

Steps to replicate:

  1. Update your superset_config.py to turn on the alerts and reporting feature flag:
FEATURE_FLAGS = {
    "ALERT_REPORTS": True
}

ENABLE_SCHEDULED_EMAIL_REPORTS = True
EMAIL_NOTIFICATIONS = True
  1. Load in the new config: docker exec <superset> superset init

  2. start the logs to monitor: docker logs -f <superset>

  3. Sign into superset and select alerts and reports from the settings menu

  4. Create a report with 1 minute cron (interval is irrelevant, but 1 min for testing), and fill out the rest of the details

  5. Check the logs and you will see the error cron_descriptor.GetText:Failed to find locale en_US and the report will not be sent

docker-compose:

version: '3'
services:
  redis:
    image: redis
    restart: always
    volumes:
      - redis:/data
  postgres:
    image: postgres
    restart: always
    environment:
      POSTGRES_DB: superset
      POSTGRES_PASSWORD: superset
      POSTGRES_USER: superset
    volumes:
      - ./postgres:/var/lib/postgresql/data
  superset:
    image: amancevice/superset
    restart: always
    depends_on:
      - postgres
      - redis
    environment:
      MAPBOX_API_KEY: ${MAPBOX_API_KEY}
    ports:
      - "8088:8088"
    volumes:
      - ./superset:/etc/superset
  worker:
    image: amancevice/superset
    restart: always
    depends_on:
      - superset
      - postgres
      - redis
    environment:
      MAPBOX_API_KEY: ${MAPBOX_API_KEY}
    volumes:
      - ./superset:/etc/superset
    command: "celery worker --app=superset.tasks.celery_app:app"
  beat:
    image: amancevice/superset
    restart: always
    depends_on:
      - superset
      - postgres
      - redis
    volumes:
      - ./superset:/etc/superset
    command: "celery beat --app=superset.tasks.celery_app:app"
volumes:
  postgres:
  redis:
leocape commented 3 years ago

Although the cron_descriptor.GetText:Failed to find locale en_US still shows, it does not actually prevent emails from being sent. There was a misconfig with the superset_config.py, this is the correct config for this docker-compose:

SQLALCHEMY_DATABASE_URI = \
    'postgresql+psycopg2://superset:superset@postgres:5432/superset'

The debug error raised seems like just a warning

lizheng404 commented 2 years ago

Has your problem been solved? I have the same problem @leocape

hermesalvesbr commented 1 year ago

I have the same problem too :(