Hello all - we have a medium sized coldbox application deployed to production where we are received a strange error on a regular basis that we cannot make heads or tails of. We cannot seem to reproduce it in any environment so far. Here is all of the information I have gathered so far. I will then give you my best hypothesis and what i’m really looking for. I have redacted some specific information, if something is redacted that you think might be relevant to the problem at hand please let me know. This is quite a bit of information, I apologize in advance for the long email.
Error Information
Type java.lang.ArrayIndexOutOfBoundsException
Message Array index out of range: 35
Tag Context C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\interceptors\SES.cfc(1024)
C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\interceptors\SES.cfc(118)
C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\web\context\InterceptorState.cfc(363)
C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\web\context\InterceptorState.cfc(254)
C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\web\context\InterceptorState.cfc(121)
C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\web\services\InterceptorService.cfc(140)
C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\web\services\RequestService.cfc(104)
C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\Coldbox.cfc(181)
C:\wwwroot[redacted1][redacted2]_frameworks\coldbox\system\Coldbox.cfc(382)
C:\wwwroot[redacted1][redacted2]\Application.cfc(83)
Stack Trace Routes.cfm · GitHub
We started getting the error often enough that we wanted to get some more info and try and figure out what the routes had in it when the error occurred, so we sent an email with this code from a main.cfc handler:
savecontent variable=“local.routesDump” {
writeDump(getInterceptor(“SES”).getRoutes());
}
This gives us a dump that looks like this: coldbox-error - Album on Imgur
As you can see, there are 36 routes in the array - but that is using the getRoutes() method, not dumping the instance.routes directly.
This line is the culprit that throws the error:
1024:
My best guess is that the copy that occurs from this gets a size of 36, but for some reason as it is iterating over to copy the array one of the elements are not accessible, thus throwing the error - but it is something I cannot reproduce at all.
Our production environment is running ACF 10 on Windows 2012. We are running coldbox SEEK 3.7.0 - but we had this same issue when running 3.6.0 - we hoped it would be fixed with the upgrade but it did not. The application gets a sizable amount of traffic - but the occurrences of the error do not seem to be related to traffic (although we cannot confirm that), sometimes we go days without an issue, most often when we do have the error it is maybe one a day, but we have had days where we had four in the same day. But hundreds of users go through the exact same set of events and process that throws the error successfully each day. Also, the users who have received the error have successfully hit other pages in the application before they receive this error. Most users who receive this error are on an ipad, but we have also had users receive this error on a desktop using chrome and firefox.
Here are the contents of my routes.cfm config file:
addRoute(pattern=":handler/:action?/:id?/:id2?/:id3?/:id4?/:id5?/:id6?");
addRoute(pattern=":handler/:action?/:id?/:id2?/:id3?/:id4?/:id5?");
addRoute(pattern=":handler/:action?/:id?/:id2?/:id3?/:id4?");
addRoute(pattern=":handler/:action?/:id?/:id2?/:id3?");
addRoute(pattern=":handler/:action?/:id?/:id2?");
addRoute(pattern=":handler/:action?/:id?");
addRoute(pattern=":handler/:action?");
So here are some questions and what I am trying to figure out:
1). Can anyone figure out how to reproduce this, in our application or in a separate use case - where copying an array receives this error. As you can see, the code does not explicitly refer to an index in the array.
2). According to http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec09f0b-7ff1.html, you should use duplicate() around arrays when the arrays contain anything more than simple values. My testing with and without duplicate confirm what this page says, but I can’t seem to find a way to reproduce this issue. I believe that the line that is throwing the error should use duplicate(), but I am not certain that it has anything to do with my issue. Is it something worth trying? (it takes an evening to do the update and then potentially a few days before we would see an error, so in the interest of figuring this out and only changing one thing at a time, I don’t mind to try this but I want to prioritize the attempts at fixing it).
3). Given the routes that are in my routes.cfm config file, is the 36 routes that you see in the dump I link to in the image correct? Here are the patterns in order. As you can see, there are certainly duplicates. I only list the pattern, but all of the other parts of the structure seem the same as well.
MessageBox/
:handler/:action/:id/:id2/:id3/:id4/:id5/:id6/
:handler/:action/:id/:id2/:id3/:id4/:id5/
:handler/:action/:id/:id2/:id3/:id4/
:handler/:action/:id/:id2/:id3/
:handler/:action/:id/:id2/
:handler/:action/:id/
:handler/:action/
:handler/
:handler/:action/:id/:id2/:id3/:id4/:id5/
:handler/:action/:id/:id2/:id3/:id4/
:handler/:action/:id/:id2/:id3/
:handler/:action/:id/:id2/
:handler/:action/:id/
:handler/:action/
:handler/
:handler/:action/:id/:id2/:id3/:id4/
:handler/:action/:id/:id2/:id3/
:handler/:action/:id/:id2/
:handler/:action/:id/
:handler/:action/
:handler/
:handler/:action/:id/:id2/:id3/
:handler/:action/:id/:id2/
:handler/:action/:id/
:handler/:action/
:handler/
:handler/:action/:id/:id2/
:handler/:action/:id/
:handler/:action/
:handler/
:handler/:action/:id/
:handler/:action/
:handler/
:handler/:action/
:handler/
Any help will be greatly appreciated. I have some ability to add things to help debug, but as I said above, the turnaround time wouldn’t be very fast, so I would like to prioritize any ideas for fixes. Let me know if there is anything else I can answer or any other information I can provide.