audacioustux / mautic-chart

Helm Chart and Container Image for Mautic
https://audacioustux.github.io/mautic-chart/
7 stars 0 forks source link

Helm installation failure caused by "mysql: command not found" #1

Closed dabuv closed 2 months ago

dabuv commented 2 months ago

Hi!

we are trying to deploy mautic app in our K8s cluster using Helm Chart. The database we use is MySQL. We prepared all the required PV, DB and variables using chart values and manual configMaps. The installation process is stuck at the initial state where pod named mautic has logs:

Waiting for Mautic to be installed...

But pod named mautic-install has logs: Creating database mautic, if it does not already exist... /entrypoint.sh: line 12: mysql: command not found and eventually it just dissapears from pod list

other pods can't start because of missing tables

All pods state looks like this:

pod/mautic-7b557fbbbf-72tng 0/1 Running 2 (2m58s ago) 14m pod/mautic-broadcasts-send-28689764-n5lks 0/1 CrashLoopBackOff 4 (55s ago) 2m39s pod/mautic-campaigns-rebuild-28689765-cwgrm 1/1 Running 4 (48s ago) 101s pod/mautic-campaigns-trigger-28689764-rtlgp 0/1 CrashLoopBackOff 3 (26s ago) 107s pod/mautic-import-28689764-vk9ht 0/1 CrashLoopBackOff 4 (31s ago) 2m pod/mautic-messages-send-28689765-5ch4b 0/1 CrashLoopBackOff 4 (19s ago) 116s pod/mautic-messenger-consume-email-54679cc646-fsp2v 1/1 Running 0 14m pod/mautic-messenger-consume-failed-5454b5568c-b6zkf 1/1 Running 0 14m pod/mautic-messenger-consume-hit-79bc9cbfd9-ctnvm 1/1 Running 0 14m pod/mautic-segments-update-28689765-qn57v 0/1 CrashLoopBackOff 3 (23s ago) 77s

The MySQL database dedicated for mautic gets only messenger_messages table created

I tried installing Helm chart with values where repository is set to docker.io/tanjim/mautic and tried two tags which are:

with no luck. It seems that docker image of pod mautic-install doesn't have all requirements to succeed. If that's not the case can You please provide me with some instructions about this helm deployment?

audacioustux commented 2 months ago

Sorry for the late reply, my country was cut-off from the internet past few days...

Not sure why that error would occur. can you delete the database, then set all the cron and messenger helm value to: enable: false and retry... probably one of them creating the database before the actual mautic:install. Still not sure why it can't find mysql command though

dabuv commented 2 months ago

No problem.

I did the install on empty remote database where single table was created. The problem with mysql package looks like container itself doesn't have it installed, did You test it with MySQL database?

What is the right values.yaml for this helm deployment when I want to use my remote database where I create the database myself but without tables?

The second install with crons and messenger disabled still ends up with

kubectl logs mautic-install-1721840041-gl484 -n mautic
Creating database mautic, if it does not already exist...
/entrypoint.sh: line 12: mysql: command not found

Best regards

audacioustux commented 2 months ago

I'm using AWS Aurora MySQL, so things should be the same. My internet is still too slow for me to check things. I think I've probably missed out the mariadb-client package in the final image here: https://github.com/audacioustux/mautic-chart/blob/main/dockerfile#L52 which was present previously here: https://github.com/audacioustux/mautic-chart/blob/e3053e424d612f7cd30e69477bae36fe3809ed41/dockerfile#L75 - my bad... but at this moment I can't build and push a new container image. I've added the package in latest commit... can you build the image with the latest Dockerfile, and use that as a workaround for now?

audacioustux commented 2 months ago

you may use the commands in Taskfile.yml in root directory in this repo btw, to build the images. then replace the repository and tag in helm values (check the values.yaml for reference)

dabuv commented 2 months ago

Took some time to build these but I think I managed to do that. The mautic-install pod successfuly created the tables in my database. Thanks for support!

Any way You can help me with the main "mautic" pod returning

