Giter Club home page Giter Club logo

Comments (15)

cuu508 avatar cuu508 commented on July 19, 2024

I tested the following:

docker run --rm -it \
  --name=ls-healthchecks \
  -e DB_NAME=/tmp/hc.sqlite \
  -e [email protected] \
  -e EMAIL_HOST=smtp.gmail.com \
  -e EMAIL_PORT=587 \
  -e [email protected] \
  -e EMAIL_HOST_PASSWORD=FIXME-VALID-PASSWORD \
  -e EMAIL_USE_TLS=True \
  -p 8000:8000 \
  lscr.io/linuxserver/healthchecks:latest

I used the signup form and email arrived.

I then tested the same, but with a deliberately incorrect password. After sending email, I saw an error message in container logs:

[pid: 177|app: 0|req: 3/3] 172.17.0.1 () {48 vars in 849 bytes} [Mon Jun 19 13:55:42 2023] POST /accounts/signup/ => generated 54 bytes in 390 msecs (HTTP/1.1 200) 8 headers in 331 bytes (1 switches on core 0)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.11/threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "/app/healthchecks/hc/lib/emails.py", line 25, in run
    self.message.send()
  File "/lsiopy/lib/python3.11/site-packages/django/core/mail/message.py", line 298, in send
    return self.get_connection(fail_silently).send_messages([self])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 127, in send_messages
    new_conn_created = self.open()
                       ^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 94, in open
    self.connection.login(self.username, self.password)
  File "/usr/lib/python3.11/smtplib.py", line 750, in login
    raise last_exception
  File "/usr/lib/python3.11/smtplib.py", line 739, in login
    (code, resp) = self.auth(
                   ^^^^^^^^^^
  File "/usr/lib/python3.11/smtplib.py", line 662, in auth
    raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8  https://support.google.com/mail/?p=BadCredentials g24-20020a2e9cd8000000b002ad988efd73sm2510020ljj.14 - gsmtp')

from healthchecks.

samcro1967 avatar samcro1967 commented on July 19, 2024

I am not getting an error message so I don't think it is a bad password issue. I created a new Gmail app password and it never shows up in the Gmail dashboard that the password was used when I try to signup a new user. I can take that same password and set it up in another app. It works and the password then shows as used. Seem like the email never leaves the app and reaches Gmail even though there are no error messages.

from healthchecks.

rangitoto72 avatar rangitoto72 commented on July 19, 2024

I too have the same issue.
Fresh docker install this evening using lscr.io/linuxserver/healthchecks:latest
I created a new Username / Password in ny mail server, i can send emails too and from this account using another application i have by updating to the new credentials.

However when using the credentials with this docker image:

Nothing comes to my inbox.

File "/lsiopy/lib/python3.11/site-packages/django/core/mail/message.py", line 298, in send
return self.get_connection(fail_silently).send_messages([self])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/lsiopy/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 127, in send_messages
new_conn_created = self.open()
^^^^^^^^^^^
File "/lsiopy/lib/python3.11/site-packages/django/core/mail/backends/smtp.py", line 94, in open
self.connection.login(self.username, self.password)
File "/usr/lib/python3.11/smtplib.py", line 750, in login
raise last_exception
File "/usr/lib/python3.11/smtplib.py", line 739, in login
(code, resp) = self.auth(
^^^^^^^^^^
File "/usr/lib/python3.11/smtplib.py", line 662, in auth

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

@samcro1967, @rangitoto72 can you try the command that I used, swap in your username and password, leave everything else as-is?

docker run --rm -it \
  --name=ls-healthchecks \
  -e DB_NAME=/tmp/hc.sqlite \
  -e [email protected] \
  -e EMAIL_HOST=smtp.gmail.com \
  -e EMAIL_PORT=587 \
  -e [email protected] \
  -e EMAIL_HOST_PASSWORD=FIXME-VALID-PASSWORD \
  -e EMAIL_USE_TLS=True \
  -p 8000:8000 \
  lscr.io/linuxserver/healthchecks:latest

from healthchecks.

samcro1967 avatar samcro1967 commented on July 19, 2024

That worked. The only difference is the DB_NAME. Maybe my DB is corrupt somehow?

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

@samcro1967 the other difference is using plain docker vs docker-compose. Perhaps variable substitution in your docker-compose.yml is not working properly?

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

Ah, also, the Linuxserver image has this REGENERATE_SETTINGS thing – perhaps the container is using old values?

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

@samcro1967, @rangitoto72 did you figure out what the issue was?

from healthchecks.

samcro1967 avatar samcro1967 commented on July 19, 2024

Getting the environment variables correct and then starting the container with no DB or local setting file solved it for me. Seems like trying to adjust the variables after the DB and setting files has been created did not work.

from healthchecks.

crhbetz avatar crhbetz commented on July 19, 2024

starting the container with no DB or local setting file

So the way to change email settings is wiping my complete installation ...?

from healthchecks.

samcro1967 avatar samcro1967 commented on July 19, 2024

I use docker compose and they are set as environment variables in my compose file. So when I removed the DB and local setting file, there were correctly recreated from the environment variables. When the variables were not correct or did not work, I updated them, removed the container, DB and setting files, and recreated the container. Tested and did again until it was working. Hope that helps.

from healthchecks.

crhbetz avatar crhbetz commented on July 19, 2024

Thanks for replying!

I think I had understood as much - so again, removed the container, DB and setting files, and recreated the container means deleting my whole setup, because my checks etc are stored in that DB that needs to be removed?

from healthchecks.

samcro1967 avatar samcro1967 commented on July 19, 2024

Ah gotcha ya. I did not start setting up things until I had tested to make sure everything was working. I only setup one check during my testing phase.

I just looked thru the DB with LSIO sqlitebrowser and did not see any obvious signs of the settings being stored there. Did you try to only remove the settings file?

Good luck.

from healthchecks.

cuu508 avatar cuu508 commented on July 19, 2024

@crhbetz Healthchecks (the web application that lives in this repository) does not store its configuration in the database, it reads it from environment variables, and also from the local_settings.py file if it exists next to the settings.py file.

If you are using the 3rd-party linuxserver docker image, I cannot comment on how it handles settings, or what precautions you need to make when using it in order not to lose your data.

from healthchecks.

crhbetz avatar crhbetz commented on July 19, 2024

Thanks for getting back to this. Unfortunately I missed my notification until now ...

I'll refrain from using a ping because I can't provide any more relevant info.

I'm using the docker/docker-compose.yml from this repository with the line image: healthchecks/healthchecks:v2.10 _un_commented.

After commenting on this issue, I played around a little more because testing with the provided docker run command I had been able to send mails. Eventually, I got it to work, but I'm unable to name a specific thing that finally made it work. It's happily been sending mails ever since.

from healthchecks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.