CLIP-HPC / goslmailer

GoSlurmMailer - drop in replacement for default slurm MailProg. Delivers slurm job messages to various destinations.
40 stars 6 forks source link

Teams connector not sending data #35

Closed edornd closed 1 year ago

edornd commented 1 year ago

Hi!

I recently started confguring goslmailer, and so far so good, I started from the telegram connector and it is working great. I also wanted to configure the msteams connector, but it's failing silently:

  1. slurmctld does not show any error
  2. I set the configuration to render to file, and it's rendering files correctly
  3. On top of that, I tried to take the generated JSON and send it via POST using postman to the webhook URL and it's working

However goslmailer doesn't seem to like it and it's not sending anything. From the logs I don't see any apparent issue:

goslmailer:2023/05/05 19:06:19.872826 msteams.go:52: ................... sendToMSTeams START ........................................
goslmailer:2023/05/05 19:06:19.874655 msteams.go:60: Looked up with "GECOS" edoardo -> myemail@gmail.com
goslmailer:2023/05/05 19:06:19.874695 msteams.go:62: Sending to targetUserID: myemail@gmail.com
goslmailer:2023/05/05 19:06:19.874707 connector_data.go:18: msteams.dumpConnector: name: "Cluster"
goslmailer:2023/05/05 19:06:19.874753 connector_data.go:19: msteams.dumpConnector: url: "THE CORRECT URL"
goslmailer:2023/05/05 19:06:19.874763 connector_data.go:20: msteams.dumpConnector: renderToFile: "yes"
goslmailer:2023/05/05 19:06:19.874773 connector_data.go:21: msteams.dumpConnector: spoolDir: "/var/spool/goslmailer"
goslmailer:2023/05/05 19:06:19.874784 connector_data.go:22: msteams.dumpConnector: adaptiveCardTemplate: "/etc/slurm/msteams/template.json"
goslmailer:2023/05/05 19:06:19.874794 connector_data.go:23: msteams.dumpConnector: useLookup: "GECOS"
goslmailer:2023/05/05 19:06:19.874803 connector_data.go:24: ................................................................................
goslmailer:2023/05/05 19:06:19.876094 msteams.go:85: Time: 1683306379876091815
goslmailer:2023/05/05 19:06:19.876245 msteams.go:95: Send successful to file: rendered-484-myemail@gmail.com-1683306379876091815.json
goslmailer:2023/05/05 19:06:19.876259 msteams.go:135: ................... sendToMSTeams END ..........................................
goslmailer:2023/05/05 19:06:19.876273 goslmailer.go:103: ========================== END OF RUN ==========================================

There is no apparent failure, and yet I didn't receive anything on Teams. How can I debug this? Thanks!

timeu commented 1 year ago

If you use the rendertoFile option, you need to also configure and run the gobler service which is responsible for picking up the rendered messages and delivering it to the Teams endpoint (can also do rate limiting). Alternatively you could disable the renderToFile and let the goslmailer directly send to the Teams endpoint

edornd commented 1 year ago

Well, this was easy! Thanks, I didn't pay attention to this detail, I thought that renderToFile was just for gobler and/or debug purposes. It now works like a charm 👍