Discourse setup with Digital Ocean - Not sending SparkPost activation email


(Ryan French) #1

Hi,

I have setup a new Discourse on Digital Ocean, I am using Sparkpost for my mail.

I have setup and configured both the SPF and DKIM records with my domain provider and all is good.

However I still do not receive the first activation email when I sign up with admin account. I’ve followed your email troubleshooting article and this hasn’t really fixed the issue.

I would love to know what the problem is and if this has occurred before with previous users?

Thanks,
Ryan.


(Jeff Atwood) #2

Please document each step in detail.


(Ryan French) #3

Did you enter email settings correctly?
Yes I did,

  ## TODO: List of comma delimited emails that will be made admin and developer
  ## on initial signup example 'user1@example.com,user2@example.com'
  DISCOURSE_DEVELOPER_EMAILS: 'ryan.lloyd.french@gmail.com'

  ## TODO: The SMTP mail server used to validate new accounts and send notifications
  DISCOURSE_SMTP_ADDRESS: smtp.sparkpostmail.com
  DISCOURSE_SMTP_PORT: 587
  DISCOURSE_SMTP_USER_NAME: SMTP_Injection
  DISCOURSE_SMTP_PASSWORD: 1fd2*************
  #DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

Are your SMTP connections being blocked?
Checked this and they seem to be good:
Connected to smtp.mailgun.org. Escape character is '^]'. 220 ak47 ESMTP ready

What do the logs say?
Ask me if you want to look at this, I have had a look and nothing stands out.

Did you properly set up DKIM and SPF records for your domain?
Yes I have checked and they are both green on Sparkpost’s end and talked with Namecheap support this morning to make sure records were setup correctly.

Are you using an IP address as the mail domain?
no.


(Jeff Atwood) #4

Ok so

cd /var/discourse
tail shared/standalone/log/rails/production.log

Doesn’t show anything interesting?

Do you see anything on the sparkpost logs side?


(Ryan French) #5
ActionController::RoutingError (No route matches [GET] "/javascripts/jquery_include.js")
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
Processing by ExceptionsController#not_found as */*
  Rendered exceptions/not_found.html.erb within layouts/no_ember (14.9ms)
  Rendered layouts/_head.html.erb (1.0ms)
  Rendered common/_special_font_face.html.erb (0.6ms)
  Rendered common/_discourse_stylesheet.html.erb (0.5ms)
  Rendered application/_header.html.erb (0.5ms)
  Rendered text template (0.1ms)
Completed 404 Not Found in 70ms (Views: 1.0ms | ActiveRecord: 29.8ms)

(Jeff Atwood) #6

What version of Discourse are you on? Can you make sure you are on latest, 1.7 beta 7?

Also you’ll need to scroll through that log, as described in the #howto topic, not just report the last thing. You’re looking for email related messages.


(Ryan French) #7

Whats the best way to check version?

Ill check logs now.


(Jeff Atwood) #8

View source on any page and read the version meta tag near the top.


(Ryan French) #9

Discourse 1.7.0.beta7


(Ryan French) #10
Started POST "/finish-installation/register" for 14.201.191.191 at 2016-11-08 08:25:54 +0000
Processing by FinishInstallationController#register as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"OiW5Dzgm3G5OYAvTnRM0429BTpuCfyd5ix/uC83yf5DgEBsRhbIZVtOSzZZCL5BPL24FesOhnSc4o6QQt60Smw==", "email"=>"ryan.lloyd.french@gmail.com", "username"=>"ryanfren
ch", "password"=>"[FILTERED]", "commit"=>"Register"}
Redirected to http://104.131.48.193/finish-installation/confirm-email
Completed 302 Found in 1011ms (ActiveRecord: 66.4ms)
Started GET "/finish-installation/confirm-email" for 14.201.191.191 at 2016-11-08 08:25:56 +0000
Processing by FinishInstallationController#confirm_email as HTML
  Rendered finish_installation/confirm_email.html.erb within layouts/finish_installation (8.4ms)
  Rendered common/_special_font_face.html.erb (0.5ms)
  Rendered layouts/_head.html.erb (9.7ms)
Completed 200 OK in 55ms (Views: 51.8ms | ActiveRecord: 0.0ms)

Started POST "/finish-installation/register" for 14.201.191.191 at 2016-11-08 08:41:37 +0000
Processing by FinishInstallationController#register as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"5phX2D4swn3tmq7n+qk74w8vR1DiwNawC8zIBXyz/PA8rfXGg7gHRXBoaKIllZ9PTwAMsaMebO64cIIeBuyR+w==", "email"=>"ryan.lloyd.french@gmail.com", "username"=>"frenchy"
, "password"=>"[FILTERED]", "commit"=>"Register"}
Redirected to http://104.131.48.193/finish-installation/confirm-email
Completed 302 Found in 18ms (ActiveRecord: 3.8ms)
Started GET "/finish-installation/confirm-email" for 14.201.191.191 at 2016-11-08 08:41:38 +0000
Processing by FinishInstallationController#confirm_email as HTML
  Rendered finish_installation/confirm_email.html.erb within layouts/finish_installation (11.2ms)
  Rendered common/_special_font_face.html.erb (0.5ms)
  Rendered layouts/_head.html.erb (2.8ms)
