Skip to main content
Ben Nadel at InVision In Real Life (IRL) 2019 (Phoenix, AZ) with: Adam DiCarlo
Ben Nadel at InVision In Real Life (IRL) 2019 (Phoenix, AZ) with: Adam DiCarlo

ColdFusion 500 Null Error Revisited

By
Published in Comments (5)

I recently got a 500 Null error half way through the output of a ColdFusion page. I have rarely ever seen this before. If you have read my other post about 500 null errors in ColdFusion, it's usually an error before any data reaches the browser. But half way through the page? This is new.

More than new, it was frustrating. ColdFusion did not provide any error message or template line code or anything. The only thing I knew was the template that was executing. After doing the commenting, uncommenting dance, I narrowed it down to this line:

#REQUEST.UDFLib.Text.ToAsciiString( .... )#

This line worked on the development server, but not on the live server (where the 500 null was showing up). The problem was instantly obvious to me (as I wrote the code). The method ToAsciiString() was a new method that I had written in the Text User Defined Library (UDFLib.Text). I had uploaded the code that referenced it, but I had forgotten to upload the updated UDFLib.Text file.

On the live site, I was attempting to reference a function that was not there. Ordinarily, this sort of problem would throw this sort of an error:

The method 'ToAsciiString' could not be found in component D:\....\Text.cfc. Check to ensure that the method is defined, and that it is spelled correctly. <br>The error occurred on line 40.

In fact, that IS the error that get's thrown on the development server when trying to duplicate the error for research. Not sure why it gives 500 null on the live server. Maybe it has something to do with the debugging settings.

Want to use code from this post? Check out the license.

Reader Comments

8 Comments

I just ran into a 500 NULL error. It was very frustrating. Turns out I needed to duplicate the struct returned from a private method in the component and it then worked fine.

8 Comments

Actually, it looks like that wasn't it. I'm going to try to reproduce it. Maybe have been from the same process but trying to send a variable in the client scope that didn't exist...

15,848 Comments

@Allen,

Sometimes, the easiest thing to do to debug is throw a CFFlush tag right when you start processing the page. That way, any error that gets thrown is more likely to be "displayed" rather than just show up in a secretive way. This won't help all the time, but it will help some of the time.

4 Comments

I've seen some people have this issue with having client variables enabled and stored in cookies.

Setting it to store in DB or turning off client variables sometimes fixes it.

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel