Loomio
Sun 19 Apr 2020 10:48PM

Trouble with emails, errors with [websocket ]and /cable

FDS Fabio dos Santos Public Seen by 64

Hello everyone!

Loomio would be the perfect solution to our non-profits vote that will happen in the coming months.

My setup is a Linode Server ("nanode"). I have root access, IP Address, DNS is registered and a SMTP server configured on another machine that I know it runs.

I have been able to follow all the steps in Loomio-Deploy, with Docker, which no apparent problem. Loomio runs. Letsecrypt issues the SSL Certificate. I noticed that there are WEBSOCKET errors on the logs, and that the email fails to be sent.

I can load the Loomio's website on my host. But I cannot make the first account, as the email with the confirmatio number is never sent.

I'm assuming both issues are related. I am assuming it is an error with the websocket, and consequently the email is not sent out.

Below are the logs. I have tried some of the solutions posted on this forum, but could not solve the problem on my own.

I wonder if there is something in my setup which I am overlooking, or if it is some configuration that I did not complete. (In fact, I have not been able to find where the configurations are stored on the loomio-deploy directory!)

Help would be much appreciated, as Loomio would definitely solve many of or problems! I feel like there is a small tweak and it would work!

The website is running at loomio.associacaomusicalsuzuki.com.br.

Here is a PasteBin with the Logs: https://pastebin.pl/view/7bcfdc0f

FDS

Fabio dos Santos Thu 23 Apr 2020 6:28PM

INTERESTING:

I first ran SWAKS from my personal computer, and that ran fine.

It ocurred to me to try the same command on the server where Loomio is installed. The same command failed. Still investigating.

FDS

Fabio dos Santos Fri 24 Apr 2020 12:36AM

Ok. Advancing slowly, but surely.

I checked with Linode, and here is what I found:

Linode blocks outbound mail for accounts after 2019Nov5 until you do a few things and put in a ticket.

I have the procedure. I will do that tomorrow.

FDS

Fabio dos Santos Fri 24 Apr 2020 2:17AM

Ok! I have contacted Linode. I the SWAKS now works on the Linode.

Still no success the Loomio config.

Here is what I am running on SWAKS, followed by the tet in the ENV:

SWAKS:

./swaks --to [email protected] --from "[email protected]" --auth LOGIN --auth-user "[email protected]"  --auth-password "WOULDNOTTELLYOUWHICH" --server mail.associacaomusicalsuzuki.com.br -tlsc

ENV:

# smtp settings
[email protected]
SMTP_AUTH=login
SMTP_DOMAIN=associacaomusicalsuzuki.com.br
SMTP_SERVER=mail.associacaomusicalsuzuki.com.br
SMTP_PORT=465
[email protected]
SMTP_PASSWORD=SOMEPASSWORDHERE
SMTP_USE_SSL=1
REPLY_HOSTNAME=associacaomusicalsuzuki.com.br
# helper bot is the account which welcomes people to their groups.
[email protected]
RAILS_ENV=production

ERROR:

loomio-worker  | Sent mail to [email protected] (120.5ms)
loomio-worker  | 2020-04-24T02:06:17.978Z pid=7 tid=ow347wr7n class=Sidekiq::Extensions::DelayedMailer jid=9123c511910aa9399f93804e elapsed=0.181 INFO: fail
loomio-worker  | 2020-04-24T02:06:17.979Z pid=7 tid=ow347wr7n WARN: {"context":"Job raised exception","job":{"retry":true,"queue":"loginemails","backtrace":true,"class":"Sidekiq::Extensions::DelayedMailer","args":["---\n- !ruby/class 'UserMailer'\n- :login\n- - 1\n  - 20\n"],"jid":"9123c511910aa9399f93804e","createdat":1587693902.989345,"enqueuedat":1587693977.796429,"errormessage":"550-Verification failed for <[email protected]>\n","errorclass":"Net::SMTPFatalError","failedat":1587693928.837886,"retrycount":1,"errorbacktrace":"eJzNWNtymzAQ/ZU0L0lnamTAYDu/0umoAjaYGiQqCTv5+wpJToHEBBu507dE\nl3P2crS7+Ps9agRHJUtJicoiQbxJXlHgxd4SUZBIVLL2ePK0jbdPBb37me4g\n3WMOomZUwMP9t6n3w7W+n4Nk++nXNnGkr/G0lpJdcG8V63uJOrm/U38ZAFwW\nQl6CstIoQNLd5beuoowjE2cBNMMVCEHyYZSThmYloBwqgSpSlIvAW3u+Bm3/\nbeGOjO9RBmVxAP6qYOSOZUJz4JRRCqksGG3pImOqPfrFJVML7y/9fhrOEI0E\nJPJtQCThwzg6sK8DjnV8hIq5Co57puWcSFsltEiBbyWSMXyim4EWLz/M0Agi\n0eppgYAvIi/wQo1slrFZRwkRGj86g6/PfUJyANHUNeNywHIAbDcQZbJ4LlLS\nUgsd53jT5yuokLypgI6J5xo29BcZuA5lqJlvRth1bzLJ9ERFm65AP8vPRFk5\nUpNFftO7DoW/+lhZlB3n8qn+ljYkKbUvvulcO9KCYHhJodb5uI1TYS8L476I\nIoN98XuhaqYXawa7guBFAhVapj3Sjk5r4M+MV1fB15ylynqm8fyt6bXwAmkj\nAf9iiQPQuJvdx+CuhAOU4mubaHvwKpKqyNSpI+GA0h0pdBP0w3c148D2Y22X\nwpGrDKWY15Ui2SqaMDY5VltY7yGVWyo7VUK/4pMhLW8Y9mkVy9iTm0Gqmr7k\nrFQCwIMtbcc67ioCW8UcC7nDb6SSk/T2IQnslDkeiQvTu1pemF41fEn+uuDk\nAFQVOT9UM4keUdoFZb6EnNsm0LH9/zD9QvxTz7oadvBqB5Ke81T7yGF3oH+M\nu/UgK0RN5LsRfRqLqlZKnPJUfs28qgFcGB11jY6cGc1VMdfzwOqyEjJx7DCV\nXNcATuratI2NaYPtynwGVQ4YyQzweuCDG4Z/7EMwBXhKQoN5VWSgv+7n1+PK\nmf56LEG0Pn1ESRcvPei99NDpSy9ZnoONjctAB9HZacVddVqbMSUvWeKkOgXD\nAXqOpZ3Imp7Vjg8O8mSHpJpDrVqXC6/thO1M/34cWBMd9TqbZ7uGGXXgtv1u\n5M3YLxvnsVQlLbWvRufHNnIZy2dhDeUnyDNgueNAsof7H38APhotVQ==\n","retriedat":1587693954.468353},"jobstr":"{\"retry\":true,\"queue\":\"loginemails\",\"backtrace\":true,\"class\":\"Sidekiq::Extensions::DelayedMailer\",\"args\":[\"---\\n- !ruby/class 'UserMailer'\\n- :login\\n- - 1\\n  - 20\\n\"],\"jid\":\"9123c511910aa9399f93804e\",\"createdat\":1587693902.989345,\"enqueuedat\":1587693977.796429,\"errormessage\":\"550-Verification failed for <[email protected]>\\n\",\"errorclass\":\"Net::SMTPFatalError\",\"failedat\":1587693928.837886,\"retrycount\":1,\"errorbacktrace\":\"eJzNWNtymzAQ/ZU0L0lnamTAYDu/0umoAjaYGiQqCTv5+wpJToHEBBu507dE\\nl3P2crS7+Ps9agRHJUtJicoiQbxJXlHgxd4SUZBIVLL2eP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\n\",\"retriedat\":1587693954.468353}"}
loomio-worker  | 2020-04-24T02:06:17.979Z pid=7 tid=ow347wr7n WARN: Net::SMTPFatalError: 550-Verification failed for <[email protected]>