Completed 200 OK in 30ms (Views: 27.2ms | ActiveRecord: 0.0ms)
Started GET "/javascripts/jquery_include.js" for 14.201.191.191 at 2016-11-08 08:41:38 +0000
ActionController::RoutingError (No route matches [GET] "/javascripts/jquery_include.js")
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
Processing by ExceptionsController#not_found as */*
  Rendered exceptions/not_found.html.erb within layouts/no_ember (19.7ms)
  Rendered layouts/_head.html.erb (1.2ms)
  Rendered common/_special_font_face.html.erb (0.7ms)
  Rendered common/_discourse_stylesheet.html.erb (0.7ms)
  Rendered application/_header.html.erb (0.7ms)
  Rendered text template (0.1ms)
Completed 404 Not Found in 78ms (Views: 1.0ms | ActiveRecord: 34.0ms)
Started PUT "/finish-installation/resend-email" for 14.201.191.191 at 2016-11-08 08:42:06 +0000
Processing by FinishInstallationController#resend_email as HTML
  Parameters: {"authenticity_token"=>"CgBN0dhoSsa1/nfTHEOxEjBuFelFEKcPcEbrqoVZFlTQNe/PZfyP/igMsZbDfxW+cEFeCATOHVHD+qGx/wZ7Xw=="}
  Rendered finish_installation/resend_email.html.erb within layouts/finish_installation (2.9ms)
  Rendered common/_special_font_face.html.erb (0.5ms)
  Rendered layouts/_head.html.erb (3.8ms)
Completed 200 OK in 90ms (Views: 38.3ms | ActiveRecord: 8.7ms)

Sent mail to ryan.lloyd.french@gmail.com (1121.6ms)
no implicit conversion of nil into String subscribe failed, reconnecting in 1 second. Call stack ["/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/connection/hiredis.rb:19:in `conn
ect'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/connection/hiredis.rb:19:in `connect'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/client.rb:33
6:in `establish_connection'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/client.rb:101:in `block in connect'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/l
ib/redis/client.rb:293:in `with_reconnect'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/client.rb:100:in `connect'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3
.3.1/lib/redis/client.rb:364:in `ensure_connected'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/client.rb:221:in `block in process'", "/var/www/discourse/vendor/bundle/ruby/2
.3.0/gems/redis-3.3.1/lib/redis/client.rb:306:in `logging'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/client.rb:220:in `process'", "/var/www/discourse/vendor/bundle/ruby/2.
3.0/gems/redis-3.3.1/lib/redis/client.rb:134:in `block in call_loop'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/client.rb:280:in `with_socket_timeout'", "/var/www/discourse
/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/client.rb:133:in `call_loop'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/subscribe.rb:43:in `subscription'", "/var/www/d
iscourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis/subscribe.rb:12:in `subscribe'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis.rb:2760:in `_subscription'", "/var/ww
w/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis.rb:2138:in `block in subscribe'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis.rb:58:in `block in synchronize'",
 "/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/redis-3.3.1/lib/redis.rb:58:in `synchronize'", "/var/www/discourse/vendor/bundle/ruby/2
.3.0/gems/redis-3.3.1/lib/redis.rb:2137:in `subscribe'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.2/lib/message_bus/backends/redis.rb:304:in `global_subscribe'", "/var/www/discou
rse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.2/lib/message_bus.rb:513:in `global_subscribe_thread'", "/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/message_bus-2.0.2/lib/message_bus.rb:461:in `bl
ock in new_subscriber_thread'"]
Job exception: no implicit conversion of nil into String

(Ryan French) #11

Any update on this issue?


(Jay Pfaffman) #12

I had a similar problem with an install that I did a few days ago. It would not send mails to users, but the test mail was delivered.

I did a

./launcher rebuild app

And it started working


(Ryan French) #13

Ive run a rebuild multiple times now :frowning:

Maybe setup again…?


(cpradio) #14

Does the test email functionality work? (Admin > Emails)

If it doesn’t, does your email password have a # in it? As # is used for comments, so you’d have to put your password in single quotes to get around that (IIRC)


(⛰️) #15

Possibly related.


(Jeff Atwood) #16

Excellent observation. That implies he is not on the absolute latest version. Are you on “tests-passed”? If not then you will have problems with Sparkpost.


Problems with Sparkpost email on install
(⛰️) #17

@Ryan_French needs to stop the container, back up his app.yml file (if he added any changes from the default), then–as root–delete the /var/discourse folder.

Also delete the container and all images.

docker rm $(docker ps -a -q)
docker rmi $(docker images -q)

That was how I was able to fix my problem. Since this has to do with a new install perpetually in lock-out via this (fixed) Sparkpost bug; he cannot check the admin panel, cannot even login to view anything. One can obliterate the entire install without losing that anything (sans any edits to the app.yml file).

After, he can go through the process anew of making the /var/discourse folder, re-download the app and bootstrap it, launch the container. That way you know for sure the codebase is latest, with the fixed bug.


(Jeff Atwood) #18

↑ ↑ what he said.

Thank you so much for connecting the dots here @purldator I was not seeing it and this helped tremendously.


(⛰️) #19


(Ryan French) #20

Just did a completely fresh build and still not working :frowning:

Followed @purldator instructions.

Any idea’s?