Default doc going in circles on 127.0.0.1

No hurry on this one. It’s more curiosity than emergency.

No error templates are defined.
intepub/wwwroot/index.cfm consists of 16 characters: you must be lost
browse to machine’s ip from anywhere, “you must be lost” comes up.
browse to localhost from local machine … same result.
browse to 127.0.0.1 from local machine…
it forwards to this address:
“127.0.0.1/index.cfm?&&&&&&&&&&&…”
And shows what I think is a Chrome error page:
“127.0.0.1 redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS”
This is not a showstopper, but why would 127.0.0.1 produce a different result than localhost?

tx,
km

Don’t forget to tell us about your stack!

OS: Win Server 2019 Datacenter (10.0) on AWS
Java Version: 11.0.6
Tomcat Version: 9.0.34
Lucee Version: 5.3.6.61

I’m seeing this for the first time. Tested it with the same results, but may be I’ve never seen this before, because I never access 127.0.0.1 through IIS port 80, but directly through 127.0.0.1:8888 for administrational tasks only.

I think this issue is mod_cfml related, it is causing indefinate 307 Redirects. Here is a snippet of the access log:

127.0.0.1 - - [26/May/2020:21:09:08 -0700] "GET /index.cfm HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:12 -0700] "GET /index.cfm?&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:14 -0700] "GET /index.cfm?&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:21 -0700] "GET /index.cfm?&__&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:23 -0700] "GET /index.cfm?&__&__&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:25 -0700] "GET /index.cfm?&__&__&__&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:29 -0700] "GET /index.cfm?&__&__&__&__&__&__ HTTP/1.1" 307 -
127.0.0.1 - - [26/May/2020:21:09:30 -0700] "GET /index.cfm?&__&__&__&__&__&__&__ HTTP/1.1" 307 -
etc.

Not really sure why, may be @Jordan_Michaels can take a look. But for now as a workaround, you could deactivate mod_cfml by editing server.xml like so:

Edit server.xml at pathToYourLuceeInstallation\tomcat\conf\server.xml, find the section of the valve mod_cfml, <Valve className="mod_cfml.core"... /> and set as a comment to <!-- Valve className="mod_cfml.core"... / --> and restart the tomcat service.
By deactivating mod_cfml, the host entries will not be created by mod_cfm anymore, and you’ll have to add them manually to your server.xml files.

Also important to know is that tomcats default 127.0.0.1 address points to its default webroot at C:\lucee\tomcat\webapps\ROOT. If you have set localhost to serve the content of C:\inetpup\wwwroot (added by cfml_mod through IIS/boncode), they won’t serve the same content. If you want both addresses to serve the same content, you’ll need to add a ROOT.xml file at
C:\lucee\tomcat\conf\Catalina\127.0.0.1\ROOT.xml with the following content:

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="C:\inetpub\wwwroot\" reloadable="true">
  <WatchedResource>WEB-INF/web.xml</WatchedResource>
  <JarScanner scanClassPath="false" />
</Context>

Hope that won’t confuse you too much.

This issue occurs NOT because of a problem with mod_cfml, but because of a problem with the underlying stack. Specifically if there is an issue with Tomcat that affects mod_cfml’s ability to create a new context. Because of the underlying issue, mod_cfml gets stuck in a loop: mod_cfml sees new context, issues command to create new context then redirects, new context doesn’t get created due to underlying issue, and the process repeats.

One proposed solution is to create a “break” that would simply pass the default context if a URL variable was detected (like the &__ string), but that is not a fix for the underlying problem. If we leave mod_cfml without a break, a user can identify that there is an underlying issue and take steps to correct it.

If you get this, simply try restarting Tomcat. If that doesn’t work, try creating the context manually and see what error you get - as that will point you to the underlying issue.

1 Like

Thank you very much for the clarification Jordan. i was supposing it was cfml_mod, because the issue stopped after commenting the valve. Please excuse.

Not a problem brother. Appreciate your comments as always. =)

1 Like

Thanks all.
Yes, I’m completely confused, but that’s not a high bar.
Interesting discussion, anyway.
I’ll not be pursuing this further. It’s not an issue for me.
Smarter people will likely fix it in a future release.
Besides, I found a scarier one, which I’ll post in a bit.
tx
km

Sorry to dredge up an old post like this, but I was wondering if anyone has solved this issue?

I’m trying to setup a default site in Ubuntu on AWS. I’m running Lucee behind Nginx. Previously all my sites were configured in server.xml, but I need mod_cfml to setup the default site for the load balancer health check, as the host will be the server’s IP address and this won’t be known when I’m creating the configs.

If I setup mod_cfml, the context is created correctly, but doing a curl reveals an endless loop of 307 redirects, adding an additional &_ each time.

Any ideas?

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:11 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:11 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__&__

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:12 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__&__&__

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:12 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__&__&__&__

HTTP/1.1 307
Date: Mon, 08 Feb 2021 11:02:13 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Location: http://127.0.0.1/index.cfm?&__&__&__&__&__

And don’t worry about it. It appears the issue only manifests when calling from the local machine and they work fine when being called from another box.