Unable to change domain name

Hi all,

I followed the tutorial to install discourse on a digital ocean droplet which works great.

It was installed using discourse.mydomain.com but now I want to move it to mydomain.com without the subdomain.
Obviously I set the dns records correctly and checked if they were actually changed by pinging the domain from my computer and also from the cli of the droplet. All fine.
Added the domain to the droplet.
I edited the app.yml and changed the host name. Did ./launcher rebuild app (a hundred times by now)

After this, my discourse site is unreachable by both old and new url.
If I edit the app.yml and rebuild again with the original subdomain it works again.

I have been trying to get this to work for the past three hours now and I must be missing something trivial. Can anyone tell me what I am missing?

Thanks
Björn

1 Like

Did you read the documentation on domain changes?

2 Likes

Yeah I did exactly that. Somehow the droplet / discourse installation doesn’t respond to the right domain.

How many times did you try to change the domain?

Are you using let’s encrypt?

Are you using any kind of proxy server, or Cloudflare?

1 Like

By now I’ve changed my domain multiple times over the course of a couple of hours (although it obviously also wasn’t working when I changed the domain the first time).
I am using Let’s Encrypt indeed. I followed the installer and it was enabled by default. I didn’t enter the let’s encrpyt mail address since my understanding is that it only for notifications.
No proxy server or cloudflare.

The DNS of fpv-racing.nl is currently restored to the previous IP.

Changing DNS records can take anything from 4 to 24 hours to update.

It’s not an immediate thing. There are ways to shorten the wait period, but that’s up to the domain Provider

DNS wasn’t the issue. The domains all pointed to the right IP. Checked with dig and ping from both my Mac and the digitalocean droplet cli.

Checked the logs after a rebuild and it seems there is an issue with Let’s Encrypt. Does anyone know what can be causing the errors? There is also a let’s encrypt certificate on the old server.

