1

On ACF 10, I have a function with the following signature...

<cffunction name="...">
    <cfargument ...>
    <cfdump var="#arguments#" output="#expandPath('/files/logs/debug.txt')#">
    <cfscript>
          writeDump(var="#arguments#", output="#expandPath('/files/logs/debug.txt')#");
    </cfscript>
</cffunction>

The first tag-based dump works, but the second script-based dump does not. I've had this problem before and I've definitely gotten the tag based dump to work before. It seems random. Sometimes it works, sometimes it doesn't. Once it starts working, it continues... but when it doesn't I can't figure out why.

On the script based variant, I've also tried...

  1. WriteDump(...)
  2. removing the comma separating the two attributes (an other working example is written this way oddly enough)
  3. removing the trailing semi-colon which apparently isn't always necessary per this... Why writedump function doesn't require semicolon in cfscript?

Anyone else having this problem and or know what the solution could be?

PS. Anywhere there's a "..." above, it's just to note that that bit is unimportant

Community
  • 1
  • 1
Chris Geirman
  • 9,474
  • 5
  • 37
  • 70
  • what exactly happens when it... "doesn't work"? are you catching the error? – Kevin B Jun 29 '16 at 20:34
  • Nothing. And I mean absolutely nothing. I get zero output. – Chris Geirman Jun 29 '16 at 20:35
  • Hmmm. I wonder what happens if you swap the order. Also this sounds like a thing to put into: https://bugbase.adobe.com/ – James A Mohler Jun 29 '16 at 21:06
  • (Edit) @ChrisGeirman - No output where - on screen, in the file or both? If you mean on screen, that could definitely happen if an [Error is occurring](http://stackoverflow.com/questions/14237283/coldfusion-not-catching-noclassdeffounderror/14243560#14243560) (this is different than an exception). Also, not sure if you saw the question: are you trapping exceptions anywhere - OnError, etcetera? – Leigh Jun 29 '16 at 21:57
  • Thanks guys. This dump pipes the output to a file rather than show it on screen. So the only place I'd expect to see the dump is in the file. It could definitely be a bug, but sometimes I can get it working in cfscript and sometimes not. And I can't seem to figure out what rhyme or reason causes it. In this particular function, there's no error trapping, try catches, or anything of the sort. I am using the cfwheels framework, so there is higher level error catching at the application level, but that doesn't seem to be tripping either as far as I can tell. – Chris Geirman Jun 29 '16 at 22:02
  • Just to clarify, the *only* thing going wrong is that WriteDump does NOT write the output to the file. Any code invoked after the function works as expected and there are no errors in any of the application or CF log files, correct? – Leigh Jun 29 '16 at 23:23
  • Correct, though I should verify the logs – Chris Geirman Jun 29 '16 at 23:50
  • 1
    With the code that's posted, how can one tell which one worked and which one did not? – Dan Bracuk Jun 30 '16 at 12:00
  • If you remove the `output` attribute, and put an `abort` after the second dump, what do you see on the screen? – Scott Stroz Jun 30 '16 at 12:15
  • That would work. The problem only presents when outputting to a file, which is necessary since this procedure is being called remotely via http, inside a tread. So removing the output isn't an option for me in this case – Chris Geirman Jun 30 '16 at 12:25
  • It was simply a troubleshooting step to make sure that both `dump`s were working as expected. Dumb, question, but why do you need 2 dumps in this function? I use `writeDump()` quite a bit in my code and I have never seen an issue where it "didn't work" – Scott Stroz Jun 30 '16 at 12:31
  • I don't actually need two dumps. I was just troubleshooting. My script based version wasn't working, so I added the tag based one, which worked immediately. In fact, tag based dumps that output to a file are very reliable. I've noticed that script based dumps that output to a file are far less reliable, where as script based dumps to the screen are bulletproof. Do you output to file often? – Chris Geirman Jun 30 '16 at 12:36
  • For troubleshooting? Just about every day. Never had a problem. – Scott Stroz Jun 30 '16 at 13:08
  • Interesting. Which version of ColdFusion do you use? Maybe this is a ACF10 thing – Chris Geirman Jun 30 '16 at 15:15

1 Answers1

0

Try to restart your application

reloadApplicationOnEveryRequest = true,
reloadFactoryOnEveryRequest = true
toyota Supra
  • 3,181
  • 4
  • 15
  • 19
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Aug 08 '23 at 11:16