Discourse version at forum.abc.com.au: NOT FOUND

Discourse installed using official guide on github
Everything went well. but getting 502 error while accessing forum

tried checking rails production logs, and nothing I could see production_error or sidekiq logs

did see this with tail
Creating scope :open. Overwriting existing method Poll.open.
Creating scope :open. Overwriting existing method Poll.open.
Can’t reach ‘/images/welcome/discourse-edit-post-animated.gif’ to get its dimension.

running discourse doctor says

Discourse version at forum.abc.com.au: NOT FOUND

tried disabling ssl and rebuild it, able to access the forum.

There must be problem with ssl, which I can’t figure out. While installing ssl connection to IP resolution succeeded

Pleasae help

1 个赞

It sound like before you enabled https you linked to non secure images.

1 个赞

@pfaffman Thank you for the reply.

It’s a fresh install. No way we can manually link

After digging into all logs, could found this is the error is with LetsEncrypt cert issuance. Anyone facing similar issue might help below.

first I saw this error in Nginx logs

cannot load certificate "/shared/ssl/forum.abc.com.au.cer": PEM_read_bio_X509_AUX() failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICATE)

then tried to check ssl logs

forum.abc.com.au:Verify error:CAA record for forum.abc.com.au prevents issuance

Before running discourse install script for sub domain we need to verify if main domain is having any CAA records and check the Certificate Authority if it’s not LetsEncrypt (In my case, main domain CAA is comodoca.com) , your letsencrypt certs for discourse won’t be issued

Fix: You need to add CAA record for discourse subdomain as mentioned here
Acme:error:caa :: CAA record for ... prevents issuance - Help - Let's Encrypt Community Support

Delete the old cert files and try rebuilding again

rm -rf /var/discourse/shared/standalone/ssl
rm -rf /var/discourse/shared/standalone/letsencrypt
./launcher rebuild app

If you know a way to test for those records that requires no extra software, I’d consider having discourse-setup test for it, but I’ve never seen this before.

Nice work figuring that one out!

It’s a fair assumption that if you own a domain and know what CAA is to have been able to configure it that your understand the implications of let’s encrypt.

4 个赞

@pfaffman
dig caa {domain.tld} will return the record.
We want to first search if it returns any record
Then if returns whether the issue authority is other than letsencrypt.org

But this is very rare case. Not sure if we want to include that.

@Stephen

Correct. if I own a domain, I know what I’m doing with it.
I was helping somebody, this problem might have with hosts that are using cpanel and providing autossls with other providers such as comodo. They add bunch of records by default when they create a site (WordPress) in cpanel

Anyway, this is very rare case, have seen this for the first time

We see CAA crop up here occasionally, the default response we get when we point out that they’ve restricted certificate issuance for their entire domain is usually :man_facepalming:t2:

1 个赞

@Stephen

This is interesting! ! need to check, I don’t know if we can lock certificate issuance on complete domain.
The restricted certificate issuance for entire domain, meaning all sub domains of it ?

If you set a CAA for @ (the domain) then that applies to both the top-level domain and subdomains, you can still add a specific CAA to subdomain.yourdomain.com for a service such as Let’s Encrypt which will restrict the scope for which LE can issue a certificate.

So:

domain.com.    CAA   0 issue "comodoca.com"
sub.domain.dom.    CAA   0  issue "letsencrypt.org"

You can also specify issuewild instead of issue to permit a CA to issue a wildcard certificate, and iodef to associate an email address which will be notified of policy violations.

1 个赞

这里也有同样的问题。命令未能解决问题。我已经切换到 Cloudflare DNS 和代理。问题仍然存在。

我已经这样做了好几次,没有遇到过这个问题。但我绝对不是程序员、专家或任何相关人士。我只是一个快乐的最终用户。但这令人沮丧。

1 个赞

我最好的猜测是,您将 Cloudflare 设置为代理,并进行了足够的重建次数,从而达到了 Let’s Encrypt 的速率限制,现在您必须等待一周才能获得证书。

快速简单的解决方案是选择一个新的子域,将 Cloudflare 设置为仅 DNS,然后重建。如果可行,那么我的速率限制猜测是正确的,您可以喜欢这个新子域,或者等待一周,直到它允许您重试。

4 个赞

诚实地问一句:重建是否每次都会请求新证书?

2 个赞

我只是在想同样的事情,我不确定这个请求,但如果找到一个有效的证书(刚刚重建了一个沙盒),似乎就不会颁发新的证书。

2 个赞

如果不存在有效证书,则会。

2 个赞