Skip to content
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

Type object 'lexer' has no attribute 'get_default_instance' during helm upgrade #24680

Closed
talsan74 opened this issue Jul 13, 2023 · 2 comments
Closed

Comments

@talsan74
Copy link

Tried to upgrade superset helm chart superset-0.10.4 and app version 2.1.0. But during the upgrade superset pod gets crashloopbackoff.

Actual results

getting following error

[notice] To update, run: pip install --upgrade pip
Usage: celery [OPTIONS] COMMAND [ARGS]...
Try 'celery --help' for help.

Successfully installed Authlib-1.2.1 apache-superset-2.1.0 bleach-3.3.1 cx-Oracle-8.0.1 flask-2.1.3 flask-wtf-1.0.1 graphlib-backport-1.0.3 holidays-0.17.2 marshmallow_enum-1.5.1 psycopg2-binary-2.9.1 pyarrow-10.0.1 redis-3.5.3 sqlparse-0.4.3 webencodings-0.5.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip is available: 23.0.1 -> 23.1.2
[notice] To update, run: pip install --upgrade pip
Usage: celery [OPTIONS] COMMAND [ARGS]...
Try 'celery --help' for help.

Error: Invalid value for '-A' / '--app':
Unable to load celery application.
Type object 'lexer' has no attribute 'get_default_instance'

Pod status

NAME                               READY   STATUS             RESTARTS         AGE
superset-54554bb8cb-s4nmb          0/1     CrashLoopBackOff   10 (3m10s ago)   34m
superset-65dc7bf56b-tcgjs          0/1     CrashLoopBackOff   9 (3m46s ago)    34m
superset-postgresql-0              1/1     Running            0                34m
superset-redis-master-0            1/1     Running            0                34m
superset-worker-5948864d65-mlmxv   0/1     CrashLoopBackOff   9 (4m27s ago)    34m

Values.yaml

this is the values used during upgrade

