getredash / contrib-helm-chart

Community maintained Redash Helm Chart
Apache License 2.0
163 stars 143 forks source link

Redash mail setup with ses with helm on eks #151

Closed mihiran-fc closed 1 year ago

mihiran-fc commented 1 year ago

I'm trying to configure the mail server for redash with ses and the below configuration in my helm chart. I've stored my mail password and username in the abc-secret. It's getting deployed successfully but I'm unable to see any of the emails getting triggered for my alerts nor for the invitations. Is there any where I can see the logs related to this mail server in redash to find out what's the issue? I tried checking the logs for all the pods but it's in vain. I'm able to send test mails from my ses so I think no issues with ses I presume. Could you guys please help me if I miss any configuration or how to trouble shoot this issue.

I tried with port 587 , 2465 and still it didn't work

  redash:
    existingSecret: abc-secret
    logLevel: DEBUG
    mailServer: email-smtp.{region}.amazonaws.com
    mailPort: 465
    mailUseTls: true
    mailUseSsl: true
    mailDefaultSender: abc@abc.com
    host: https://abcd.com
mihiran-fc commented 1 year ago

found this issue in the logs:

[PID:32][ERROR][root] Mail send error.  
    response = encode_base64(initial_response.encode('ascii'), eol='')                                                                                                                                             │
│ UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 27: ordinal not in range(128)

Any idea guys how to fix this?

mihiran-fc commented 1 year ago

I see there is this PR that got merged #3137 but not sure which image it got merged to, I tried all versions mentioned below but no luck.

10.1.0.b50633 10.0.0.b50363 8.0.0.b32245

mihiran-fc commented 1 year ago

This is the full error


Traceback (most recent call last):                                                                                                                                                                               │
│   File "/app/redash/destinations/email.py", line 52, in notify                                                                                                                                                   │
│     mail.send(message)                                                                                                                                                                                           │
│   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 491, in send                                                                                                                                 │
│     with self.connect() as connection:                                                                                                                                                                           │
│   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 144, in __enter__                                                                                                                            │
│     self.host = self.configure_host()                                                                                                                                                                            │
│   File "/usr/local/lib/python3.8/site-packages/flask_mail.py", line 165, in configure_host                                                                                                                       │
│     host.login(self.mail.username, self.mail.password)                                                                                                                                                           │
│   File "/usr/local/lib/python3.8/smtplib.py", line 737, in login                                                                                                                                                 │
│     (code, resp) = self.auth(                                                                                                                                                                                    │
│   File "/usr/local/lib/python3.8/smtplib.py", line 639, in auth                                                                                                                                                  │
│     response = encode_base64(initial_response.encode('ascii'), eol='')                                                                                                                                           │
│ UnicodeEncodeError: 'ascii' codec can't encode character '\ufffd' in position 27: ordinal not in range(128) 

I see there is this PR that got merged #2605 #3137 but not sure which image it got merged to, I tried all versions mentioned below but no luck.

10.1.0.b50633 10.0.0.b50363 8.0.0.b32245 preview

mihiran-fc commented 1 year ago

I think I found the issue, I'm passing the secret value as is without encoding it so, redash is trying to decode the un encoded secret and it's getting some random string which it is passing to the app pod. That's the reason the log it generated with some ascii codec issues.