Fresh install using loomio-deploy 500 Internal Server Error when creating groups.
Hi there!
in an effort to test drive self hosted Loomio for decision making, I've set it up on a server.
When I try to create a group, the modal form does not disappear when I click 'Start group', but the group does appear to be created (multiple times if I click the button again).
The logs suggest an Internal Server Error and a warning about the faye certificate. Any suggestions?
Here's an excerpt from the logs:
loomio_1 | Started POST "/api/v1/groups" for 82.35.29.123 at 2016-08-11 11:29:26 +0000
loomio_1 | Processing by API::GroupsController#create as JSON
loomio_1 | Parameters: {"group"=>{"parent_id"=>nil, "name"=>"Test", "group_privacy"=>"closed", "discussion_privacy_options"=>"private_only", "members_can_add_members"=>true, "members_can_edit_discussions"=>true, "members_can_edit_comments"=>true, "motions_can_be_edited"=>false, "description"=>"A test group", "membership_granted_upon"=>"approval", "members_can_raise_motions"=>true, "members_can_vote"=>true, "members_can_start_discussions"=>true, "members_can_create_subgroups"=>false}}
loomio_1 | Completed 500 Internal Server Error in 367ms (ActiveRecord: 68.3ms)
loomio_1 |
loomio_1 | OpenSSL::SSL::SSLError (hostname "faye.loomio.agile.coop" does not match the server certificate):
loomio_1 | app/services/message_channel_service.rb:16:in publish'block (2 levels) in '
loomio_1 | config/initializers/event_bus.rb:87:in
loomio_1 | app/extras/event_bus.rb:8:in block in broadcast'broadcast'
loomio_1 | app/extras/event_bus.rb:8:in
loomio_1 | app/models/discussion_reader.rb:68:in viewed!'author_thread_item!'
loomio_1 | app/models/discussion_reader.rb:26:in
loomio_1 | config/initializers/event_bus.rb:48:in block (2 levels) in 'block in broadcast'
loomio_1 | app/extras/event_bus.rb:8:in
loomio_1 | app/extras/event_bus.rb:8:in broadcast'block in publish!'
loomio_1 | app/models/events/new_comment.rb:7:in
loomio_1 | app/models/events/new_comment.rb:7:in tap'publish!'
loomio_1 | app/models/events/new_comment.rb:7:in
loomio_1 | app/extras/example_content.rb:6:in block in add_to_group!'tap'
loomio_1 | app/extras/example_content.rb:5:in
loomio_1 | app/extras/example_content.rb:5:in add_to_group!'create'
loomio_1 | app/services/group_service.rb:9:in
loomio_1 | app/controllers/api/restful_controller.rb:12:in create_action'create'
loomio_1 | app/controllers/api/groups_controller.rb:17:in
loomio_1 |
loomio_1 |
nginx_1 | nginx.1 | loomio.agile.coop 82.35.29.123 - - [11/Aug/2016:11:29:27 +0000] "POST /api/v1/groups HTTP/1.1" 500 70 "https://loomio.agile.coop/dashboard" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36"
So it almost all works now, but emails are not being sent.
I'll continue this thread, but please do say if I should start a new thread.
When inviting someone to a group, I get no email and see this in the logs:
worker_1 | [Worker(host:5a66945fa1ec pid:1)] Job InvitePeopleMailer.to_join_group (id=5) FAILED (1 prior attempts) with EOFError: end of file reached
worker_1 | 2016-08-11T17:36:03+0000: [Worker(host:5a66945fa1ec pid:1)] Job InvitePeopleMailer.to_join_group (id=5) FAILED (1 prior attempts) with EOFError: end of file reached
worker_1 | [Worker(host:5a66945fa1ec pid:1)] 1 jobs processed at 0.0979 j/s, 1 failed
worker_1 | 2016-08-11T17:36:03+0000: [Worker(host:5a66945fa1ec pid:1)] 1 jobs processed at 0.0979 j/s, 1 failed
worker_1 | [Worker(host:5a66945fa1ec pid:1)] Job InvitePeopleMailer.to_join_group (id=5) RUNNING
worker_1 | 2016-08-11T17:36:28+0000: [Worker(host:5a66945fa1ec pid:1)] Job InvitePeopleMailer.to_join_group (id=5) RUNNING
worker_1 | Rendered invite_people_mailer/to_join_group.html.haml within layouts/invite_people_mailer (1.2ms)
worker_1 | Rendered _mailer_header.html.haml (0.2ms)
worker_1 | Rendered invite_people_mailer/to_join_group.text.haml (0.6ms)
worker_1 |
worker_1 | Sent mail to finn.lewis@gmail.com (10043.7ms)
Any ideas?
Hi Finn,
Thanks for giving Loomio a go. Looks like you're almost there!
So I would first look to confirm that your SMTP settings are correct. Do you have an SMTP server and have you entered those details into the ENV file?
Hi Robert!
Thanks for your reply.
Yes I have the SMTP server specified int he ENV file, I initially tried using Google's SMTP, then tried using another that I use. For example
smtp settings
SUPPORT_EMAIL=support@mydomain.com
SMTP_DOMAIN=mydomain.com
SMTP_SERVER=mysmtpserver
SMTP_PORT=465
SMTP_USERNAME=myuser
SMTP_PASSWORD=mypass
FAYE_URL=https://faye.loomio.mydomain.com/faye
REPLY_HOSTNAME=loomio.mydomain.com
With the second SMTP server, the error is slightly different:
worker_1 | [Worker(host:07e48ddc14dd pid:1)] Job InvitePeopleMailer.to_join_group (id=109) RUNNING
worker_1 | 2016-08-12T08:17:35+0000: [Worker(host:07e48ddc14dd pid:1)] Job InvitePeopleMailer.to_join_group (id=109) RUNNING
worker_1 | Rendered invite_people_mailer/to_join_group.html.haml within layouts/invite_people_mailer (1.0ms)
worker_1 | Rendered _mailer_header.html.haml (0.2ms)
worker_1 | Rendered invite_people_mailer/to_join_group.text.haml (0.6ms)
worker_1 |
worker_1 | Sent mail to finn+test2@agile.coop (60065.7ms)
worker_1 | [Worker(host:07e48ddc14dd pid:1)] Job InvitePeopleMailer.to_join_group (id=109) FAILED (0 prior attempts) with Net::ReadTimeout: Net::ReadTimeout
worker_1 | 2016-08-12T08:18:36+0000: [Worker(host:07e48ddc14dd pid:1)] Job InvitePeopleMailer.to_join_group (id=109) FAILED (0 prior attempts) with Net::ReadTimeout: Net::ReadTimeout
worker_1 | [Worker(host:07e48ddc14dd pid:1)] 1 jobs processed at 0.0166 j/s, 1 failed
worker_1 | 2016-08-12T08:18:36+0000: [Worker(host:07e48ddc14dd pid:1)] 1 jobs processed at 0.0166 j/s, 1 failed
Not sure if that might help
I have a couple of specific questions:
1 - Where I can see the email logs to assess why the email is failing?
2 - By specifying the SMTP_PORT does this automatically decide whether to use SSL/TLS or STARTTLS?
3 - If there was any problem with the SSL certificate, how would we know?
Many thanks,
Finn
you're using a local smtp server or your mail provider smtp server?
I had the same problem with my mail provider smtp server, so i installed a local smtp server (postfix) and redirect all mail coming from my servers to my mail provider smtp server.
After this i modified loomio's env file for sending all my mails to my local smtp server by using port 25.
Hi FSF1967,
I tired with Google's SMTP server, and one that we host on another server, that I know works.
You suggest installing postfix, which sounds like a good plan. Did you install postfix on the host server, or inside the loomiodeploy_mailin_1 container, or somewhere else?
Many thanks,
Finn
I really like the tool swaks to test SMTP server settings. I recommend that you test if you can use your loomio env settings with your SMTP via swaks.
i installed my smtp server on an another VM who is also my apache reverse proxy server
I have it working!
After some more trial and error, I went back to Google's SMTP server and did the following:
1) Added an SPF record (after reading https://support.google.com/a/answer/176600?hl=en)
2) Changed port to 587
Now it works!
Thanks for
After re-reading the docs on https://github.com/loomio/loomio-deploy, I increased the memory on my virtual server from 1G to 2G and restarted.
Now creating a group works fine! (RTFM)
So, now I need to delete some of the test groups I created, which means I need an admin user.
Is the solution on this thread really the easiest way to create an admin? https://github.com/loomio/loomio/issues/3283