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

Installation failed on Ubuntu 18.04 and Ubuntu 20.04 #66

Closed
legarg opened this issue Nov 16, 2020 · 18 comments
Closed

Installation failed on Ubuntu 18.04 and Ubuntu 20.04 #66

legarg opened this issue Nov 16, 2020 · 18 comments

Comments

@legarg
Copy link

legarg commented Nov 16, 2020

I ve followed many times the 2 installation guide for Ubuntu 18.04 and 20.04 on clean VPS. The result is always the same : by default the domain name link to a https connection and the site is unreachable (ERR_CONNECTION_RESET), if i type directly a non secure link to my domain with http, it leads to nginx welcome page... It seems to be the same problem mentioned in topic #45 or #63...
Any help ?

@BigSnicker
Copy link

I've used this script successfully before, for Decidim 19.0, but I came back to do a new installation and found that it breaks with exactly the same behaviour described above, an ERR_CONNECTION_RESET when the http request is done using the domain name.

I should add that the script runs without any problems and indicates "Servers installed successfully" at the end.

I also tried doing the installation manually, following the step by step instructions, and ended up with the same result.

@BigSnicker
Copy link

Solved it.

It does appear that SSL is now forced, yet the script doesn't enable it on the NGINX server.

So you just have to configure SSL following a standard process: https://www.techrepublic.com/article/how-to-enable-ssl-on-nginx/

The only decidim-specific modifications are to append the four lines relevant to SSL configuration into decidim.conf, and that the symbolic linking between /sites-available/ and /sites-enabled/ needs to be reversed.

@BigSnicker
Copy link

Spoke a little too quickly. The above fix works well up until the mail configuration, at which point "ActionMailer" overflows, an error that seems to be related to this problem and which prevents emails from being sent via smtp.

@microstudi
Copy link
Contributor

Could you post the full output of the script? this way is much easier to know where was the failure

@BigSnicker
Copy link

Okay, I'll rerun it and capture it... although, if I understand correctly, the script doesn't touch SSL, yet configuring SSL seemed to fix the problem?

@microstudi
Copy link
Contributor

sorry, i though the problem was with the installation, so, if I understand i correctly, the installation finished just fine but you can't reach the server?

@microstudi
Copy link
Contributor

And, it's true that, since version 0.22, ssl is forced by default, you can change that by editing the file config/initializers/decidim.rb an make sure there's a line like this in it:

config.force_ssl = false

@BigSnicker
Copy link

Okay, that might be all we need!

Configuring SSL made the server reachable, but there was still some kind of conflict with sending emails via smtp. Hopefully this parameter will resolve both.

I'll try in the morning and report back here.

@microstudi
Copy link
Contributor

SMTP should be independent, try to configure SMTP in the /system admin. Also, remeber to check the log to see if there's any smtp error, that depends a lot of the mail provider.

@BigSnicker
Copy link

BigSnicker commented Nov 19, 2020

Yes, I try to stick with the /system admin.

The interesting thing was that while the error in the log was obscure (buffer overflow), Stackoverflow indicated that the problem is very often when an SSL message is sent out without SSL being flagged as a parameter (e.g. when https is being used, but ssl = true is not included in the parameters for the message formatting), which seemed related. Will test it tomorrow and see.

@BigSnicker
Copy link

Still having trouble getting smtp to work with mailgun.org. Any idea what this could be?

E, [2020-11-19T12:23:02.109089 #3055] ERROR -- : [ActiveJob] [ActionMailer::DeliveryJob] [6dcf4cbf-b739-46e7-9748-142af3f86300] Error performing ActionMailer::DeliveryJob (Job ID: 6dcf4cbf-b739-46e7-9748-142af3f86300) from Async(mailers) in 30420.01ms: Net::OpenTimeout (execution expired):
/home/decidim/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/smtp.rb:539:in initialize' /home/decidim/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/smtp.rb:539:in open'
/home/decidim/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/smtp.rb:539:in `tcp_socket'

I see in the notes that it's often IPv6 routability that's the issue, but it's still a problem after IPv6 is disabled.

@BigSnicker
Copy link

I solved the above connectivity problem, and now have everything pointed at gmail.com, but we're now at an "end of file" error. Going to explore and see if I can find a solution.

E, [2020-11-19T14:15:22.999145 #11039] ERROR -- : [ActiveJob] [ActionMailer::DeliveryJob] [46644e29-bfa6-4c7b-964e-5c1c978e67df] Error performing ActionMailer::DeliveryJob (Job ID: 46644e29-bfa6-4c7b-964e-5c1c978e67df) from Async(mailers) in 11046.58ms: EOFError (end of file reached):
/home/decidim/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/protocol.rb:225:in rbuf_fill' /home/decidim/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/protocol.rb:191:in readuntil'
/home/decidim/.rbenv/versions/2.6.3/lib/ruby/2.6.0/net/protocol.rb:201:in `readline'

@BigSnicker
Copy link

Got it working. Used https://www.smtper.net/ to verify the SMTP server access was correct, then narrowed it down to closed ports on the Digital Ocean server.

Thanks for the help!

@microstudi
Copy link
Contributor

great to know, hopefully your debugging may be helpful to other people!

@legarg
Copy link
Author

legarg commented Nov 21, 2020

hello,
I've followed your advice and configure a letsencrypt certificate in NGINX. It works fine if I link my domain to a standard html file located in var/www/connect-citoyen.fr/html. But I try to link to /home/decidim/decidim-app/public , it returns a 403 error.
Here are my configuration files:
connect-citoyen.fr.txt
decidim.conf.txt
mod-http-passenger.conf.txt

@BigSnicker
Copy link

One interesting tip, SSL becomes incredibly simple to install in Ubuntu 20.04 with the certbot snap.

It's just two commands.. https://tecadmin.net/how-to-setup-lets-encrypt-on-ubuntu-20-04/

I'll let the experts work on your '403' issue.

@microstudi
Copy link
Contributor

hello,
I've followed your advice and configure a letsencrypt certificate in NGINX. It works fine if I link my domain to a standard html file located in var/www/connect-citoyen.fr/html. But I try to link to /home/decidim/decidim-app/public , it returns a 403 error.
Here are my configuration files:
connect-citoyen.fr.txt
decidim.conf.txt
mod-http-passenger.conf.txt

I undersant that you are using either the config from decidim.conf or connect-citoyen.fr but not both right?

There's missing parameters in you server configuration with ssl, it should look like this:

server {

    root /home/decidim/decidim-app/public;
    index index.html index.htm index.nginx-debian.html;

    server_name connect-citoyen.fr www.connect-citoyen.fr;

    client_max_body_size 32M;

    passenger_enabled on;
    passenger_ruby /home/decidim/.rbenv/shims/ruby;
    rails_env    production;

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/connect-citoyen.fr/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/connect-citoyen.fr/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}
...

@legarg
Copy link
Author

legarg commented Nov 26, 2020

yes ! it works ! Thanks

@legarg legarg closed this as completed Nov 26, 2020
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

3 participants