Discourse setup not asking for smtp server address

Good evening,

I’m trying to setup discourse on a DigitalOcean droplet.
I installed docker and discourse successfully via ssh.
When I run ./discourse-setup, I’m directly prompted for the SMTP password; I do not get any of the following questions:

Hostname for your Discourse? [discourse.example.com]: 
Email address for admin account? [me@example.com]: 
SMTP server address? [smtp.example.com]: 
SMTP user name? [postmaster@discourse.example.com]: 
SMTP port [587]:

Could you please advice how I should proceed?

Thank you in advance,

Luca

Hmm.

I just cloned discourse_docker and ran discourse-setup and got this:

git clone https://github.com/discourse/discourse_docker.git /var/discourse
Cloning into '/var/discourse'...
remote: Counting objects: 3645, done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 3645 (delta 12), reused 31 (delta 10), pack-reused 3600
Receiving objects: 100% (3645/3645), 791.68 KiB | 0 bytes/s, done.
Resolving deltas: 100% (2249/2249), done.
Checking connectivity... done.
root@location:/var# cd /var/discourse
root@location:/var/discourse# ./discourse-setup 
Ports 80 and 443 are free for use
Found 1GB of memory and 1 physical CPU cores
setting db_shared_buffers = 128MB
setting UNICORN_WORKERS = 2
containers/app.yml memory parameters updated.

Hostname for your Discourse? [discourse.example.com]: 

Did you get the memory check output?

Thanks.

This is what I get when I try to run the setup command.
I’ve read in the forums that 1GB memory should be enough; do you think it might be the problem?

root@discourse:~# /var/discourse/discourse-setup
Ports 80 and 443 are free for use
cp: cannot stat ‘samples/standalone.yml’: No such file or directory
Found 1GB of memory and 1 physical CPU cores
sed: can’t read containers/app.yml: No such file or directory
sed: can’t read containers/app.yml: No such file or directory
containers/app.yml memory parameters updated.
grep: containers/app.yml: No such file or directory
grep: containers/app.yml: No such file or directory
grep: containers/app.yml: No such file or directory
grep: containers/app.yml: No such file or directory
grep: containers/app.yml: No such file or directory
grep: containers/app.yml: No such file or directory
grep: containers/app.yml: No such file or directory

SMTP password? :

Ah. It looks like discourse-setup expects you to be in /var/discourse

do this:

cd /var/discourse
./discourse-setup
6 Likes

It worked! Thank you so much!

2 Likes

Can we warn about this if the user messes it up Jay?

tl;dr: It’s on the list.

Most folks follow instructions and cd /var/discourse.

It only happens if someone has enough unix knowledge to know that typing the full path “should” work and then doesn’t have enough knowledge to guess from messages like “no such file or directory” (which were omitted from the original description of the problem) that it’s some kind of path issue.

5 Likes

I was in the /var/discourse directory, yet I was also not prompted for any settings besides the password. I had just run ./discourse-setup after a fresh clone of the docker git repo. I was following this guide and had created containers/app.yml with the suggested contents, but that didn’t help. My solution was to comment out the check_port lines in the discourse-setup script… /shrug

Edit: still hitting some issues with the port stuff…

That sounds like a bug, maybe.

If the port is in use you should get a message that says that it’s in use. Did that not happen?

But if app.yml exists, the script assumes that you’ve successfully installed and need to reconfigure. If you created app.yml by hand, then discourse-setup can’t be held responsible. Is that what happened?

And if you removed the check ports test, then it’s not surprising that something else might be using the ports needed. You’re on your own at that point.

So following the guide I was linked, I copy/pasted the suggested containers/app.yml contents (since running ./discourse-setup complained about ports being in use). The reason I copy/pasted the file was because there was no file after initially running the setup (which failed on port check). After commenting out the port check, the docker run failed (port conflict) but it successfully generated the app.yml. I adjusted the yaml per the guide, re-built the app, then it worked. Perhaps I missed a step in generating the initial app.yml or something is missing in the guide?

1 Like

I see. Did you want to run Discourse with other web sites?

discourse-setup isn’t designed to work if you do want to run other web sites, so it’s not a problem with discourse-setup. Thanks for explaining.

Ah, yea, I have a wildcard pointed to nginx so I’m running it alongside a few others.

Discourse seems to work now after the above steps (I was able to hook it to my smtp server, register the site and admin user, etc).

1 Like

I had a similar issue, i think the guide you linked assumes that the app.yaml has been created already, it seems to be a truncated version that doesn’t actually have the SMTP fields. If you had the setup script prompt you only for a password and the password exampe was [] instead of [pa$$word] then i think that may have been the problem.