tracker issue : CF-4181591

select a category, or use search below
(searches all categories and all time range)

URLs with /api/ Fails with 500.0 - Internal Server Error

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Amit K / Amit K (Amit K)

Created: 08/16/2016

Components: Administrator, Administrator Console, API Manager, REST Services

Versions: 2016

Failure Type: Non Functioning

Found In Build/Fixed In Build: CF2016_Update1 / 308425

Priority/Frequency: Normal / Some users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 10

Problem Description:
I have a folder named api in my root directory and I placed a file test.cfm in that directory.
When I try to browse the URL http://<>/api/test.cfm , it fails with a HTTP Error 500.0 - Internal Server Error
If I rename that folder 'api' to something else, it just works fine. 
Also I confirmed that this behavior doesn't exist in CF11.

I was able to confirm this behavior with the Adobe support and he suggested that I log a bug.

Steps to Reproduce:
Create a folder 'api' in your root dir.
Place a CFM file inside the api directory
Brose the file

Actual Result:
HTTP Error 500.0 - Internal Server Error
Detailed Error Information:
Module	   IsapiModule
Notification	   ExecuteRequestHandler
Handler	   ISAPI-dll
Error Code	   0x00000000
Requested URL
Physical Path	   C:\ColdFusion2016\config\wsconfig\6\isapi_redirect.dll
Logon Method	   Anonymous
Logon User	   Anonymous

Expected Result:

Any Workarounds:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4181591

External Customer Info:
External Company:  
External Customer Name: Amithraj K
External Customer Email:  
External Test Config: My Hardware and Environment details:

CF2016 running in Windows Server 2012



