Discourse-setup hangs during domain name check

My installation is working fine, without SSL.

I’ve ran ./discourse-setup, but it stays stuck at
Checking your domain name . . .
forever.

I’ve let it run for 20mn.

I’ve updated my system (Arch), updated Discourse, rebooted my VPS, nothing seems to help.

1 Like

The discourse-setup script might not fully work on Arch for some reason. Make sure that the configuration (/var/discourse/containers/app.yml) contains all your configuration changes and rebuild the container manually.

cd /var/discourse
git pull
./launcher rebuild app
3 Likes

Not sure why that might be… Perhaps something is waiting for command line input? I definitely haven’t tested it there.

Is there some way to run the script in verbose mode, to have an idea of what’s happening?

No. You can just look at the code and try running each bit by hand.

Easiest would be to edit the script and comment out the bit that checks the domain.

I bet they you don’t have nc and it’s asking for permission to install it but it’s output is redirected.

I guess it’s time to test if NC is there and behave better.

I bet they you don’t have nc

No, I do. The script told my I needed to install it, and I did. I don’t think that’s the problem.

I tried stripping the part that’s hanging to it’s bare minimum:

I get http not found.

Edit: if I replace curl --proto =http by curl --proto -all,https,+http, I don’t get errors anymore

image

Edit 2: if I replace curl --proto =http with curl --proto '=http', I also get no errors. This is a parsing problem. Possibly unrelated to the original script, but I’ll try quoting the option in the original script too.

Edit 3: As I thought, quoting doesn’t change anything.

1 Like

Strange. I can’t see how that could be specific to your Linux distribution.

I’ll try to check it next week, but mostly the answer is to just use Ubuntu.

You did get your install working with that change?

What does curl —version tell you?

1 Like

curl 7.67.0 (x86_64-pc-linux-gnu) libcurl/7.67.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh2/1.9.0 nghttp2/1.39.2
Release-Date: 2019-11-06
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

I tried setting --verbose on the curl call.

curl -v --proto '=http' -s $HOST:$PORT --connect-timeout 3

I get this (ips, hashes, and domains removed of course):

Checking your domain name . . .
START
*   Trying xx.xx.xx.xx:443...
* TCP_NODELAY set
* Connected to example.com (xx.xx.xx.xx) port 443 (#0)
> GET / HTTP/1.1
> Host: example.com:443
> User-Agent: curl/7.67.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
* no chunk, no close, no size. Assume close to signal end
< 
 ZzZ1ZZZzZzZ5ZZZ1ZZz1

And then it stalls there.

Hmmm… Using https as the protocol instead of http seemed to have fixed it.

I echo’ed the curl line and noticed it was trying to connect to 443. I replaced the --proto '=http' with --proto '=https':

    if curl --proto '=https' -s $HOST:$PORT --connect-timeout 3 | grep $VERIFY >/dev/null 2>&1; then
      return 0
    else
      curl --proto '=https' -s localhost:$PORT >/dev/null 2>&1
      return 1
    fi

It went through! But I’m not sure if this was a bug, or if the http part was intentional. If it isn’t, I can submit a bug report/PR.

1 Like

Hmm. I can’t see why https could work, as nc isn’t serving https capable (or is it now?). The point of the test is to see if the domain name points to the server they’d running the test.

Do you have some other https server in place? Are you using cloudflare and having it to https?

Nope, this is just a linode with vanilla Arch, with the hardened Linode recommendations, and Discourse. It’s doing nothing else and has no custom setup, AFAIK. I used Arch instead of Ubuntu because I was in a hurry at the time and I can work faster in Arch (due to habit), but there’s otherwise no special things running.

I’m not 100% ruling out that I might have done something weird and forgot about it, but it’s a low chance. And if there is, it wouldn’t be something as obvious as setting up Cloudflare or something like that.

I’m as stumped as you are.

1 Like