helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

[BUG] Upgrade to > 2.0.0 deleted PVC together with all data

Open NotANormalNerd opened this issue 1 year ago • 7 comments

Describe the bug When upgrading the helm-chart from 1.x to 2.x my whole setup is being deleted including the PVC, which subsequently deletes all my data and e-mails.

Subsequently having a fresh install, I can't access the admin because of "Internal Server Error"

helm_v3 install --namespace mailu-v2 --version 2.1.1 mailu-v2 mailu-v2/mailu --values /config/values-01_HelmChart.yaml

Environment

  • K3s

Additional context

    mariadb:
      enabled: false
    postgresql:
      enabled: false
    domain: example.com
    hostnames:
    - mail.example.com
    admin:
      extraEnvVars:
      - name: LD_PRELOAD
        value: /usr/lib/libhardened_malloc.so
      - name: DEBUG
        value: "true"
    ingress:
      annotations:
        cert-manager.io/cluster-issuer: letsencrypt-production
        nginx.ingress.kubernetes.io/proxy-body-size: "0"
        traefik.ingress.kubernetes.io/router.middlewares: default-redirect-https@kubernetescrd
      className: ""
      enabled: true
      realIpFrom: 0.0.0.0/0
      realIpHeader: X-Forwarded-For
    initialAccount:
      domain: example.com
      password: chang3m3!
      username: mailadmin
    persistence:
      accessMode: ReadWriteOnce
      single_pvc: true
      size: 11Gi
    postmaster: postmaster
    webmail:
      enabled: false
    secretKey: blablabla
    front:
      hostPort:
        enabled: false
      externalService:
        enabled: True
        type: LoadBalancer
        ports:
          pop3: false
          pop3s: true
          imap: false
          imaps: true
          smtp: true
          smtps: true
          submission: true

NotANormalNerd avatar Aug 22 '24 12:08 NotANormalNerd

@NotANormalNerd I had the same issue with admin access, here's how I fixed it (assuming you are using Traefik like me):

  1. Turn off the ingress in values.yaml (set enabled: false), it used to point to port 80 on mailu-front, but now points to port 443, which causes Traefik to throw an error 500 because the backend certificate is not valid for the domain [service].[namespace].svc.[cluster-domain]
  2. Create a servers transport for mailu-front (make sure your cluster domain is cluster.local or change it in serverName below to match).
    apiVersion: traefik.io/v1alpha1
    kind: ServersTransport
    metadata:
      name: mailu-web
    spec:
      serverName: mailu-front.[namespace].svc.cluster.local
      insecureSkipVerify: true # <-- This fixes the issue
    
  3. Create manually an ingress (and certificate if needed), but change the services to use the new servers transport.
    services:
      - name: mailu-front
        serversTransport: mailu-web
        port: 443
    

dlford avatar Sep 07 '24 21:09 dlford

The removal of the PVC is documented behaviour in https://github.com/Mailu/helm-charts/blob/master/mailu/MIGRATION_GUIDE.md

WebSpider avatar Sep 10 '24 13:09 WebSpider

@WebSpider This migration guide applies for migrating to 1.0.0 grafik If this also applies to 2.0.0 then at least the documentation should be updated.

NotANormalNerd avatar Sep 10 '24 19:09 NotANormalNerd

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Oct 11 '24 02:10 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Oct 16 '24 02:10 github-actions[bot]

@NotANormalNerd thank you for reporting this, could you tell me exactly from which version you were upgrading and to which one? How did you perform the upgrade? This should not happen indeed but there were no changes to the pvc when using single_pvc since 1.0.0-beta.23. https://github.com/Mailu/helm-charts/commit/d00d768f2b82fae5c142d6b92fff0f475e4c566a

fastlorenzo avatar Dec 22 '24 23:12 fastlorenzo

The last 1.5 version of the Chart to the 2.0 and even the 2.1 version of the Chart.

NotANormalNerd avatar Dec 28 '24 15:12 NotANormalNerd

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Aug 31 '25 02:08 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Sep 06 '25 02:09 github-actions[bot]