KNOWN ISSUE: Having difficulty with UpdateJob using the ASDK

Article:TECH25642  |  Created: 2006-12-18  |  Updated: 2007-10-04  |  Article URL http://www.symantec.com/docs/TECH25642
NOTE: If you are experiencing this particular known issue, we recommend that you Subscribe to receive email notification each time this article is updated. Subscribers will be the first to learn about any releases, status changes, workarounds or decisions made.
Article Type
Technical Solution

Issue



When trying to use the function UpdateJob the following error continues to be displayed:

Error:    Method failed. Exception: Unable to update job values.  There may be a problem accessing the database or other internal error.
Code:    80131500
Source:     Altiris.ASDK.DS.COM


Environment



Notification Server 6.0 SP3
ASDK 1.4
Deployment Solution 6.8.206 (earlier versions of Deployment Solution are not supported)

Cause



The problem is in the handling of the Script_Task_Table.

"  <Task_Table>" & vbcrlf & _
"    <job_id>0</job_id>" & vbcrlf & _
"    <condition_sequence>0</condition_sequence>" & vbcrlf & _
"    <task_sequence>0</task_sequence>" & vbcrlf & _
"    <task_type>Script</task_type>" & vbcrlf & _
"  </Task_Table>" & vbcrlf & _
"  <Script_Task_Table>" & vbcrlf & _
"    <job_id>0</job_id>" & vbcrlf & _
"    <condition_sequence>0</condition_sequence>" & vbcrlf & _
"    <task_sequence>0</task_sequence>" & vbcrlf & _
"    <script>dir \\x</script>" & vbcrlf & _
"    <os_required>DOS</os_required>" & vbcrlf & _
"    <location>Client computer</location>" & vbcrlf & _
"    <execution_mode_is_production>false</execution_mode_is_production>" & vbcrlf & _
"    <pxe_preboot_option>Default Automation</pxe_preboot_option>" & vbcrlf & _
"    <boot_image_cpu_architecture>Auto</boot_image_cpu_architecture>" & vbcrlf & _
"  </Script_Task_Table>" & vbcrlf & _

If these sections are removed, the problem does not occur.


Solution



Prior to editing any of these files mentioned, backups should be created. This is a BETA version and has only had minimal testing. If there are problems found with this issue please contact support immediately.

There has been an update to this issue. We have received a beta version fix for this from the Deployment Solution Developers. The attached file, "DS SDK.rar", has 2 DLL files, AxDsDm.dll and Altiris.ASDK.DS.dll.

  1. The AxDdDm.dll file can be copied into the "%ProgramFiles%\Altiris\eXpress\Deployment Server" after making a backup copy of your original file.  Then restart the various DS (Deployment) services.
  2. As the Altiris.ASDK.DS.dll file must be put into the GAC there is more to do.
    • Place the file in some location where it can be easily found and dragged into a window.  Placed on the desktop is fine.
    • From the Start\Run enter c:\windows\assembly. This will bring up a window that shows all the assemblies installed on the computer.
    • Drag the DLL file to the Altiris.ASDK.DS assembly. This will create another GAC reference 6.8.9999.0__44d9e4b0b5e733a0. If you enter "C:\windows\assembly\gac\Altiris.ASDK.DS" in the Start\Run command then you will see to entries, one for a 6.8.1015 version and the one just created.
    • The machine.config file for the .NET 1.1.4322 framework will have to be modified. This is necessary because all the references to the DLL will be pointing to the 1015 version where the 9999 version is what must be active. The machine.config files are located in the C:\Windows\Microsoft.NET\Framework\V1.1.4322\CONFIG
    • In the .NET Framework 1.1 machine.config these redirections should be placed just prior to the </runtime> closing tag toward the end of the file, as follows. 

...

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
        <assemblyIdentity name="Altiris.ASDK.DS" publicKeyToken="44d9e4b0b5e733a0" culture="neutral" />
        <bindingRedirect oldVersion="6.8.0.0-6.8.9999.0" newVersion="6.8.9999.0" />
    </dependentAssembly>
</assemblyBinding>

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
        <assemblyIdentity name="Altiris.ASDK.DS.DataSets" publicKeyToken="44d9e4b0b5e733a0" culture="neutral" />
        <bindingRedirect oldVersion="6.8.0.0-6.8.9999.0" newVersion="6.8.1015.0" />
    </dependentAssembly>
</assemblyBinding>

</runtime>


    • If the .NET 2.0 Framework is also installed on the system then its machine.config must be modified. This file is located in the folder,  C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG. The modification must also be placed inside the <runtime> tags, i.e. before the closing tag </runtime>

<runtime>

...
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
             <assemblyIdentity name="Altiris.ASDK.DS" publicKeyToken="44d9e4b0b5e733a0" culture="neutral" />
             <bindingRedirect oldVersion="6.8.0.0-6.8.9999.0" newVersion="6.8.9999.0" />
        </dependentAssembly>
        <dependentAssembly>
            <assemblyIdentity name="Altiris.ASDK.DS.DataSets" publicKeyToken="44d9e4b0b5e733a0" culture="neutral" />
            <bindingRedirect oldVersion="6.8.0.0-6.8.9999.0" newVersion="6.8.1015.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

    • After these modifications the IIS should be reset. Open a cmd shell and enter 'iisreset'.

Once this is done then the ASDK should be able to use UpdateJob correctly. Although the testing has not been completely thorough, all the examples have been run as well as additional samples used for testing this bug. It all seems to work ok but as already mentioned, if there are any problems found they should be reported to support immediately.

To make sure that this modification works, the correct version of the Altiris.ASDK.DS.DataSets must be obtained. It may be 6.8.1013.0, in which case the machine.config files must be appropriately modified or the DataSets will not be found when running and ASDK application.

 


Prior workaround which can still be used.

This was partially resolved in the released 1.4 version. Grabbing the existing information from the job and then immediately putting it back does work. Even modifying the existing information is ok. The current situation is when a task is added to or subtracted from the existing task list in the job. More specifically, the script_task table is the one having the problem. So adding a script task to an existing job will fail.

One way to work around this problem is to use the DeleteJob/CreateJob methods, which does work using the same information. This adds some extra scripting to either extract the information from an existing job, modify it appropriately, then create the new job or to create the new job and delete the existing job.

One of the difficulties of using the DeleteJob/CreateJob combination is the fact that the history (schedule) for the given job is lost. The attached file (Update.rar) is a RAR format file that contains C# code to illustrate one possible approach to maintaining the history of a given job. In essence the process is getting the original job text from The GetJob method and parsing through it for the computers that were part of the original schedule. So once the existing job has been deleted, the new job can be created. However, to put the "history" back, a new schedule must also be created then added to the job through the CreateJobSchedules method. The issue with this is that once a new schedule has been created, it will execute, but if the schedule is set far enough into the future this problem could be considered negligible.

There is a helper class in the attached file called TagParser. This class can take any source XML, complete or incomplete and search for the tag, returning the text that the tag contains. For example, if looking for the <computer_name> tag, the method just takes the tag name "computer_name". It returns a string object that has the textual information contained between the opening and closing XML tags. This approach was used to illustrate one possible method of extracting all computers associated with the given job and its schedule. This can be seen on inspection of the attached code.


Attachments

UpdateJob.rar (2 kBytes)
DS SDK.rar (234 kBytes)


Supplemental Materials

SourceDEFECT
ValueLB 55631
DescriptionLogged in Littlebuggy (Altiris - Lindon, Plymouth) database

Legacy ID



31135


Article URL http://www.symantec.com/docs/TECH25642


Terms of use for this information are found in Legal Notices