audacioustux / mautic-chart

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

Stale mailer_dsn in cache #2

Closed khozzy closed 3 months ago

khozzy commented 3 months ago

Despite setting the MAUTIC_MAILER_DSN in values.yaml file, the mailer_dsn is still invalid in some files.

Reproduction:

$ minikube version
minikube version: v1.33.1
commit: 5883c09216182566a63dff4c326a6fc9ed2982ff

$ helm version
version.BuildInfo{Version:"v3.15.4", GitCommit:"fa9efb07d9d8debbb4306d72af76a383895aa8c4", GitTreeState:"clean", GoVersion:"go1.22.6"}

I'm setting the secrets like:

MAUTIC_MAILER_DSN: "smtp://mailhog.default.svc.cluster.local:1025"

To start the container correctly, I figured out that the following commands are needed to pass health-check probes.

chown -R 33:33 /var/www/html/var/cache /var/www/html/var/logs
chmod -R 755 /var/www/html/var/cache /var/www/html/var/logs
su www-data -s /bin/sh -c "php bin/console cache:clear"

The mailer_dsn is set correctly in the config/local.php file. However, when I try to send an email from an app, I see errors in the logs, related to using invalid SMTP connection details.

grep -rl "localhost:25" .
./var/cache/prod/Container3hLPbC2/AppKernelProdContainer.php
./var/tmp/twig/2a/2ac3ca4e462fb5f2fdf52ae44b09da2a.php
./docroot/app/bundles/EmailBundle/Config/config.php

I guess the file in docroot/ directory is causing troubles. Should I rebuild the app somehow based on the config/local.php? Sending test mail in Mautic's "E-mail Preferences" works fine.

audacioustux commented 3 months ago

hmmm... yah... i guess some process has to be added to detect any configuration change, and run cache:clear automatically... but cache:clear don't remove the cached localhost:25?

khozzy commented 3 months ago

Surprisingly not. My shot is that it is recreated from the docroot/, which is created before reading overwritten config (but I'm not a PHP dev)

audacioustux commented 3 months ago

hummm.. neither me... i just followed their official dockerfile, and made some changes+updates... not sure how may i help you :(

khozzy commented 3 months ago

Nvm, I recreated the whole updated stack, and it seems to be working now. Thanks