[08:16:06] !log tools.heritage Deploy 3bb8b8c, 2e51c66 (T316645) [08:16:09] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.heritage/SAL [10:44:46] !log tools.bridgebot Double IRC messages to other bridges [10:44:48] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.bridgebot/SAL [11:44:47] !log paws jupyterhub version bump T316309 5308be406ca5cdb0bfa823c7040e92fa19c191c9 [11:44:50] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Paws/SAL [11:44:50] T316309: Upgrade jupyterhub - https://phabricator.wikimedia.org/T316309 [14:10:45] !log paws updating openrefine install method to unblock nbclassic T312251 7aa340ca2643e90f9aa3534c6557c142847d1560 [14:10:48] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Paws/SAL [14:10:48] T312251: update nbclassic - https://phabricator.wikimedia.org/T312251 [16:46:43] Was bit confused about this part in the docs, if you could help me here? [16:46:44] ``` [16:46:45] // create reusable transporter object using the default SMTP transport [16:46:47] let transporter = nodemailer.createTransport({ [16:46:48] host: "smtp.ethereal.email", [16:46:50] port: 587, [16:46:51] secure: false, // true for 465, false for other ports [16:46:53] auth: { [16:46:54] user: testAccount.user, // generated ethereal user [16:46:56] pass: testAccount.pass, // generated ethereal password [16:46:57] }, [16:46:59] });``` [16:47:00] (re @wmtelegram_bot: @Ankit18gupta: https://nodemailer.com/about/ is maybe the most popular node SMTP client library. Their documentation loo...) [16:51:57] @Ankit18gupta: for a Toolforge tool, `host` would be mail.tools.wmcloud.org and `auth` would not be needed. You should be able to omit `port` as well and let it use the default of port 465 for non-TLS SMTP. The`secure: false` setting is the same as the default so you could leave that out too. [16:54:53] @Ankit18gupta: I think that means that `let transporter = nodemailer.createTransport({ host: "mail.tools.wmcloud.org" });` is all that is needed to initialize the transporter [16:57:28] And then `transporter.sendMail(message)` to send where `message` is an object with the wanted fields from https://nodemailer.com/message/ [17:23:51] This is my code, does this seem correct since I am not receiving the mail [17:23:51] ``` [17:23:53] const fetch = require('node-fetch'); [17:23:54] const nodemailer = require("nodemailer"); [17:23:56] [17:23:57] fetch('https://edit-wizard.toolforge.org/ping').then(function(response){ [17:23:59] const statusCode = response.status; [17:24:00] const statusText = response.statusText; [17:24:02] if(!response.ok){ [17:24:03] let transporter = nodemailer.createTransport({ host: "mail.tools.wmflabs.org" }); [17:24:05] transporter.sendMail({ [17:24:06] from: "", // sender address [17:24:08] to: "ankitguptabhabha@gmail.com", // list of receivers [17:24:09] subject: "Edit Request Wizard service is not running", // Subject line [17:24:11] text: `Edit Request Wizard service is not running. You are requested to look into it as soon as possible.\nStatus Code : ${statusCode} \nStatus Text : ${statusText}`, // plain text body [17:24:12] // html: "Hello world?", // html body [17:24:14] }); [17:24:15] }``` [17:24:17] [17:24:18] }) [17:24:20] [17:24:21] ``` (re @wmtelegram_bot: And then `transporter.sendMail(message)` to send where `message` is an object with the wanted fields from https://nodema...) [17:26:21] why is from address empty? (re @Ankit18gupta: This is my code, does this seem correct since I am not receiving the mail [17:26:21] const fetch = require('node-fetch'); [17:26:23] const nodemailer ...) [17:26:39] also don't forget spam folder [17:39:29] still doesnt find it working (re @jeremy_b: why is from address empty?) [17:40:04] I am using this to run the job [17:40:08] ``` [17:40:09] toolforge-jobs run mycronjob --command "node Edit-Request-Wizard/Backend/check-if-service-is-up.js" --image tf-node16``` [17:40:39] @Ankit18gupta: you will need a `from` address for sure. I would suggest "edit-wizard.maintainers@toolforge.org" as both the `from` and `to` address for this kind of self monitoring. https://wikitech.wikimedia.org/wiki/Help:Toolforge/Email#Mail_to_a_Tool [17:42:17] (aside: this particular kind of check is something that we really need to add support for in `webservice` as a Kubernetes liveness probe) [17:44:15] @Ankit18gupta: the code in the $HOME of your actual tool is not what you are discussing here. Are you testing this from inside of Toolforge or by some other means? [17:45:53] I ask because I feel confident that the mail.tools.wmcloud.org SMTP server will behave differently when the client connection to it comes from inside of Toolforge vs outside of Toolforge. [17:46:13] inside toolforge (re @wmtelegram_bot: @Ankit18gupta: the code in the $HOME of your actual tool is not what you are discussing here. Are you testing this from ...) [17:46:34] i used this `mail.tools.wmflabs.org` (re @wmtelegram_bot: I ask because I feel confident that the mail.tools.wmcloud.org SMTP server will behave differently when the client conne...) [17:47:38] mail.tools.wmcloud.org and mail.tools.wmflabs.org should resolve to the same IP. The wmcloud name is canonical (but we probably have docs that need to be updated which have the older name) [17:53:23] still I dont find it running fine (re @wmtelegram_bot: mail.tools.wmcloud.org and mail.tools.wmflabs.org should resolve to the same IP. The wmcloud name is canonical (but we p...) [17:54:47] @Ankit18gupta: I'm trying some things myself. I hope to have an example to share with you soon. [18:06:31] @Ankit18gupta: https://phabricator.wikimedia.org/P33720 documents my successful tests. I wonder if your `--command` needs to be `cd Edit-Request-Wizard/Backend && node check-if-service-is-up.js` instead? I don't know that node will find the needed node_modules directory otherwise. [18:52:50] Thanks it really helped a lot. :) (re @wmtelegram_bot: @Ankit18gupta: https://phabricator.wikimedia.org/P33720 documents my successful tests. I wonder if your `--command` need...) [20:07:46] !log tools.heritage Deploy 62d7547 [20:07:49] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.heritage/SAL [20:11:55] !log tools.heritage Deploy b1eb124 (T316626) [20:11:58] Logged the message at https://wikitech.wikimedia.org/wiki/Nova_Resource:Tools.heritage/SAL