Warning  Unhealthy         9s (x12 over 119s)  kubelet            Startup probe failed:

The probes in helm chart looks like these

    readinessProbe: &probe
      # check if request to /s/login returns 301 (redirect) status code
      exec:
        command:
          - sh
          - -c
          - |
            if [ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost/s/login)" != "301" ]; then
              exit 1
            fi
      timeoutSeconds: 2
    livenessProbe:
      <<: *probe
      timeoutSeconds: 10
    startupProbe:
      <<: *probe
      failureThreshold: 30
      periodSeconds: 10

After deleting the probes from deployment, the website returns

Oops! An Error Occurred
The server returned a "500 Internal Server Error".

Best regards

audacioustux commented 2 months ago

hmmmm... can you tail the log files in var/logs/ and see if there's any error logs there? `tail -f var/logs/` probably should work

dabuv commented 2 months ago

Actually nothing was there so I ran "dmesg -T" inside the container which returned

[Thu Jul 25 17:59:16 2024] Memory cgroup out of memory: Killed process 3762158 (java) total-vm:8693716kB, anon-rss:2025280kB, file-rss:17076kB, shmem-rss:0kB, UID:2000 pgtables:5352kB oom_score_adj:985
audacioustux commented 2 months ago

ummm weird... there shouldn't be any java process in the container as of my knowledge... is the pod being OOM killed?

dabuv commented 2 months ago

Somehow pod might have escalated privileges and it wasn't his dmesg.

Logs from filesystem and pod are attached in file logs1.txt

Anyway, I think I will try my luck with other helm for Matuic with integrated postgres into separate pod.

As my initial issue Was resolved I will close this issue for now.

It would be awesome to upload new container build with corrected dockerfile to registry when You will be able to :)

audacioustux commented 2 months ago

I've no idea when this internet issue will be resolved in my country.... It's getting extremely frustrating for me. Hope you can find a way to run Mautic properly soon. I had to resolve a lot of issues too to do that, so you may find this repo as a good reference. I'm not sure if Mautic even has a stable postgres integration though.

audacioustux commented 2 months ago

@dabuv pushed the new image and helm release

dabuv commented 2 months ago

Hi! thanks @audacioustux for keeping me posted! I deployed new chart version but the app and all the pods have status shown below:

NAME                                               READY   STATUS      RESTARTS      AGE
mautic-64b4c6dfbf-h5jns                            0/1     Running     1 (18s ago)   6m19s
mautic-broadcasts-send-28703365-9pcb5              0/1     Completed   0             37s
mautic-campaigns-rebuild-28703365-pl25b            0/1     Completed   0             37s
mautic-campaigns-trigger-28703364-szcqc            0/1     Completed   0             97s
mautic-import-28703364-lbjm6                       0/1     Completed   0             97s
mautic-install-1722201558-l5qbx                    0/1     Completed   0             6m19s
mautic-messages-send-28703365-l5gkb                0/1     Completed   0             37s
mautic-messenger-consume-email-7855555c49-cvdm4    1/1     Running     0             6m19s
mautic-messenger-consume-failed-79665cfcdb-p7jbk   1/1     Running     0             6m19s
mautic-messenger-consume-hit-c9d64b78-9vn9x        1/1     Running     0             6m19s
mautic-segments-update-28703364-7mdlv              0/1     Completed   0             97s

but the app pod has some kind of problems

