Lucee throws 500 error on any cfm file in a subdirectory - coldfusion

I have a legacy app running on Azure, IIS 10, Lucee 5.whatever. Runs fine. BUT, in a given subdirectory, trying to execute ANY ColdFusion code produces a 500 error. Example:
www.mysite.com works fine
www.mysite.com/whatever/ works fine
www.mysite.com/whatever/admin/ throws an error, even if the .cfm file only has HTML in it.
I enabled full debug output in the server administrator; it displays fine on the pages that don't throw a 500, but on the ones that do, all I get is the 500.
Permissions are consistent through the directories... i.e. they're the same at the level of the files that work as the ones that don't.
IIS is setup for pass-through authentication.
Not sure what else to check. Help please? :)

Related

Problem handling cookies for Blazor Server using OpenID server (Keycloak)

I have a baffling issue with cookie handling in a Blazor server app (.NET Core 6) using openid (Keycloak). Actually, more than a couple which are may or may not linked. It’s a typical (?) reverse proxy architecture:
A central nginx receives queries for services like Jenkins, JypyterHub, SonarQube, Discourse etc. These are mapped through aliases in internal IPs where the nginx can access them. This nginx intercepts URL like: https://hub.domain.eu
A reverse proxy which resolves to https://dsc.domain.eu. This forwards request to a Blazor app running in Kestrel in port 5001. Both Kestrel and nginx under SSL – required to get the websockets working.
Some required background: the Blazor app is essentially a ‘hub’ where its various razor pages ‘host’ in iframe-like the above mentioned services. How it works: When the user asks for the root path (https://hub.domain.eu) it opens the root page of the Blazor app (/).
The nav menu contains the links to razor pages which contain the iframes for the abovementioned services. For example:
The relative path is intercepted by the ‘central’ nginx which loads Jenkins. Everything is under the same Keycloak OpenID server. Note that everything works fine without the Blazor app.
Scenarios that cause the same problem
Assume the user logins in my app using the login page of Keycloak (NOT the REST API) through redirection. Then proceeds to link and he is indeed logged in as well. The controls in the App change accordingly to indicate that the user is indeed authenticated. If you close the tab and open a new one, the Blazor app will act as if it’s not logged in while the other services (e.g Jenkins) will show the logged in user from before. When you press the Login link, you’ll be greeted with a 502 nginx error. If you clean the cookies from browser (or in private / stealth mode) everything works again. Or of you just log off e.g. from Jenkins.
Assume that the user is now in a service such as Jenkins, SonarQube, etc. if you press F5 now you have two problems: you get a 404 Error but only on SOME services such as Sonarcube but not in others. This is a side problem for another post. The thing is that Blazor app appears not logged in again by pressing Back / Refresh
The critical part of Program.cs looks like the following:
This class handles the login / logoff:
Side notes:
SaveTokens = false still causes large header errors and results in empty token (shown in the above code with the Warning: Token received was null). I’m still able to obtain user details though from httpContext.
No errors show up in the reverse proxy error.log and in Kestrel (all deployed in Linux)
MOST important: if I copy-paste the failed login link (the one that produced the 502 error) to a "clean" browser, it works fine.
There are lots of properties affecting the OpenID connect, it could also be an nginx issue but I’ve run out of ideas the last five days. The nginx config has been accommodated for large headers and websockets.
Any clues as to where I should at least focus my research to track the error??
The 502 error shows an error at NGINX's side. The reverse proxy had proper configuration but as it turned out, not the front one. Once we set the header size to suggested size, everything played out.

Error occurred while generating PDF in Coldfusion using cfhtmltopdf

I am getting the following error using cfhtmltopdf:
Error occurred while generating PDF. Reason: PDF conversion is failed due to timeout. Increase the timeout value in PDFgService manager settings.
According to these docs (see "Configuring the PDF service manager"), I should be able to tweek the PDF Service Settings in the web.xml file:
https://helpx.adobe.com/coldfusion/pdf-generation-in-coldfusion.html
On Production, I am able to find the file and make these changes. It is located here:
//jetty/webapps/PDFgServlet/WEB-INF/.
However, locally, using CF2018 Developer Edition using IIS Server Mode, I cannot find any reference to any PDF service settings in any of the web.xml files in my CF directories. This folder also does not exist: //jetty/webapps/PDFgServlet/WEB-INF/.
I did find locally this folder:
C:\ColdFusion2018\cfusion\hf-updates\hf-2018-00003-314033\jetty\webapps\PDFgServlet\WEB-INF
There was no web.xml file there though, and adding one in with the settings had no effect (after restarting CF).
So I'd like to know how does one change these PDF settings in a local/development environment like this, like I was able to do on Production, in order to further debug this error I am getting.
UPDATE: We have logged the underlying issue with Adobe: https://tracker.adobe.com/#/view/CF-4208624

App URL setting broken for .NET Core 2.0 projects in Visual Studio 2017 15.5.0

I recently upgraded Visual Studio 2017 to version 15.5.0 and later on to 15.5.1.
So far everything was working fine developing .NET Core (2.0) web apis but after the updates the problems started. The problems occur on existing projects as well as newly created ones.
Problems:
Sometimes I receive the error message:
Unable to start process C:\Program Files\dotnet\dotnet.exe. The web server request failed with status code 500, Internal Server Error. The full response has written to C:\Users\username\AppData\Local\Temp\HttpFailure_04-01-08.html
This hidden directory is a great place to store error files by the way.
If i look into that file I can read:
HTTP Error 500.19 - Internal Server Error
Module: IIS Web Core
Notification: Begin Request
Error Code: 0x800700b7
Configuration file: \?\C:\solution\project\web.config
configuration source
<handler>
<add name="aspNetCore" path="*" verb="*" module="AspNetCoreModule" resourceType="Unspecified" />
</handler>
It seems to automatically add the add-tag on start even when I delete it.
So far, deleting the .vs directory up and on seemed to help against this but this shouldn't be a permanent solution.
The second (and more blocking problem) that occured is that the APP URL setting seems to be broken somehow.
For testing this bug I created a new Web API project (with the values controller) and added and configured swashbuckle.AspNetCore to show the UI for the ValuesController.
The default route for the values controller is api/values.
When I now configure the App URL settings in the project properties to start at http://localhost:50000/swagger the browser opens and shows the wrong url, namely http://localhost:50000/swagger/api/values with the correct response of the ValuesController but not the swagger ui. At this point it shouldn't have the extension /api/values since it is not configured and I don't know why or where this is added (it's not in the configuration).
If I now enter (without stopping the app) http://localhost:50000/swagger I start receiving 404 errors an urls, even on http://localhost:50000/api/values.
Anyone else having this problem?
Anyone knows a fix for that?
Anyone knowing what is happening there and what the problem could be?

Coldfusion 8: Firefox can't establish a connection to the server at 127.0.0.1:8500

I installed Coldfusion 8 trial version on my system (XP Professional sp3).
I created an Folder in the “C:/Coldfusion8/wwwroot” called “buildProject” containing an Index.cfm and some other .cfm files.
But I am unable to access the Neither my project files or CFIDE/Administrator
I tried the following URLS
http://localhost:8500/wwwroot/buildProject/
http://localhost:8500/CFIDE/administrator/index.cfm
http:// 127.0.0.1:8500/wwwroot/buildProject/
http:// 127.0.0.1:8500/CFIDE/administrator/index.cfm
http://localhost /wwwroot/buildProject/index.cfm
http://localhost /CFIDE/administrator/index.cfm
http://localhost /wwwroot/buildProject/
http://localhost /CFIDE/administrator/index.cfm
Firefox can't establish a connection to the server at 127.0.0.1:8500.
* The site could be temporarily unavailable or too busy. Try again in a few
moments.
* If you are unable to load any pages, check your computer's network
connection.
* If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.
• I cleared the browsing “History” from both IE and FF.
• I have restarted the CF server in the Control Panel >Administrative Tools > Services
• Even restarted the IIS
Getting the same error.
Further I was trying to access IE/FF via CFbuilder But still I am getting the error
“The connection was refused when attempting to contact [URL].”
If you connected Coldfusion to IIS, then you probably need to connect on port 80. Which you did try, but if you connected Coldfusion to IIS, then the document root is IIS's document root, not the document root you created your new directory in.
I believe the document root for IIS on XP is c:\inetpub\wwwroot.
So, try putting a test.cfm file in there that just contains "hello world" or something, and see if you can request it from there.
Hopefully you installed IIS first and were happy it was working before installing CF.
Try connecting to your IIS on http://localhost
You should get the default IIS .htm landing page , probably index.html or something, so at least you know IIS is working fine.
If you then try http://localhost/nosuchpage.htm you will see a 403 error (as long as you didnt specify to allow directory browsing). In the standard IIS error page you should be able to see
Physical Path D:\inetpub\wwwroot
or wherever IIS thinks your web root is. When you then install CF to use IIS (rather than standalone) it will use this path as your web root.
Rename your index.html file as index.cfm and connect to it on
http://localhost:8500/index.cfm
If vanilla html pages are working from the directory but .cfm pages are not then you probably need an CFIDE mapping (I think one quick workaround is simply to copy your CFIDE folder and drop it into web root).
What happens if you try typing this in as a url:
http://{your i.p. address}:8500/CFIDE/administrator/index.cfm
I bet it works

How to make local server working after wamp installation?

I have just installed wamp and I copied all the projects inside www folder but when I browse http://localhost/project its displays error like this.
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
I also changed the php setting and extensions but not working. So can anyone suggest for me.
Thanks
There can be a large number of possibilities for this error. for now, check to see if your project is using any php module that is not registered in php.ini. also check ur php.ini and httpd.conf (or whatever your apache config file is) )to see if all modules are configured correctly
I made it working. As I am using htaccss and I forgot to enable rewrite_module so it did not work. Now it works perfectly. Thanks to all of you for your answers that made me find out the solution. :)