iContentFile error

Started by theorem5, July 16, 2013, 04:57:24 AM

Previous topic - Next topic

theorem5

I seem to be having a very strange issue when trying to do an iContentFile for a file to post to a site. Does this function have a limit? The error 307 I am getting seems very strange to me. Am I just missing something? This code has worked for YEARS with no issue. Please find included a snippet of the debugged code

fs=FileSize("o:\employees\work\singlefile.xml")
(193629) VALUE INT => 73879905

bbsize=fs+2000000
(193629) VALUE INT => 75879905

bb=BinaryAlloc(bbsize)
(193829) VALUE BINBUF => 987659

BinaryEODSet(bb,bbsize)
(193829) VALUE INT => 0

bbaddr=IntControl(42,bb,0,0,0)
(194029) VALUE STRING => "738525216"

endofcontent=0
(194039) VALUE INT => 0

endofcontent = iContentFile(bbaddr, endofcontent, "fileName", "o:\employees\work\singlefile.xml", "text/plain")
(194460) VALUE INT => 0

EXTENDER ERROR SUPPRESSED =>307 (307: File Access Failed)

Deana

Based on the error message is indicates that File Access Fails to the file o:\employees\work\singlefile.xml. Can you confirm that this file is accessible and readable from the account the script is running as.

ALso you mentioned this script has been working for long time. What has changed if anything recently?

More: Locate your wwwbatch.ini file and post the contents here. There should be a section in it that contains additional diagnostic information that may give some clue as to what it is that failed. The file should be located here: "C:\Documents and Settings\{username}\Application Data\WinBatch\Settings\wwwbatch.ini"
Deana F.
Technical Support
Wilson WindowWare Inc.

theorem5

The file is accessible, as I am able to edit it with a text editor using the same user account that created the file and that is running the script.  Nothing has changes as far that I am aware.  Other smaller files that are getting created using the same process work just fine.

The wwwbatch.ini does not seem to provide much more info:

[WWINT44I]
LastError=0 (iContentFile(CreateFile))

Deana

I was hoping for some more useful error information from the wwwbatch.ini. However it does confirm that the code is in fact failing to open a file for read access. Basically this function calls the CreateFile API to open the specified file (o:\employees\work\singlefile.xml) file with generic read access.
A FileOpen( 'o:\employees\work\singlefile.xml', 'read') function does basically the same thing. I suppose you could try testing this function at this point in the script. 

Also,the DebugTrace output you posted indicates 'EXTENDER ERROR SUPPRESSED'. That suggests that you might be suppressing errors. If not done correctly we could turn a two minute debugging process into a week long nightmare. Lets start by removing the error suppression. Comment out any lines related to ErrorMode or IntControl 73. Run the code again a post the resulting trace file removing any private information.

Deana F.
Technical Support
Wilson WindowWare Inc.

theorem5

The plot thickens.  Here is the latest debugged code with the contents of the wwwbatch.ini

fs=FileSize("o:\employees\work\singlefile.xml")
(194329) VALUE INT => 73637304

bbsize=fs+2000000
(194339) VALUE INT => 75637304

bb=BinaryAlloc(bbsize)
(194349) VALUE BINBUF => 987659

BinaryEODSet(bb,bbsize)
(194359) VALUE INT => 0

bbaddr=IntControl(42,bb,0,0,0)
(194359) VALUE STRING => "738525216"

endofcontent=0
(194359) VALUE INT => 0

endofcontent = iContentFile(bbaddr, endofcontent, "fileName", "o:\employees\work\singlefile.xml", "text/plain")
(236580) VALUE INT => 0

TERMINAL EXTENDER ERROR=>307 (307: File Access Failed)

;;;END OF JOB;;;

---------- Begin structure stack dump ----------
  1 for                88 For countrt = 1 to numruntimes   reconees.wbt
  2 if                 96 If StartTime > startruntime &... reconees.wbt
  3 for               298 For count = 1 to countfile       reconees.wbt
  4 else              312 If bb == 2                       reconees.wbt
-------- End structure stack dump --------

---------- Begin WWWBATCH.INI dump ----------
[WWINT44I]
LastError=1450 (iContentFile(ReadFile))

----------- End WWWBATCH.INI dump -----------

Deana

Well that sheds a little light onto the situation. It is now failing while it is attempting to read the file with the Windows System error ERROR_NO_SYSTEM_RESOURCES Insufficient system resources exist to complete the requested service. Make sure your code is freeing the buffer allocated with the BinaryAlloc using the BinaryFree function. If your code is missing that Binary Free you could be creating a memory leak over time that causes this issue. If it is missing be sure to add the BinaryFree then reboot the system to restore the memory. Test again.
Deana F.
Technical Support
Wilson WindowWare Inc.

theorem5

Well, that did the trick.  I have rebooted and I am now doing the BinaryFree and everything is back to normal.  Thanks for the help.

Deana

Deana F.
Technical Support
Wilson WindowWare Inc.