affinity: {}
bootstrapScript: |
  #!/bin/bash
  rm -rf /var/lib/apt/lists/* && \
  pip install  psycopg2-binary==2.9.1 marshmallow_enum==1.5.1 sqlparse==0.4.3 redis==3.5.3 mysqlclient apache-superset[oracle] Authlib && \
  if [ ! -f ~/bootstrap ]; then echo "Running Superset with uid {{ .Values.runAsUser }}" > ~/bootstrap; fi
configFromSecret: '{{ template "superset.fullname" . }}-config'
configMountPath: /app/pythonpath
configOverridesFiles: {}
envFromSecret: '{{ template "superset.fullname" . }}-env'
envFromSecrets: []
extraConfigMountPath: /app/configs
extraConfigs: {}
extraEnv: {}
extraEnvRaw: []
extraSecretEnv: {}
extraSecrets: {}
extraVolumeMounts: []
extraVolumes: []
hostAliases: []
image:
  pullPolicy: IfNotPresent
  repository: apache/superset
  tag: latest
imagePullSecrets: []
ingress:
  annotations: {}
  enabled: false
  hosts:
  - chart-example.local
  path: /
  pathType: ImplementationSpecific
  tls: []
init:
  adminUser:
    email: [email protected]
    firstname: Superset
    lastname: Admin
    password: admin
    username: admin
  command:
  - /bin/sh
  - -c
  - . {{ .Values.configMountPath }}/superset_bootstrap.sh; . {{ .Values.configMountPath
    }}/superset_init.sh
  containerSecurityContext: {}
  createAdmin: true
  enabled: true
  initContainers:
  - command:
    - /bin/sh
    - -c
    - until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done
    envFrom:
    - secretRef:
        name: '{{ tpl .Values.envFromSecret . }}'
    image: '{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}'
    imagePullPolicy: '{{ .Values.initImage.pullPolicy }}'
    name: wait-for-postgres
  initscript: |-
    #!/bin/sh
    set -eu
    echo "Upgrading DB schema..."
    superset db upgrade
    echo "Initializing roles..."
    superset init
    {{ if .Values.init.createAdmin }}
    echo "Creating admin user..."
    superset fab create-admin \
                    --username {{ .Values.init.adminUser.username }} \
                    --firstname {{ .Values.init.adminUser.firstname }} \
                    --lastname {{ .Values.init.adminUser.lastname }} \
                    --email {{ .Values.init.adminUser.email }} \
                    --password {{ .Values.init.adminUser.password }} \
                    || true
    {{- end }}
    {{ if .Values.init.loadExamples }}
    echo "Loading examples..."
    superset load_examples
    {{- end }}
    if [ -f "{{ .Values.extraConfigMountPath }}/import_datasources.yaml" ]; then
      echo "Importing database connections.... "
      superset import_datasources -p {{ .Values.extraConfigMountPath }}/import_datasources.yaml
    fi
  loadExamples: false
  podAnnotations: {}
  podSecurityContext: {}
  resources: {}
initImage:
  pullPolicy: IfNotPresent
  repository: busybox
  tag: latest
nodeSelector: {}
postgresql:
  auth:
    database: superset
    existingSecret: null
    password: superset
    username: superset
  enabled: true
  primary:
    persistence:
      accessModes:
      - ReadWriteOnce
      enabled: true
    service:
      ports:
        postgresql: "5432"
redis:
  architecture: standalone
  auth:
    enabled: false
    existingSecret: ""
    existingSecretKey: ""
    password: superset
  enabled: true
  master:
    persistence:
      accessModes:
      - ReadWriteOnce
      enabled: false
resources: {}
runAsUser: 0
service:
  annotations: {}
  loadBalancerIP: null
  port: 8088
  type: ClusterIP
serviceAccount:
  create: false
supersetCeleryBeat:
  command:
  - /bin/sh
  - -c
  - . {{ .Values.configMountPath }}/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app
    beat --pidfile /tmp/celerybeat.pid --schedule /tmp/celerybeat-schedule
  containerSecurityContext: {}
  deploymentAnnotations: {}
  enabled: false
  forceReload: false
  initContainers:
  - command:
    - /bin/sh
    - -c
    - until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done
    envFrom:
    - secretRef:
        name: '{{ tpl .Values.envFromSecret . }}'
    image: '{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}'
    imagePullPolicy: '{{ .Values.initImage.pullPolicy }}'
    name: wait-for-postgres
  podAnnotations: {}
  podLabels: {}
  podSecurityContext: {}
  resources: {}
supersetNode:
  command:
  - /bin/sh
  - -c
  - . {{ .Values.configMountPath }}/superset_bootstrap.sh; /usr/bin/run-server.sh
  connections:
    db_host: '{{ template "superset.fullname" . }}-postgresql'
    db_name: superset
    db_pass: superset
    db_port: "5432"
    db_user: superset
    redis_host: '{{ template "superset.fullname" . }}-redis-headless'
    redis_port: "6379"
  containerSecurityContext: {}
  deploymentAnnotations: {}
  env: {}
  forceReload: false
  initContainers:
  - command:
    - /bin/sh
    - -c
    - until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done
    envFrom:
    - secretRef:
        name: '{{ tpl .Values.envFromSecret . }}'
    image: '{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}'
    imagePullPolicy: '{{ .Values.initImage.pullPolicy }}'
    name: wait-for-postgres
  livenessProbe:
    failureThreshold: 3
    initialDelaySeconds: 15
    periodSeconds: 15
    successThreshold: 1
    timeoutSeconds: 1
  podAnnotations: {}
  podLabels: {}
  podSecurityContext: {}
  readinessProbe:
    failureThreshold: 3
    initialDelaySeconds: 15
    periodSeconds: 15
    successThreshold: 1
    timeoutSeconds: 1
  replicaCount: 1
  resources: {}
supersetWorker:
  command:
  - /bin/sh
  - -c
  - . {{ .Values.configMountPath }}/superset_bootstrap.sh; celery --app=superset.tasks.celery_app:app
    worker
  containerSecurityContext: {}
  deploymentAnnotations: {}
  forceReload: false
  initContainers:
  - command:
    - /bin/sh
    - -c
    - until nc -zv $DB_HOST $DB_PORT -w1; do echo 'waiting for db'; sleep 1; done
    envFrom:
    - secretRef:
        name: '{{ tpl .Values.envFromSecret . }}'
    image: '{{ .Values.initImage.repository }}:{{ .Values.initImage.tag }}'
    imagePullPolicy: '{{ .Values.initImage.pullPolicy }}'
    name: wait-for-postgres
  podAnnotations: {}
  podLabels: {}
  podSecurityContext: {}
  replicaCount: 1
  resources: {}

Environment

EKS

  • chart version : superset-0.10.4
  • superset version: 2.1.0
@sebastianliebscher
Copy link
Contributor

This is weird. You get an error by this code change #24045 because you don't have sqlparse-0.4.4 installed. But apache-superset-2.1.0 does not include this code change, see https://github.com/apache/superset/blob/2.1.0/superset/sql_parse.py

@rusackas
Copy link
Member

rusackas commented Mar 6, 2024

Hi there, and sorry this has gone quiet for so long. We're no longer supporting Superset 2.x or prior, and it's been a while since this thread saw any activity, so I'm closing this as stale. If it is still an issue in Superset 3.x, we can re-open this, or feel free to open a new issue with updated context.

@rusackas rusackas closed this as completed Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants