Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't send message WARNING #81

Closed
usbulat opened this issue May 8, 2018 · 9 comments
Closed

Can't send message WARNING #81

usbulat opened this issue May 8, 2018 · 9 comments

Comments

@usbulat
Copy link

usbulat commented May 8, 2018

Hi

I'm trying to set up Moira.
Install it using released deb packages (from here https://github.com/moira-alert/moira/releases). Version 2.2.0-1

Trying to set notification, but no success.

notifier log shows:
WARNING Can't send message after 41 try: Unknown contact type 'mail' [package of 1 notifications to user@domain.com]. Retry again after 1 min

--- notifier.yml

redis:
  host: localhost
  port: "6379"
  dbid: 0
graphite:
  enabled: true
  uri: "localhost:2003"
  prefix: DevOps.Moira
  interval: 60s
log:
  log_file: stdout
  log_level: debug
notifier:
  sender_timeout: 10s
  resending_timeout: "1:00"
  senders:
    - type: mail
      mail_from: moira
      smtp_host: smtp.gmail.com
      smtp_port: 465
      # Skip SMTP server certificate chain validation if false
      insecure_tls: true
      # Uses "mail_from" if empty
      smtp_user: user@domain.com
      smtp_pass: pass
      # Email template file path (standard Go templates), if empty use default template
      # template_file: ...
  moira_selfstate:
    enabled: true
    redis_disconect_delay: 60s
    last_metric_received_delay: 120s
    last_check_delay: 120s
    notice_interval: 300s
  front_uri: http://localhost
  timezone: Europe/Moscow

--- web.json

{
  "api_url": "/api",
  "contacts": [
    {"type": "mail", "validation": "^.+@.+\\..+$", "icon": "email"},
    {"type": "pushover", "validation": "", "img": "pushover.ico"},
    {"type": "slack", "validation": "^[@#].+$", "img": "slack.ico"},
    {"type": "telegram", "validation": "^@.+$", "img": "telegram.ico", "title": "@channel only", "help": "required to grant @KonturMoiraBot admin privileges"},
    {"type": "twilio sms", "img": "twilio_sms.ico"},
    {"type": "twilio voice", "img": "twilio_voice.ico"}
  ],
  "supportEmail": "user@domain.com"
}
@titusjaka
Copy link
Contributor

Hi Bulat,

Thank you for reaching out!
Could you please format your config file? YAML files demand whitespaces, but it's not properly formatted. It will facilitate understanding of config and speed up the solution of your issue.

@usbulat
Copy link
Author

usbulat commented May 11, 2018

@titusjaka Hi Denis, thank you. I've fixed formatting.

@titusjaka
Copy link
Contributor

I tried to reproduce this issue but didn't succeed. I assume, it's your config is the reason of problem.

Please, try to change it this way and tell me, if it works for you:

  senders:
    - type: mail
      mail_from: <your-gmail-login>@gmail.com
      smtp_host: smtp.gmail.com
      smtp_port: 587
      insecure_tls: false
      smtp_user: "<your-gmail-login>@gmail.com"
      smtp_pass: "<your-super-secure-password>"

Most likely, you will not succeed and Google will return you an error like this:

2018-05-11 15:07:50.463 notifier        CRITICAL        Can not register sender mail: Don't initialize sender [mail], err [534 5.7.14 <bla-bla-bla> Please log in via your web browser and
5.7.14 then try again.
5.7.14  Learn more at
5.7.14  https://support.google.com/mail/answer/78754 m18-v6sm578567lfj.34 - gsmtp]

In this way, please go to this page: less secure apps and toggle the switch.

--
Please, let me know if this works for you :)

@usbulat
Copy link
Author

usbulat commented May 11, 2018

Tried your config, but no success. Still same message:
WARNING Can't send message after 6 try: Unknown contact type 'mail' [package of 1 notifications to user@gmail.com]. Retry again after 1 min.

What else can be the reason of this problem?

@titusjaka
Copy link
Contributor

Any other log messages out there? Could you please attach log file from notifier startup to error?

@usbulat
Copy link
Author

usbulat commented May 14, 2018

Thank you so much @titusjaka. I've managed to configure notifier, I was using wrong config.

@usbulat usbulat closed this as completed May 14, 2018
@titusjaka
Copy link
Contributor

Happy to know, you solved your problem :)

You also wrote that message: #42 (comment) is it related to this issue?

@titusjaka
Copy link
Contributor

@usbulat the other question is how did you fix your issue? Would you mind me asking you to describe the solution?

It would help us to improve documentation :)

@usbulat
Copy link
Author

usbulat commented May 16, 2018

Yes, comment in https://github.com/moira-alert/moira/issues/42#issuecomment-388018750 was related to my problem. It is all ok in documentation, just my automation bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants