Downloads pending, then failing

(imported topic written by SystemAdmin)

I have the following action that sits on “Download pending” for a while, failing with “Download failed” after a while even though both files are listed as cached on the server. But the very same action run via Fixlet Debugger’s Action QnA succeeds without a hiccup. What am I missing here?? Quick search resulted in this thread: http://forum.bigfix.com/viewtopic.php?id=4292 with exactly the same issue but no fix…


RunAsCurrentUser-2.0.3.1.exe

Complete

Cached on BES Server

j6u23_x86exe.tmp

Complete

Cached on BES Server


/script/

prefetch RunAsCurrentUser.exe sha1:EE47505EBFB2790B9DA8A20ED70E67158E9753D0 size:345528 http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe

utility __Download\RunAsCurrentUser.exe

download http://besserver:443/Uploads/da69c68af1cb045ccd0aafba78388dd0d2c7ba6d/j6u23_x86exe.tmp

continue if {(size of it = 14735046 AND sha1 of it = “da69c68af1cb045ccd0aafba78388dd0d2c7ba6d”) of file “j6u23_x86exe.tmp” of folder “__Download”}

// Note: update .exe will restart service automatically

if{exists running service “JavaQuickStarterService”}

delete __appendfile

delete stop_javaquickstarter.bat

appendfile net stop JavaQuickStarterService

move __appendfile stop_javaquickstarter.bat

waithidden stop_javaquickstarter.bat

endif

extract j6u23_x86exe.tmp

waithidden __Download\RunAsCurrentUser.exe --w --q cmd.exe /c __Download\j6u23_x86.exe /s ADDLOCAL=ALL IEXPLORE=1 MOZILLA=1 SYSTRAY=0 REBOOT=REALLYSUPRESS JAVAUPDATE=0

action may require restart “da69c68af1cb045ccd0aafba78388dd0d2c7ba6d”

/end script/


/action debugger/

STATUS: Running action…

Command succeeded (Prefetch download manager collected file) prefetch RunAsCurrentUser.exe sha1:EE47505EBFB2790B9DA8A20ED70E67158E9753D0 size:345528 http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe

Command succeeded (Using download manager collected file) download http://besserver:443/Uploads/da69c68af1cb045ccd0aafba78388dd0d2c7ba6d/j6u23_x86exe.tmp

Command succeeded (evaluated true) continue if {(size of it = 14735046 AND sha1 of it = “da69c68af1cb045ccd0aafba78388dd0d2c7ba6d”) of file “j6u23_x86exe.tmp” of folder “__Download”}

Command succeeded extract j6u23_x86exe.tmp

Command succeeded (Exit Code=-1) waithidden __Download\RunAsCurrentUser.exe --w --q cmd.exe /c __Download\j6u23_x86.exe /s ADDLOCAL=ALL IEXPLORE=1 MOZILLA=1 SYSTRAY=0 REBOOT=REALLYSUPRESS JAVAUPDATE=0

  • Result —

Evaluation completed successfully!

/end action debugger/


(imported comment written by BenKus)

Double check the sha1 AND size of those urls to make sure they are right… Sometimes there is a weird download error message when the sha1 is correct and the size is wrong (or vice-versa).

Ben

(imported comment written by SystemAdmin)

Hi Ben,

Thank you for your reply. This was the first thing I checked, both sizes and SHA-1 checksums are correct. If this wasn’t the case, wouldn’t have Fixlet Debugger failed as well? I haven’t used it before, so I don’t know how accurate it is.

Dimitri

(imported comment written by BenKus)

The agent has special download manager code to handle downloads and I think it is similar, but not identical to the Fixlet Debugger (for instance, the Fixlet Debugger doesn’t use the relays or the same caching concept).

Can you try it on another agent and see if you get the same issue?

Ben

(imported comment written by SystemAdmin)

Hi Ben,

I just got it working: I had to pre-cache the first exe (RunAsCurrentUser.exe) – prefetching it directly within a script didn’t work for some reason, even though it worked direct and in Fixlet Debugger. As soon as both files were pre-cached, checksummed and compressed, fixlet was able to download them from local relays and use appropriately.

Not sure what was wrong or why, but for now it is the fix.

Thanks for all of your help!