run-parts: executing /etc/runit/1.d/letsencrypt
[Sun 04 Oct 2020 09:53:54 AM UTC] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun 04 Oct 2020 09:53:54 AM UTC] Create account key ok.
[Sun 04 Oct 2020 09:53:55 AM UTC] Registering account: https://acme-v02.api.letsencrypt.org/directory
[Sun 04 Oct 2020 09:53:56 AM UTC] Registered
[Sun 04 Oct 2020 09:53:56 AM UTC] ACCOUNT_THUMBPRINT='hbi1tfC1bozb6iAu8yXW0D107W5F98rnrTvvS5eosNU'
[Sun 04 Oct 2020 09:53:56 AM UTC] Creating domain key
[Sun 04 Oct 2020 09:53:57 AM UTC] The domain key is here: /shared/letsencrypt/fpv-racing.nl/fpv-racing.nl.key
[Sun 04 Oct 2020 09:53:57 AM UTC] Single domain='fpv-racing.nl'
[Sun 04 Oct 2020 09:53:57 AM UTC] Getting domain auth token for each domain
[Sun 04 Oct 2020 09:54:00 AM UTC] Getting webroot for domain='fpv-racing.nl'
[Sun 04 Oct 2020 09:54:00 AM UTC] Verifying: fpv-racing.nl
[Sun 04 Oct 2020 09:54:03 AM UTC] fpv-racing.nl:Verify error:Invalid response from https://fpv-racing.nl/404.shtml [2a06:2ec0:1::120]:
[Sun 04 Oct 2020 09:54:03 AM UTC] Please check log file for more details: /shared/letsencrypt/acme.sh.log
Error loading file ca.cer
[Sun 04 Oct 2020 09:54:05 AM UTC] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun 04 Oct 2020 09:54:05 AM UTC] Single domain='fpv-racing.nl'
[Sun 04 Oct 2020 09:54:05 AM UTC] Getting domain auth token for each domain
[Sun 04 Oct 2020 09:54:07 AM UTC] Getting webroot for domain='fpv-racing.nl'
[Sun 04 Oct 2020 09:54:07 AM UTC] Verifying: fpv-racing.nl
[Sun 04 Oct 2020 09:54:11 AM UTC] fpv-racing.nl:Verify error:Invalid response from https://fpv-racing.nl/404.shtml [2a06:2ec0:1::120]:
[Sun 04 Oct 2020 09:54:11 AM UTC] Please check log file for more details: /shared/letsencrypt/acme.sh.log
[Sun 04 Oct 2020 09:54:12 AM UTC] Installing key to:/shared/ssl/fpv-racing.nl.key
[Sun 04 Oct 2020 09:54:12 AM UTC] Installing full chain to:/shared/ssl/fpv-racing.nl.cer
cat: /shared/letsencrypt/fpv-racing.nl/fullchain.cer: No such file or directory
[Sun 04 Oct 2020 09:54:13 AM UTC] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun 04 Oct 2020 09:54:13 AM UTC] Creating domain key
[Sun 04 Oct 2020 09:54:13 AM UTC] The domain key is here: /shared/letsencrypt/fpv-racing.nl_ecc/fpv-racing.nl.key
[Sun 04 Oct 2020 09:54:13 AM UTC] Single domain='fpv-racing.nl'
[Sun 04 Oct 2020 09:54:13 AM UTC] Getting domain auth token for each domain
[Sun 04 Oct 2020 09:54:15 AM UTC] Getting webroot for domain='fpv-racing.nl'
[Sun 04 Oct 2020 09:54:15 AM UTC] Verifying: fpv-racing.nl
[Sun 04 Oct 2020 09:54:19 AM UTC] fpv-racing.nl:Verify error:Invalid response from https://fpv-racing.nl/404.shtml [2a06:2ec0:1::120]:
[Sun 04 Oct 2020 09:54:19 AM UTC] Please check log file for more details: /shared/letsencrypt/acme.sh.log
Error loading file ca.cer
[Sun 04 Oct 2020 09:54:21 AM UTC] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun 04 Oct 2020 09:54:21 AM UTC] Single domain='fpv-racing.nl'
[Sun 04 Oct 2020 09:54:21 AM UTC] Getting domain auth token for each domain
[Sun 04 Oct 2020 09:54:23 AM UTC] Getting webroot for domain='fpv-racing.nl'
[Sun 04 Oct 2020 09:54:23 AM UTC] Verifying: fpv-racing.nl
[Sun 04 Oct 2020 09:54:27 AM UTC] fpv-racing.nl:Verify error:Invalid response from https://fpv-racing.nl/404.shtml [2a06:2ec0:1::120]:
[Sun 04 Oct 2020 09:54:27 AM UTC] Please check log file for more details: /shared/letsencrypt/acme.sh.log
[Sun 04 Oct 2020 09:54:28 AM UTC] Installing key to:/shared/ssl/fpv-racing.nl_ecc.key
[Sun 04 Oct 2020 09:54:28 AM UTC] Installing full chain to:/shared/ssl/fpv-racing.nl_ecc.cer
cat: /shared/letsencrypt/fpv-racing.nl_ecc/fullchain.cer: No such file or directory
Error loading file ca.cer
Error loading file ca.cer

The files are written, but are 0 bytes:

root@discourse:/var/discourse# ls -l /var/discourse/shared/standalone/ssl
total 8
-rw-r--r-- 1 root root    0 Oct  4 09:54 fpv-racing.nl.cer
-rw------- 1 root root 3243 Oct  4 09:54 fpv-racing.nl.key
-rw-r--r-- 1 root root    0 Oct  4 09:54 fpv-racing.nl_ecc.cer
-rw------- 1 root root  302 Oct  4 09:54 fpv-racing.nl_ecc.key

When manually requesting the certificate (found the procedure on this page) I get the same error for fpv-racing.nl. For discourse.fpv-racing.nl I get ‘success’.

By now I seem to have hit the rate limit for this hour (too many failed authorizations recently).

I think this is the culprit… I haven’t removed the old ipv6. Now wait for the rate limit :frowning:

It was indeed the issue. Never paid attention to the ipv6 settings… Thanks for your input guys :slight_smile:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.