ERR_TOO_MANY_REDIRECTS After Rebuild


(sin) #1

I started getting the error:

ERR_TOO_MANY_REDIRECTS

after a ./launcher rebuild app

The website has been running fine for a long time, and had rebuilt it many times to install plugins and was all fine, and suddenly after last rebuild, it shows that error with no info, how can I access logs? or how to solve the error?

thanks


(Rafael dos Santos Silva) #2

Do you:

  • Use SSL?

  • Has ticked force_https?

  • Use Cloudflare? Tried disabling the orange cloud?

  • Has a outer reverse proxy (nginx/apache) ?


(sin) #3

hmm… I’ve ticked force_https, and I use cloudflare ssl as well, and I have already the SSL working fine.

but I finally found the issue, before building I followed the advice below :open_mouth: who left that misleading comment in there?

## Uncomment these two lines if you wish to add Lets Encrypt (https)
##  - "templates/web.ssl.template.yml"
##  - "templates/web.letsencrypt.ssl.template.yml"

What that does? and since I already have SSL working fine! @Falco


(Rafael dos Santos Silva) #4

Well, if you have this two lines commented, and aren’t using a reverse proxy, only the Cloudflare, you only have SSL between the user and Cloudflare servers, and the traffic between your server and Cloudflare is plain text and can be intercepted.

If you want full HTTPS follow the #howto topic about it.


(Pad Pors) #5

we faced the same problem after a rebuild, and I couldn’t follow from the lines above what is the problem. may someone guide me how to solve the problem?

if it helps, we use cloudflare, https, and we have installed nginx out of docker.


(Pad Pors) #6

update 1.:

in our app.yml file we have comment these two lines as well:

##  - "templates/web.ssl.template.yml"
##  - "templates/web.letsencrypt.ssl.template.yml"

but this is since we’re using this howto to Install nginx outside the container. in the mentioned howto, it’s written to comment the line containing wel.ssl.template.yml and there’s no line for web.letsencrypt.ssl.template.yml (so we commented that line as well).

update 2. : we have the same problem on our local host as well: when we open topics in new tabs the page is not loaded.

update 3: we got this error in admin panel :slight_smile:

Encoding::CompatibilityError (incompatible character encodings: UTF-8 and ASCII-8BIT)
/var/www/discourse/vendor/bundle/ruby/2.3.0/gems/i18n-0.8.6/lib/i18n/interpolate/ruby.rb:21:in `gsub'

update 4: even when we open the site in safe-mode, the error is there (not valid as I understood with a refresh the site goes out of safe-mode, and so we won’t be able to reproduce this error in safe-mode.)


as we got the same error on localhost, I don’t think it’s related to https settings. extra hints appreciated :wink:


When slug generation method is encoded, It redirected many times when we open new tab opens in topic
(SMHassanAlavi) #7

I have removed a line at discourse source code and the problem solved for me in local

the file is this:

app/controllers/topics_controller.rb

and I justed remove the line number 673:

redirect_to url, status: 301

I don’t know how to solve it on my site because I don’t have access to source code of site because the site get the discourse from github.

any idea to solve this problem?

UPDATE:
I have added line 673 to code(because it was in a definition of a method and the problem can’t be from that) and then commented line number 104(like bellow) and problem solved.

if slugs_do_not_match || (!request.format.json? && params[:slug].nil?) # redirect_to_correct_topic(@topic_view.topic, opts[:post_number]) return end