Mac action script "download failed" errors

(imported topic written by jstamps91)

Hi:

(I’m new to these forums, and this might not be the best place to post my question. Pls let me know if I should post to a different forum.)

I’m encountering a problem w/ a Mac action script that I wrote, and I’m unsure why. The script is quite simple, and I’ve copied it below. The failures have been occurring w/ increasing frequency, but there’s no clear pattern. At first the script worked more often than not, now the reverse is true.

The specific error seen in the console is “download failed.” The downloads are properly cached on the server.

In an earlier version of the script I was (unnecessarily) copying one of the downloads into /tmp before running it; now I’m running it from Utilities. I mention this b/c I did some troubleshooting for that script, which appears to have had the same problem I’m describing here.

To address the failures of the earlier script one had to delete (on the client machine) the locally cached instances of the downloaded files from /Library/Application Support/BigFix/BES Agent/__BESData/__Global/__Cache. There would also be a couple of small files (called “Pending” and “0”) wedged in the numbered action folder in /Library/Application Support/BigFix/BES Agent/__BESData/__Global/__Download/actionsite.

The local client log recorded the failure thus:

ActionLogMessage: (action 118655 ) JobReady - ok to start

ActionLogMessage: (action 118655 ) MoveFiles before running action failed

I don’t know if the current version of the script, which doesn’t copy anything into /tmp, exhibits precisely this behavior, b/c I haven’t yet sat down and physically looked at any machines on which the current script is failing.

One possible complicating factor, though I’m now suspecting it’s not relevant, is that the machines on which this script is executed may be in the process of having their drives encrypted by PGP. But I’m now seeing failures on machines that have long since been fully encrypted.

Is there anything obviously problematic w/ my action script? Am I running into a known bug? We’re still using the 6.0.9 version of the Mac BES client.

Thanks for your help. Pls let me know if you need additional information.

-Jay

prefetch pgpwde_status_script sha1:6f51678d0bdc6c405d4d75ed43d726cd0469f95f size:80 http://www.stanford.edu/.../pgpwde_status_script

utility __Download/pgpwde_status_script

wait /bin/sh “{posix path of client folder of current site & “/__Download/pgpwde_status_script”}”

prefetch PgpEnforcer sha1:f2fca71e16b1236b6d3868db822dfb1d2cae1cfa size:144580 http://www.stanford.edu/.../PgpEnforcer

utility __Download/PgpEnforcer

wait “{posix path of client folder of current site & “/__Download/PgpEnforcer”}”

wait touch “/Library/Preferences/edu.stanford.PGPLastCheck.txt”

wait /bin/sh -c “echo LastCheck={hour of now as string}:{minute of now as string} > /Library/Preferences/edu.stanford.PGPLastCheck.txt”

(imported comment written by BenKus)

Hey Jay,

Do you happen to have any agent folders open on these systems? The agent will want to clean out and delete files/folders before it starts an action and I think this error is indicating it couldn’t do that…

Ben

(imported comment written by jstamps91)

Ben Kus

Do you happen to have any agent folders open on these systems? The agent will want to clean out and delete files/folders before it starts an action and I think this error is indicating it couldn’t do that…

Hey Ben:

This seems extremely unlikely. I’m seeing the problem on more than a dozen systems, and the likelihood that their users would have BES agent directories open is probably very small. When I encountered this problem on one of my own test machines (using an earlier version of the same script, as I noted), I had no agent folders opened - till I opened them to clear them out manually.

Any other reasons you can think of why the agent might be unable to perform the necessary deletions?

-Jay

(imported comment written by BenKus)

The other things that might be interesting to double check:

  • File permissions (for SYSTEM account)
  • AV or other agents holding locks on files
  • Disk space issues

All seem sort of unlikely but you might want to check these out…

Ben

(imported comment written by bchae91)

I’m havthing the same problem. I created the task using the software distribution wizard.

ActionLogMessage: (action 867 ) MoveFiles before running action failed

ActionLogMessage: (action 869 ) DownloadJobFailed

(imported comment written by bchae91)

also seeing this error, which i haven’t seen before:

FAILED to Synchronize - Active action prevents gather.

(imported comment written by BenKus)

Hey bchae,

The errors you are noting will definitely happen if you have an process running and you try to run another action…

Here is an example:

  • You have an action with simple actionscript:

download http://somesite.com/somefile.exe

run somefile.exe

  • Note that because you use “run” rather than “wait” the action will complete without waiting for the process to complete.
  • If you now try to run another action, the file will still be running and thus when the BigFix Agent tries to clear the file, Windows will complain and prevent the file from being deleted… In this situation, the BigFix Agent will record the errors you are talking about.

To avoid this situation, copy the files out of the BigFix download folder before running them when using the “run” command.

Ben

(imported comment written by bchae91)

The task that i am trying to deploy is a one line command to uninstall a piece of software that is already in C:\Program files. I am using a waithidden command. I also don’t see anything in the _download folders either.

(imported comment written by BenKus)

If you restart the client and try again, does it change anything?

Ben

(imported comment written by MrFixit)

I just encountered this today when a developer had a series of downloads in his action and immediately went into a lengthy createfile to create a .BAT file that was then moved to the __download folder to be run. Action reported that the “Downloads Failed”, but the log showed that the “MoveFiles” failed and stopped the action.

Should he not move the createfile to the __download folder? I think this is actually the issue but looking for guidance.

Is there a perferred way to wait between downloads and parts of an action like a createfile so they don’t conflict? He doesn’t want to run the download at that point but later via the .BAT fie, so a WAIT is not an option. He was using a Continue If for sha1 and size checks and it was thought that the action would wait at these points for the download to complete and be validated. The last download was a “download now”, but it also had a continue if checking sha1 and size against relevance that pulled these values from the registry.

If the prefetch performs the downloads before any of the other action steps are run, would this be the better way to create this action and avoid this conflict or would it still be necessary to have a WAIT?

Also note: we are prior to 7.2 so no dynamic downloads yet, hope to be there soon.

(imported comment written by BenKus)

Hmm… the approach laid out sounds problematic… can you post the action?

Couple note:

  • download and prefetch commands will complete (or fail) before the action runs.
  • download now is done at runtime, but it doesn’t use the relays.
  • “continue if” will fail if it is “false” and it will not wait.
  • the __download folder is managed by the agent and is cleaned out after actions run… If there is an open process or some sort of open handle on this folder, then the agent won’t be able to run ny more actions and it will report errors in its log about not being able to clear the download folder).

I expect that many of the problems noted in this thread are related to that last point above.

Ben