Please fix this bug asap . Due to this bug our API's are not working and we cannot be changing URLs in production to fix this .
Vote by External U.
2009 | August 17, 2016 06:29:55 PM GMT
This error is blocking for my project as well. Please have it fixed as soon as possible.
Vote by External U.
2010 | August 17, 2016 06:32:39 PM GMT Let me know if it's good to be made live.
Comment by Saurav G.
2002 | August 18, 2016 07:13:00 AM GMT
Please fix this bug ASAP!
Vote by External U.
2011 | August 18, 2016 10:02:34 AM GMT
The link doesn't work for me
Comment by External U.
2003 | August 18, 2016 11:49:24 AM GMT
This is a behavior that we introduced in ColdFusion 11 Update 1, after we fixed the following bug: We will document the above behavior . Thanks, Suchika.
Comment by Suchika S.
2004 | August 19, 2016 03:26:01 AM GMT
This is not an issue for me in CF11. The url works fine for me when running my app in CF11 update 9, but fails in CF2016 Update 2
Comment by External U.
2005 | August 19, 2016 04:37:51 PM GMT
+1 please fix. Note for anyone who finds this bug report: You can remove the mapping by going to cfinstall/cfusion/wwwroot/WEB-INF/web.xml. Search for the api servlet-mapping and comment it out. As the bug tracker does not seem to cross-reference bug reports. This seems to relate to:
Vote by John W.
2012 | April 07, 2017 11:36:10 AM GMT
This is not related to CF11. It is the API manager mapping in /WEB-INF/web.xml which hi-jacks the URL. This should only be applied, if when installing, the API manager is also installed so it doesn't break lots of existing applications.
Comment by John W.
2006 | April 07, 2017 11:38:40 AM GMT
Agree with John. CF should not presuppose the API Manager will be used (this will almost always NOT be the case), and the API Manager should not pre-suppose it can simply steamroll URLs starting with /api. It should just be an install option to pick a value for this. If it had a default, it should be something less likely to already be in use.
Comment by Adam C.
2007 | April 07, 2017 11:59:35 AM GMT
Agree w/ Adam, from start to finish. Also, most? CF users wouldn't even have access to web.xml. Warrants re-think. Thanks!, -Aaron
Comment by Aaron N.
2008 | April 08, 2017 12:30:25 AM GMT
I just voted for this in CF-4198400 too.
Vote by David B.
2013 | April 13, 2017 11:28:20 PM GMT
Saurav above links to the CF docs for the reserved words page. While he offers an internal-only link, and the correct link is instead, I don't see any reference to /api as being reserved. Then again, that's the CFML Reference, and really talking about reserved words in the language. This is more about a reserved word in URLs (and /rest is another). I hope someday Adobe may address this issue, of /api references failing with already-existing URLs (folders) with that name. As Aaron N says above, not everyone could readily tweak the web.xml (and worse, someone may do it to "fix" their problem and not realize that they now have broken the CF REST feature's reliance on that /api URL.)
Comment by Charlie A.
27572 | April 14, 2018 07:00:57 PM GMT
 /api mapping was used internally in CF for the REST discovery feature of the API Manager. Now we have got the mapping name changed to /cfapiresources . So, creating URL with /api in it or creating a folder named 'api' in CF's webroot should be accessible now. This is fixed in CF2018 and should be available in GM Build. For CF2016 this fix should be available in next bug-fix update.
Comment by Nitin K.
27573 | April 23, 2018 12:27:16 PM GMT
I should note that even after removing the mapping, the default document of index.cfm still does not appear to be working. I can confirm that default document / welcome-file-list is working for other folders.
Comment by Justin T.
28996 | June 06, 2018 12:30:10 PM GMT
For those who come across this in the future, there are a couple of things to note (as of my writing now in Sep 2019). First some good news: as Nitin said here in Apr 2018, they DID change CF2018 so that this problem is gone. The internal references to an /api folder, that were causing conflicts with those wanting to use their own, were indeed changed instead to /cfapiresources (which was ok to have "cf" in the name, because it was a path used only by the CF API Manager, not something exposed publicly). Second, some bad news: Nitin had said here also then that an update for CF2016 would be released to fix this there. That has not happened, even as of CF2016 update 11, the latest at this writing. Finally, to Justin's question (and anyone else on CF2016 still), it's NOT enough to comment out the web.xml file's references to /api, as discussed in comments above. That takes care of one part of the processing (and is indeed all you need if you use the built-in web server in CF). But if you are using IIS or Apache, then there is one more change you need to make (assuming you want to use your own /api folder and do NOT plan to have the CF Enterprise API Manager trying to discover services in your CF instance). There's a file which maps calls from those web servers into CF, named It too has a /api mapping, in CF2016 at least (no longer so in CF2018, and never in CF11 or 10). That file will be found in any of the *numbered* folders under the coldfusion2016/config/wsconfig folder. such as wsconfig/1/. In that file, find the line with such a /api mapping. Then to comment it out, put a # in front of it. Restart the web server (or in IIS, you could restart just the IIS application pool using this connector, if you understand what I mean). There is no need to restart CF. Now you will find that requests to a url with /api/, whether with or without a file name, will work. And Nitin or other Adobe folks, will this ever be propagated into CF2016, as planned?
Comment by Charlie A.
31316 | September 10, 2019 07:17:59 PM GMT
Correction to my last comment: that may apply to CF11 as well. Let me explain. I see now that I had noted in that other tracker entry on this issue (4198400) that I did find this /api impact happening to CF11, as of its update 11. I wrote that in Apr 2018. I just checked one server I have still running CF11, and I do see that /api entry in the If you are on 11 and see it, what I wrote above applies (if you want to comment it out). If you are on CF11 update 11 or greater and do NOT see it, perhaps it's only put there if the web connector has been created after that update 11 was put in place. So beware that it may "show up" if someone does the update and updates the connector. Indeed, I should have added to my comment above that even in CF2016 (and CF11, after update 11), you would need to remember to make the change in the file in any NEW web connector that you (or someone administering your server) may create. Same if you "update" a connector in CF11 by removing/re-adding it, or in CF2016 if you use the wsconfig tool's "update" feature and that update were to implement a new file (which has happened with some connector updates over the years). But again, none of this applies to CF2018, as Adobe changed it to NO LONGER use this /api folder, but instead now uses /cfapiresources.
Comment by Charlie A.
31317 | September 10, 2019 07:35:42 PM GMT