I have a Linode with Gentoo Linux that I decided to install Discourse on.
I installed Docker and then using the 30-min install options installed discourse.
This part worked as I can go to the site and register my admin user but after registering, I never get a Verification Email.
I configured Discourse via nano -w containers/app.yml with ./launcher bootstrap app after editing it.
I signed up with Mailjet to do email and got an API Key and Secret key to use.
To show examples without revealing those, Iāll use these:
The python script worked just fine so I know the Mailjet account works.
No idea why Discourse canāt send email.
Are there any logs I can look at to figure out why Discourse wonāt send email?
Iāve looked in shared/standalone/log/rails/production.log but all I find about email is various entries of this (with different ms values):
Sent mail to justin@mydomain.tld (30058.0ms)
Job exception: execution expired
Did you fill in the SMTP address, SMTP username, and SMTP password fields correctly, as specified by Mandrill?
Yes (for Mailjet).
Make sure you copy and paste the Mandrill password ā do not type it in manually.
I did do this (with MailJet).
Does the value for DISCOURSE_DEVELOPER_EMAILS correctly have one set of single quotes around it ālike thisā?
Yes
Are the values aligned with the correct indentation for the email section? YML files are alignment sensitive. Even one extra space at the beginning of a line will cause problems.
I believe so, I didnāt change the alignment that was there.
Did you remove the YML comment marker # in front of the lines?
Yes
Is Digital Ocean blocking your email?
I donāt use Digital Ocean, so no.
And Linode is fine with email that isnāt spam.
Is Mandrill blocking your email?
I use MailJet so no, also because I could use the expample python script to send email, I know they arenāt blocking email.
Did you properly set up DKIM and SPF records for your domain?
Yes I did.
You didnāt quite answer all the questions. Do MailJet logs show an attempt to connect and send email from the IP of the linode? Digital Ocean will show a connection attempt from the Digital Ocean IP in its web UI for email logs.
Looks like something in your network, somewhere, is blocking connections based on
Sent mail to justin@mydomain.tld (30058.0ms)
Job exception: execution expired
You can look at /logs URL in Discourse but you need an admin account to do that.
I donāt see anywhere in MailJet logs of connect attempts.
Just a āReal-time Email Feedā showing 1 email sent via the python test script (Running on the Linode).
In theory it seems like there shouldnāt be a difference between a connection from a python script or a ruby on rails script (which is what the discourse mail code is if I understand correctly) in a docker container.
Why canāt I look at those logs via the command line like most other logs?
Because they are served via the web browser. Sorry, if you want, buy a $99 install and I will set up email for you thatās guaranteed to work with a Digital Ocean Discourse droplet, using a secret Mandrill reseller code that provides a large number of free emails per month.
Is there a way to manually set the user as verified just to check the logs (I wouldnāt leave it that way as itās a good idea to verify peopleās email addresses)?
At the moment, I donāt want to spend any more money then Iām spending on the Linode hosting for my WordPress site/blog along with other small traffic sites (which run using apache port 80 so for now I have discourse set to use port 8080)
If I kept it that way, yes.
The idea was to login, check /logs, find and fix the problem so there would be functional email for all future accounts Verifications.
Ok, I created the admin account manually and looked at /logs
First Error: PG::UndefinedTable: ERROR: relation "users" does not exist LINE 5: WHERE a.attrelid = '"users"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum
Iām not sure what this means.
Second Error: Job exception: execution expired
This is related to the email but doesnāt seem to have much more detail than production.log did.
I followed the instructions at discourse/docs/INSTALL-cloud.md at main Ā· discourse/discourse Ā· GitHub for the most part.
Here are the exact steps I did:
* Set up Swap (if needed)
Because of āIf youāre using 2 GB+ memory, you can probably get by without a swap file.ā, I figured I didnāt need one so I didnāt set one up.
Edit:
Checking with free -m it returns a Memory total of 1999 so this could be part of the problem as that says 2GB+ not 2GB (which would be 2048 MB so it seems Iām 49MB short of that).
* Install Docker / Git
I skipped running the command wget -qO- https://get.docker.com/ | sh as I figured for Gentoo the packages app-emulation/docker and dev-vcs/git covered it.
* Install Discourse
I ran the listed commands: mkdir /var/discourse git clone https://github.com/discourse/discourse_docker.git /var/discourse cd /var/discourse cp samples/standalone.yml containers/app.yml
Which appeared to complete successfully.
* Edit Discourse Configuration
I edited containers/app.yml with nano as listed in my first post.
* Bootstrap Discourse
Ran ./launcher bootstrap app
Than ran ./launcher start app
* Register New Account and Become Admin
I was able to do this except of course for the email validation
So I havenāt really been able to add plugins or change site settings.
I can now with the manual admin user creation but without working email, not much point in changing other things yet.
Edit:
I did end up doing these steps twice because the first time docker used the vfs storage driver and ran out of space so I wiped out /var/lib/docker, told docker to use overlayfs and restarted it.
I also ended up wiping out /var/discourse incase something was wrong there.
Client:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built:
OS/Arch: linux/amd64
Server:
Version: 1.8.1
API version: 1.20
Go version: go1.4.2
Git commit: d12ea79
Built:
OS/Arch: linux/amd64
Also, in case it matters, when merging the docker package the following notice appeared:
* Checking for suitable kernel configuration options...
* CONFIG_MEMCG_KMEM: is optional
* CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers
* CONFIG_MEMCG_SWAP_ENABLED: is not set when it should be.
* CONFIG_CGROUP_HUGETLB: is not set when it should be.
* CONFIG_RT_GROUP_SCHED: is not set when it should be.
Is overlay safe to use now @sam ? If you are on latest 1.4 beta Discourse code, I cannot explain the errors you are seeing. But last I recall overlay was new and experimental and could potentially cause unknown issues.
I think you have a busted install, somehow. If you donāt have any plugins or any other unusual settings, I canāt think of any reason you would have strange errors related to email.
I just set up two instances today following the guide literally step by step on Digital Ocean with Mandrill, and everything worked perfectly.