OBS:

Looking this error log, now, I see an email I did not know I needed to create. [email protected]. I'll go ahead and create that.

I also created a "[email protected]", which seemed logical, since it is the ENV. But that does not seem to be the cause of the error.


Advancing slowly. Please let me know your thoughts. Now I am sure SMTP Works on my server. It is definately something in Loomio!

FDS

Fabio dos Santos Fri 24 Apr 2020 2:47AM

I GOT IT TO WORK! Thanks for being pacient!

Lessons learned:

1) Make sure your server you can connect to your email server.
2) Create the necessary emails on your email server. Mainly "no-reply", and "notifications".

Things that could improve the experience of installing Loomio: 1) add a check to make sure that email server can be reached in install procedure. 2) add a check that all necessary emails have been created.

Still don't understand what the websocket or the /cable error is about. Should I be worried or add any specific change related to this?

RG

Robert Guthrie Sat 25 Apr 2020 1:32AM

It's good to know it wasnt a Loomio issue after all. SMTP is quite troubling some times eh.

The cable errors.. They're not critical, at worst, live update of changes (see someone else's comment appear without reload) won't work. I'll fix it in the repo if I do find the problem there.

FDS

Fabio dos Santos Tue 28 Apr 2020 1:12PM

About the Webcables error, I found this thread on StackOverflow.

https://stackoverflow.com/questions/40748539/what-should-the-actioncable-url-be-set-to-under-docker

The error we are getting seems similar.

R

Rich Sun 10 May 2020 11:39AM

@Rob Guthrie I think you're wrong here, I'm pretty sure this is a Loomio problem as it requires [email protected] to exist. I've come across this as I'm seeing what sounds like the exact same problems. Unfortunately the 'fix' of adding [email protected] doesn't really work for me as the domain I'm using isn't only used for Loomio.

I've dug around in the code a little and seeing in base_mailer.rb that there seemed to be a way to override this, I set the env var [email protected]in the worker container. Loomio then thought it was successfully sending emails but actually our mail server was giving an error as it was trying to send from the address [email protected].

Sorry if hijacking this thread isn't the right thing to do, I can start a new one if preferred.

RG

Robert Guthrie Sun 10 May 2020 7:42PM

Happy to be wrong and consider alternatives. I'm not sure what the problem is exactly, though.

Loomio must send notifications from some address. Some mail servers require that sending addresses are setup as receiving addresses, or are registered to be able to send email, but that's a per mail server thing.

It's not a hard/formal SMTP requirement that you send mail from addresses that "exist", and it's not Loomio that's requiring it.

However I'm not sure that this is the root of the problem. Are you saying you would like to configure the from address for notifications? How would you solve the problem?

R

Rich Wed 13 May 2020 7:28PM

It seems there are 2 problems. The first is the one is that there's not enough documentation around hosting your own Loomio instance so the existence of the NOTIFICATIONS_EMAIL_ADDRESS env var isn't easy to find. The only reference to it loomio that Google can find is from your response to a Github issue. I'd love to see this fixed by having proper documentation so you can see what's required of your mail server and how to work around an constraints, just like this.

The second issue is something I'm not sure about where to go with as it seems that somewhere between the ActionMailer config in Loomio and it actually trying to send it's messing up the SMTP username. My suspicion is that ActionMailer is assuming that the username is the first half of an email address. This is often the case but in my case the mail server we're using runs mails for multiple domains, so the username is of the form [email protected] or [email protected], etc. so the error I'm seeing is that the address [email protected]@mailserver.domain doesn't meet the specs for an email address.