Waiting for Mautic to be installed...
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.32.54.59. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 10.32.54.59. Set the 'ServerName' directive globally to suppress this message
[Sun Jul 28 21:20:00.517704 2024] [mpm_prefork:notice] [pid 20:tid 20] AH00163: Apache/2.4.61 (Debian) PHP/8.1.29 configured -- resuming normal operations
[Sun Jul 28 21:20:00.517762 2024] [core:notice] [pid 20:tid 20] AH00094: Command line: 'apache2 -D FOREGROUND'
127.0.0.1 - - [28/Jul/2024:21:20:09 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:20:19 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:20:29 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:20:39 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:20:49 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:20:59 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:21:09 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:21:19 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:21:29 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:21:39 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:21:49 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:21:59 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:22:09 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:22:19 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:22:29 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:22:39 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:22:49 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:22:59 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:23:09 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:23:19 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:23:29 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:23:39 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:23:49 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:23:59 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"
127.0.0.1 - - [28/Jul/2024:21:24:09 +0000] "GET /s/login HTTP/1.1" 500 1054 "-" "curl/7.88.1"

the files inside the pod are getting created

root@mautic-64b4c6dfbf-h5jns:/var/www/html# ls -la
total 888
drwxrwxrwt.  1 www-data www-data     17 Jul 28 13:03 .
drwxr-xr-x.  1 root     root         18 Jul 23 06:39 ..
-rw-r--r--.  1 www-data www-data    790 Jul 28 13:01 .env
-rw-r--r--.  1 www-data www-data   2812 Jul 28 13:01 .gitignore
-rw-r--r--.  1 www-data www-data   6300 Jun 13 09:03 README.md
drwxr-xr-x.  1 www-data www-data     53 Jun 25 07:47 bin
-rw-r--r--.  1 www-data www-data   4489 Jul 28 13:03 composer.json
-rw-r--r--.  1 www-data www-data 609777 Jul 28 13:02 composer.lock
drwxr-xr-x.  2 root     root          1 Jul 28 21:25 config
drwxr-xr-x.  8 www-data www-data    190 Jul 28 13:03 docroot
-rw-r--r--.  1 www-data www-data    110 Jul 28 13:01 modernizr-config.json
-rw-r--r--.  1 www-data www-data 253373 Jul 28 13:01 package-lock.json
-rw-r--r--.  1 www-data www-data   2732 Jul 28 13:01 package.json
drwxr-xr-x.  2 www-data www-data     60 Jul 28 13:01 patches
-rw-r--r--.  1 www-data www-data    532 Jul 28 13:01 tsconfig.json
drwxr-xr-x.  1 www-data www-data     36 Jul 28 21:25 var
drwxr-xr-x. 76 www-data www-data   4096 Jul 28 13:02 vendor
-rw-r--r--.  1 www-data www-data   1844 Jul 28 13:01 webpack.config.js

are there any additional steps I should take?

audacioustux commented 2 months ago

hmmm... you may find errors logged in var/logs/* I guess... here's my helm values btw for reference:

{
            mautic: {
              secret: {
                MAUTIC_ADMIN_EMAIL: config.admin.email,
                MAUTIC_ADMIN_PASSWORD: mauticPassword,
              },
              persistence: {
                storageClass: 'efs',
                accessMode: 'ReadWriteMany',
              },
              db: {
                configMap: {
                  MAUTIC_DB_HOST: mysqlCluster.endpoint,
                  MAUTIC_DB_HOST_RO: mysqlCluster.readerEndpoint,
                  MAUTIC_DB_NAME: 'mautic',
                },
                secret: {
                  MAUTIC_DB_USER: mysqlCredentials.username,
                  MAUTIC_DB_PASSWORD: mysqlCredentials.password,
                  MAUTIC_MAILER_DSN:
                    'ses+api://iam_user:iam_pass@default:465?region=us-west-2',
                },
              },
              web: {
                hpa: {
                  minReplicas: 3,
                },
                vpa: {
                  enabled: true,
                },
              },
              install: {
                siteUrl: 'https://mt.example.com',
              },
            },
            // kubectl create configmap ct-favicon --from-file favicon.ico -n ct-apps-prod
            volumes: [
              {
                name: 'favicon',
                configMap: {
                  name: 'ct-favicon',
                },
              },
            ],
            volumeMounts: [
              {
                name: 'favicon',
                mountPath: '/var/www/html/docroot/favicon.ico',
                subPath: 'favicon.ico',
              },
              {
                name: 'favicon',
                mountPath: '/var/www/html/docroot/app/assets/images/favicon.ico',
                subPath: 'favicon.ico',
              },
            ],
            ingress: {
              annotations: {
                'cert-manager.io/cluster-issuer': clusterIssuers.letsencryptProd,
              },
              hosts: [
                {
                  host: 'mt.example.com',
                  paths: [
                    {
                      path: '/',
                      pathType: 'Prefix',
                    },
                  ],
                },
              ],
              tls: [
                {
                  hosts: ['mt.example.com'],
                  secretName: 'mt-example-com-tls',
                },
              ],
            }
}
dabuv commented 2 months ago

There is nothing interesting in logs. Main apache2 logs are streamed to stderr and stdout

lrwxrwxrwx. 1 www-data www-data 11 Jul 23 06:43 access.log -> /dev/stdout
lrwxrwxrwx. 1 www-data www-data 11 Jul 23 06:43 error.log -> /dev/stderr
lrwxrwxrwx. 1 www-data www-data 11 Jul 23 06:43 other_vhosts_access.log -> /dev/stdout

and the logs You mentioned returned some info just on first run of the app

root@mautic-64b4c6dfbf-h5jns:/var/www/html# tail -f var/logs/mautic_prod-2024-07-28.php
[2024-07-28T21:19:57.124774+00:00] mautic.ERROR: Doctrine\Migrations\Exception\MetadataStorageError: The metadata storage is not initialized, please run the sync-metadata-storage command to fix this issue. (uncaught exception) at /var/www/html/vendor/doctrine/migrations/src/Exception/MetadataStorageError.php line 18 while running console command `doctrine:migrations:version` [stack trace] #0 /var/www/html/vendor/doctrine/migrations/src/Metadata/Storage/TableMetadataStorage.php(221): Doctrine\Migrations\Exception\MetadataStorageError::notInitialized() #1 /var/www/html/vendor/doctrine/migrations/src/Metadata/Storage/TableMetadataStorage.php(122): Doctrine\Migrations\Metadata\Storage\TableMetadataStorage->checkInitialization() #2 /var/www/html/vendor/doctrine/migrations/src/Tools/Console/Command/VersionCommand.php(244): Doctrine\Migrations\Metadata\Storage\TableMetadataStorage->complete(Object(Doctrine\Migrations\Version\ExecutionResult)) #3 /var/www/html/vendor/doctrine/migrations/src/Tools/Console/Command/VersionCommand.php(159): Doctrine\Migrations\Tools\Console\Command\VersionCommand->mark(Object(Symfony\Component\Console\Input\ArgvInput), Object(Doctrine\Migrations\Version\Version), true, Object(Doctrine\Migrations\Metadata\ExecutedMigrationsList)) #4 /var/www/html/vendor/doctrine/migrations/src/Tools/Console/Command/VersionCommand.php(123): Doctrine\Migrations\Tools\Console\Command\VersionCommand->markVersions(Object(Symfony\Component\Console\Input\ArgvInput)) #5 /var/www/html/vendor/symfony/console/Command/Command.php(298): Doctrine\Migrations\Tools\Console\Command\VersionCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\BufferedOutput)) #6 /var/www/html/vendor/symfony/console/Application.php(1058): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\BufferedOutput)) #7 /var/www/html/vendor/symfony/framework-bundle/Console/Application.php(96): Symfony\Component\Console\Application->doRunCommand(Object(Doctrine\Migrations\Tools\Console\Command\VersionCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\BufferedOutput)) #8 /var/www/html/vendor/symfony/console/Application.php(301): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand(Object(Doctrine\Migrations\Tools\Console\Command\VersionCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\BufferedOutput)) #9 /var/www/html/vendor/symfony/framework-bundle/Console/Application.php(82): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\BufferedOutput)) #10 /var/www/html/vendor/symfony/console/Application.php(171): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\BufferedOutput)) #11 /var/www/html/docroot/app/bundles/InstallBundle/Install/InstallService.php(499): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\BufferedOutput)) #12 /var/www/html/docroot/app/bundles/InstallBundle/Command/InstallCommand.php(434): Mautic\InstallBundle\Install\InstallService->finalMigrationStep() #13 /var/www/html/docroot/app/bundles/InstallBundle/Command/InstallCommand.php(340): Mautic\InstallBundle\Command\InstallCommand->stepAction(Object(Mautic\InstallBundle\Install\InstallService), Array, 3) #14 /var/www/html/vendor/symfony/console/Command/Command.php(298): Mautic\InstallBundle\Command\InstallCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Mautic\CoreBundle\Console\Output\ConsoleDatetimeOutput)) #15 /var/www/html/vendor/symfony/console/Application.php(1058): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Mautic\CoreBundle\Console\Output\ConsoleDatetimeOutput)) #16 /var/www/html/vendor/symfony/framework-bundle/Console/Application.php(96): Symfony\Component\Console\Application->doRunCommand(Object(Mautic\InstallBundle\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Mautic\CoreBundle\Console\Output\ConsoleDatetimeOutput)) #17 /var/www/html/vendor/symfony/console/Application.php(301): Symfony\Bundle\FrameworkBundle\Console\Application->doRunCommand(Object(Mautic\InstallBundle\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Mautic\CoreBundle\Console\Output\ConsoleDatetimeOutput)) #18 /var/www/html/vendor/symfony/framework-bundle/Console/Application.php(82): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Mautic\CoreBundle\Console\Output\ConsoleDatetimeOutput)) #19 /var/www/html/vendor/symfony/console/Application.php(171): Symfony\Bundle\FrameworkBundle\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Mautic\CoreBundle\Console\Output\ConsoleDatetimeOutput)) #20 /var/www/html/bin/console(16): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Mautic\CoreBundle\Console\Output\ConsoleDatetimeOutput)) #21 {main} [] {"hostname":"mautic-install-1722201558-l5qbx","pid":10}
[2024-07-28T21:19:57.131217+00:00] mautic.WARNING: Command `doctrine:migrations:version` exited with status code 1 [] {"hostname":"mautic-install-1722201558-l5qbx","pid":10}

so I ran

php bin/console doctrine:migration:sync-metadata-storage

inside the container and it returned

[OK] Metadata storage synchronized

and then i restarted the container but the issue still persists

image

my values.yaml looks like below

nameOverride: ""
fullnameOverride: ""

mautic:
  image:
    repository: docker.io/tanjim/mautic
    pullPolicy: IfNotPresent
    tag: "5.1.26"

  # existingConfigMap: ""
  # ignore the following values if existingConfigMap is set
  configMap:
    # optional, if siteUrl is set in install
    # SITE_URL: "https://localhost:8080"
    SITE_URL: "https://mautic.mydomain.pl"
    # messenger
    MAUTIC_MESSENGER_DSN_EMAIL: "doctrine://default"
    MAUTIC_MESSENGER_DSN_HIT: "doctrine://default"

  # existingSecret: ""
  # ignore the following values if existingSecret is set
  secret:
    # admin
    MAUTIC_ADMIN_USERNAME: "admin"
    MAUTIC_ADMIN_EMAIL: "dawid.burzykowski@mydomain.pl"
    MAUTIC_ADMIN_PASSWORD: "MYPASSWORD"
    # mailer
    # MAUTIC_MAILER_DSN: "smtp://user:pass@localhost:587"

  persistence:
    accessMode: ReadWriteMany
    # example: efs, nfs, etc.
    # storageClass: "nfs"
    storageClass: "csi-cephfs-sc"

  web:
    resources:
      limits:
        memory: 1024Mi
      requests:
        cpu: 200m
        memory: 512Mi
    hpa:
      enabled: true
      minReplicas: 1
      maxReplicas: 10
      targetCPU: 80
    vpa:
      enabled: false
      minMemory: 256Mi
      maxMemory: 1024Mi
    readinessProbe: &probe
      # check if request to /s/login returns 301 (redirect) status code
      exec:
        command:
          - sh
          - -c
          - |
            if [ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost/s/login)" != "301" ]; then
              exit 1
            fi
      timeoutSeconds: 2
    livenessProbe:
      <<: *probe
      timeoutSeconds: 10
    startupProbe:
      <<: *probe
      failureThreshold: 30
      periodSeconds: 10

  install:
    # optional, if SITE_URL is not set in configMap
    # siteUrl: "https://mautic.mydomain.pl"
    resources:
      limits:
        memory: 384Mi
      requests:
        memory: 256Mi

  db:
    create: false
    # existingConfigMap: ""
    # ignore the following values if existingConfigMap is set
    configMap:
      MAUTIC_DB_HOST: 10.0.0.5
      # MAUTIC_DB_HOST_RO: mysql-ro
      MAUTIC_DB_PORT: "3306"
      MAUTIC_DB_NAME: mautic

    # existingSecret: ""
    # ignore the following values if existingSecret is set
    secret:
      MAUTIC_DB_USER: mautic
      MAUTIC_DB_PASSWORD: MYDBPASSWORD

  cron:
    campaignsRebuild:
      enabled: true
      schedule: "*/5 * * * *"
      batchLimit: 300
      maxContacts: 5000
      resources: &cron_resources
        limits:
          memory: 256Mi
        requests:
          memory: 128Mi
    import:
      enabled: true
      schedule: "*/4 * * * *"
      limit: 5000
      resources: *cron_resources
    segmentsUpdate:
      enabled: true
      schedule: "*/3 * * * *"
      batchLimit: 300
      maxContacts: 5000
      resources: *cron_resources
    campaignsTrigger:
      enabled: true
      schedule: "*/2 * * * *"
      batchLimit: 100
      campaignLimit: 500
      resources: *cron_resources
    broadcastsSend:
      enabled: true
      schedule: "*/1 * * * *"
      resources: *cron_resources
    messagesSend:
      enabled: true
      schedule: "*/1 * * * *"
      resources: *cron_resources

  messenger:
    consumeEmail:
      enabled: true
      resources: &message_resources
        limits:
          memory: 512Mi
        requests:
          memory: 256Mi
      debug: false
    consumeFailed:
      enabled: true
      resources: *message_resources
      debug: false
    consumeHit:
      enabled: true
      resources: *message_resources
      debug: false

service:
  type: ClusterIP
  port: 80
  sessionAffinity: ClientIP
  sessionAffinityConfig:
    clientIP:
      timeoutSeconds: 3600

ingress:
  enabled: enabled
  className: "nginx"
  annotations: {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
    # cert-manager.io/cluster-issuer: letsencrypt-prod
  hosts:
    - host: mautic.mydomain.pl
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: wildcard-mydomain-pl-tls
      hosts:
        - mautic.mydomain.pl

volumes:
- name: favicon
  configMap:
    name: ct-favicon
volumeMounts:
- mountPath: /var/www/html/docroot/favicon.ico
  subPath: favicon.ico
  name: favicon
audacioustux commented 2 months ago

have you tried cleaning up all the pvc and recreating the db? without the logs, not sure how to debug this... but still, check if:

  1. the site_url looks ok in config/local.php
  2. nfs mounts are actually writable inside the mautic pod
  3. database is accessible from inside the mautic pod
  4. recheck the values in config/local.php ... sometimes mautic fails to properly populate / handle special characters in the local.php
  5. check the output for curl -s http://localhost/s/login inside the mautic pod
dabuv commented 2 months ago

I found some old post where someone stated that it was privilege problem so I then reached to all created PVC and ran

chown -R www-data:www-data *
chmod -R 775 *

and then I connected to pod via "kubectl exec" and did the same in home directory.

The problem went away!

Sorry for troubling You but also huge thanks to You for amazing cooperation and Your commitment to solving the issue!

audacioustux commented 2 months ago

Great! I know you're not using EFS, but still dropping my EFS storage class config here:

Screenshot 2024-07-29 at 6 04 47 AM

NOTE (for future reference): chown/chmod creates problem in EFS volumes, so had to avoid those from the dockerfile completely.