Installed new Discourse server at DigitalOcean but the installation fails at the end


(Nikolaj Ivancic) #1

Here is the relevant ending from the var/discourse/shared/standalone/log/rails/production.log file:

Sent mail to admin@aureliatools.com (30033.8ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30095.3ms)
Job exception: end of file reached

Started GET "/" for 69.136.148.245 at 2017-09-11 02:51:14 +0000
Processing by FinishInstallationController#index as HTML
  Rendered finish_installation/index.html.erb within layouts/finish_installation (1.8ms)
  Rendered common/_special_font_face.html.erb (0.3ms)
  Rendered layouts/_head.html.erb (9.2ms)
Completed 200 OK in 37ms (Views: 13.9ms | ActiveRecord: 0.0ms)

Sent mail to admin@aureliatools.com (30032.4ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30087.8ms)
Job exception: end of file reached

The confirmation email did not arrive, despite several attempts - looks like a bug in the installation script on the first glance.

Please advise


#2

Did you edit your DNS text files and setup a mail provider?


(Nikolaj Ivancic) #3

Thanks for such quick help :grinning:

I definitively went through email setup - but completely missed the editing the DNS text files section that would explain why is it that I could get access to this service only by using its IP number.

Can you tell me how to recover from this mistake? Can I start from the place I missed or do I have to start from scratch (and remove the just installed server)?


#4

Mailgun.com will let you setup a free account with a random domain
ie
mailman@aasdfniewunewfiundsf@mailgun.com

that can send to “approved addresses”

If you edit your containers/app.yml file and rebuild to use that address you can set up an admin account right away.

Your DNS should let you add a text file with all the config stuff that your mail provider will need. It takes like a day for the DNS changes to propigate, so after you change it and mailgun.com says it’s okay you can edit your app.yml again and rebuild


#5

we’re using mailgun and it works really well. we’re way beyond the free tier though… that was somewhat of a surprise.


#6

Then unfortunaly I don’t think there is anything you can do but change your dns records and wait for it to propagate.


(Da Beast 45) #7

I agree with you @PBn


(Nikolaj Ivancic) #8

I do have my own mail server (hosted by one.com) using my own domain (aureliatools.com). I may have missed some of the actions needed to do on that server - like:

To ensure mail deliverability, you must add valid SPF and DKIM records in your DNS. See your mail provider instructions for specifics.

I simply missed this paragraph while installing Discourse and that could explain the problem that was logged as

Sent mail to admin@aureliatools.com (30032.4ms)
Job exception: end of file reached

I will do this now, and report back here whether this is my only problem :slight_smile:


(Nikolaj Ivancic) #9

I verified that my email server has a valid SPF record and that all emails sent from there will automatically be signed by DKIM. So, there ought to be some different reason why my installation of Discourse server did not finish correctly. Anyone with an idea ??


(Nikolaj Ivancic) #10

After spending way too much time debugging the problem where I am not receiving the activation email from the Discourse Setup, I have eliminated many potential problems (all of which I could share with you separately as my contribution to male the Discourse Server Installation server even better) - and am left with this situation:

The email related settings are:

 ## TODO: The SMTP mail server used to validate new accounts and send notifications
  DISCOURSE_SMTP_ADDRESS: send.one.com
  DISCOURSE_SMTP_PORT: 465
  DISCOURSE_SMTP_USER_NAME: admin@aureliatools.com
  DISCOURSE_SMTP_PASSWORD: xxxxxxxxxxxxx

I removed the password - and it is properly constructed and has required minimum length.

The installation log has the following parts that might be of interest

Sent mail to admin@aureliatools.com (30088.1ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30056.8ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30038.5ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30039.1ms)
Job exception: end of file reached

Once I requested to resend the email (as it was not received by admin@aureliatools.com, I got this in the log:

Started PUT "/finish-installation/resend-email" for 69.136.148.245 at 2017-09-11 02:42:44 +0000
Processing by FinishInstallationController#resend_email as HTML
  Parameters: {"authenticity_token"=>"XyRwpFtDGIcUuTCc50lk5Yd9TO4dU8Q3XkHaoyMSQR2Ls2P0F5yG5HdE2nBZyXxLzcFWWrMFD3JH1we66/KUCg=="}
  Rendered finish_installation/resend_email.html.erb within layouts/finish_installation (4.6ms)
  Rendered common/_special_font_face.html.erb (13.3ms)
  Rendered layouts/_head.html.erb (64.5ms)
Completed 200 OK in 747ms (Views: 200.1ms | ActiveRecord: 23.6ms)

Sent mail to admin@aureliatools.com (30085.1ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30087.4ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30032.5ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30149.0ms)
Job exception: end of file reached


Sent mail to admin@aureliatools.com (30054.5ms)
Job exception: end of file reached

Clearly there were several attempts to try - all with the same diagnosis Job exception: end of file reached

Lastly, I can send email to that same address admin@aureliatools.com without any problems from other computers and they are received just fine.

Summary: I cannot finish Discourse installation since my first user is not receiving the activation email.

I really hope that someone with a good heart and understanding of this situation will bail me out before I go to DigitalOcean and delete the whole VM :cry:


(Jeff Atwood) #11

Are you sure your server can talk to the mail server? It looks like no network connectivity to me on the mail port. There are steps in the email #howto for verifiying this.


(Nikolaj Ivancic) #12

No, I am not sure that my server (hosted by DigitalOcean) can talk to my email server (hosted by one.com) - I know that my email client on my home workstation can send email to my email server, indicating that the problem is not likely on the email server side. However, I am beginning to see that using my own email server is not a good idea as it is likely a violation of the terms of service.

So, I will see whether I could use Mailgun or some other service, which is used more often and has some suggestions like this one.


(Felix Freiberger) #13

Hm, which ToS should it violate? Normally, running your own mail server is totally fine legally, it’s just a pain in the ass to get right and get mails delivered to inboxes (as opposed to spam folders) – that’s why we don’t recommend it.

If you already have your own mail server that reliably gets mails delivered, there should be no reason not to use it :slight_smile:

Feel free to switch to a service, but if you want to continue debugging this, be sure to look at network issues first: Does anything appear in the mail server’s logs? Can you get any connection going on that port at all, e.g. with telnet?


(Nikolaj Ivancic) #15

Hi @fefrei

Hm, which ToS should it violate? Normally, running your own mail server is totally fine legally, it’s just a pain in the ass to get right and get mails delivered to inboxes (as opposed to spam folders) – that’s why we don’t recommend it.

It might be that calling my discomfort to use ONE.com’s email server a ToS violation might be too harsh, however, I certainly appreciate your argument (pain in the ass).

Update - I just received the official intepretation from ONE.COM staff stating that they do not allow server to server communications.

So, I switched to Elastic Mail and discovered that I cannot configure Discourse even there - the problem is that the IP I got assigned by Digital Ocean for the droplet hosting Discourse - is blacklisted. Since I do not really believe that Digital Ocean peddles bad IP addresses, I am assuming that they were hacked and have not discovered that yet. I did send an urgent support request - so far they are quiet.


(RĂ©gis Hanol) #16

This unfortunately happens when you’re using a VPS that was previously used by a spammer. The only fix is to pay for a dedicated IP address (I believe they call then “floating IP addresses”)


(Nikolaj Ivancic) #17

@zogstrip - the alternative is a bit more time expensive:

while assigned IP is blacklisted
     create a snapshot of my current image
     create a new droplet from the snapshot
     verify the new IP
     destroy old droplet

The real problem is that too many people are anxious to do something bad