package failed to load due to error 0x80131534 "(null)". This occurs when CPackage::LoadFromXML fails

1

I ran the following batch file on our SQL Server "9". It is an SSIS 2012 package with no connections, no tasks, no code. It's an empty package.

ECHO before dtexe!
REM "DTExec.exe" /FILE "E:\SSIS\MyAppName\Packages\Empty2012Package.dtsx"
"D:\SQL2012\110\DTS\Binn\DTExec.exe" /FILE "E:\SSIS\MyAppName\Packages\Empty2012Package.dtsx"
SET RESULT=%errorlevel%
ECHO RESULT AFTER DTEXEC=%RESULT%
exit /B %RESULT%

Here's my output:

----------------------------------------------------------------
Output of messages for workload object TEST/GHG1990R.28/MAIN
Start date Tue Oct 06 20:45:38 2015
----------------------------------------------------------------

C:\Users\MyServerId>ECHO before dtexe!
before dtexe!

C:\Users\MyServerId>REM "DTExec.exe" /FILE "E:\SSIS\MyAppName\Packages\Empty2012Package.dtsx"

C:\Users\MyServerId>"D:\SQL2012\110\DTS\Binn\DTExec.exe" /FILE "E:\SSIS\MyAppName\Packages\Empty2012Package.dtsx"
Microsoft (R) SQL Server Execute Package Utility
Version 11.0.5058.0 for 64-bit
Copyright (C) Microsoft Corporation. All rights reserved.

Started: 8:45:39 PM
Could not load package "E:\SSIS\MyAppName\Packages\Empty2012Package.dtsx" because of error 0x80131534.
Description: The package failed to load due to error 0x80131534 "(null)". This occurs when CPackage::LoadFromXML fails.
Source: {BA581388-EFF5-4BC7-89E7-48E11D6DF0AE}
Started: 8:45:39 PM
Finished: 8:45:39 PM
Elapsed: 0.094 seconds

C:\Users\MyServerId>SET RESULT=5

C:\Users\MyServerId>ECHO RESULT AFTER DTEXEC=5
RESULT AFTER DTEXEC=5

C:\Users\MyServerId>exit /B 5

I get the same error regardless of whether I run with the 32 or 64 bit DTEXEC utility. When I run the same batch file against the same package on another SQL Server, server "80", I get no error.

All of the packages work on server 80, none work on 9. I get the above error every time on server 9.

When I execute this on both 80 and 9,

select @@version

I get the same result

Microsoft SQL Server 2012 - 11.0.5058.0 (X64) 
    May 14 2014 18:34:29 
    Copyright (c) Microsoft Corporation
    Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)

I am able to successfully use the sqlcmd and bcp utilities on 9, but not the dtexec utility.

The error that I am getting seems to suggest that I am using an old version of dtexec to open up a newer package, for example, trying to use a SQL 2008 dtexec util to execute a new SQL 2012 package.

Clearly the packages are not corrupt because all of the packages work on 80 and copies of the exct files on 9 all do not work.

The only thing I can think of is a installation issue with SQL Server, for example, a corrupt install or unregistered dll.

As far as I can tell, this is the first and only version of SQL Server installed on these machines, so I shoould not be acidentily runnning an old version of DTEXEC with a newer 2012 package.

Here is the complete Empty2012Package.dtsx file:

<?xml version="1.0"?>
<DTS:Executable
  DTS:refId="Package" xmlns:DTS="www.microsoft.com/SqlServer/Dts"
  DTS:ExecutableType="SSIS.Package.3"
  DTS:CreatorName="MyDOMAIN\MyLanId"
  DTS:CreatorComputerName="MYCPTR"
  DTS:CreationDate="7/2/2015 8:26:52 AM"
  DTS:PackageType="5"
  DTS:VersionBuild="2"
  DTS:VersionGUID="{00FD1F37-6375-4942-91D3-9ECA0B131FFD}"
  DTS:LastModifiedProductVersion="11.0.2100.60"
  DTS:LocaleID="1033"
  DTS:ObjectName="Empty2012Package"
  DTS:DTSID="{1539BA56-F17B-438E-A874-A2151F2F79C5}"
  DTS:CreationName="SSIS.Package.3">
  <DTS:Property
    DTS:Name="PackageFormatVersion">6</DTS:Property>
  <DTS:Variables />
  <DTS:Executables />
  <DTS:DesignTimeProperties><![CDATA[<?xml version="1.0"?>
<!--This CDATA section contains the layout information of the package. The section includes information such as (x,y) coordinates, width, and height.-->
<!--If you manually edit this section and make a mistake, you can delete it. -->
<!--The package will still be able to load normally but the previous layout information will be lost and the designer will automatically re-arrange the elements on the design surface.-->
<Objects
  Version="sql11">
  <!--Each node below will contain properties that do not affect runtime behavior.-->
</Objects>]]></DTS:DesignTimeProperties>
</DTS:Executable>

Since I used SQL 2012 to create the dtsx file, I knew that is was a 2012 package. However, according to this web page,

http://www.techbrothersit.com/2014/09/ssis-how-to-find-version-of-ssis.html

PackageFormatVersion of 6 indicates a 2012 package.

I don't have access to the server to see the versions of each dtexec.exe file. I hope to get this information soon.

When I run the same batch file with the same package on 80, as mentioned above, it works:

 ----------------------------------------------------------------
 Output of messages for workload object C1_GHG1_TEST/GHG1999I.11/MAIN
 Start date Tue Oct 06 22:21:08 2015
 ----------------------------------------------------------------

 C:\Users\MyServerId>ECHO before dtexe! 
 before dtexe!

 C:\Users\MyServerId>REM "DTExec.exe" /FILE "E:\SSIS\MyAppName\Packages\Empty2012Package.dtsx" 


     C:\Users\MyServerId>"D:\SQL2012\110\DTS\Binn\DTExec.exe" /FILE "E:\SSIS\MyAppName\Packages\Empty2012Package.dtsx" 
     Microsoft (R) SQL Server Execute Package Utility
     Version 11.0.5058.0 for 64-bit
     Copyright (C) Microsoft Corporation. All rights reserved.

     Started:  10:21:08 PM
     DTExec: The package execution returned DTSER_SUCCESS (0).
     Started:  10:21:08 PM
     Finished: 10:21:08 PM
     Elapsed:  0.203 seconds

     C:\Users\MyServerId>SET RESULT=0 

     C:\Users\MyServerId>ECHO RESULT AFTER DTEXEC=0 
     RESULT AFTER DTEXEC=0

     C:\Users\MyServerId>exit /B 0 

Any ideas on what may be causing this error? I'm thinking that this is a server SQL Server setup issue rather than something that I can control.

Your thoughts?

Update

The problem is related to security permissions. When we try running the job in the CA Scheduler udner MyServiceID, an Admin with access to the box then checked the Event Log and found this error:

The user has not been granted the requested logon type at this machine.

Furthermore, When a user who is in the local Admin group remotes to this server and launches the same batch file, the job runs successfully.

According to this link,

https://technet.microsoft.com/en-us/library/cc732593(v=ws.10).aspx

The error can be resoled by granting the right to "Allow User To Log On Locally." The user is already granted "Allow Log On As Batch" rights. When I dop a "net user MyServiceId" command from the command line, I also see that the ID is active and allowed on all Workstations at all times.

When I requested "Allow user to LogOn Locally" rights to be granted, apparently even the "Admins" could not grant this right because is is disallowed by Group Policy. Because this is the only server where this is happening, I am left wondering what is different about this server assuming that all serevrs share the same Group Policy. One thing that we noticed is that the OWNER property on the dtsx file is not MyServiceId and in environments. I don't have the righs to change this but I don't thing that this is it. The MyServiceAccount does have full control of the folder where the batch files and packages reside.

Update 2 Since this is now clearly a security issue, perhaps it would help if I try an state the question after stating the known facts:

  1. MyServiceId has execute access to the local folder, E:\SSIS\MyAppName\Packages\, in which SSIS package resides
  2. MyServiceId has execute access to the local folder, D:\SQL2012\110\DTS\Binn\, in which DTEXEC resides
  3. MyServiceId has LogOn As Batch rights on the Server.
  4. MyServiceId is an active account that is allowed on all Servers and Workstations

Question: Given the simple one line batch file that calls DTEXEC passing a package path as a param, what could be contributing to the error that I am getting? What additional things can I look for? Sicne "Allow User To Log On locally" is never set on other server, what can be different on this server that is contributing to this error:

The user has not been granted the requested logon type at this machine.

Is the value of the OWNER property of the dtsx file relevant?

Update 3 Calling process Name: C:\Windows\System32\LSASS.exe

Is this a hint?

Update 4

In production, where it works,the service id is executing with a Network Logon type of 3, which is interactive. On 9, where it's giving us this error, it is executing with a logon type of 2, which is interactive. (We do not have the option to turn on "Allow Log On Locally" for the uyser on 9. This is verboten.

What would account for the same ID running on 2 different machines on teh same domain, to run as different user types?

ssis
sql-server-2012
asked on Stack Overflow Oct 7, 2015 by Chad • edited Nov 4, 2015 by Chad

2 Answers

1

I encountered this error shortly after making a modification to my machine.config file on my workstation. I resolved my issues in the machine.config (I had placed a node under the wrong parent node) and this error went away.

Unfortunately, since the error is vague, this may not be the solution for your situation. Just thought I'd share in case it helps someone.

answered on Stack Overflow Jan 5, 2016 by Phas1c
1

I changed my SQL service account to local system. My SSIS services were also running from local system only.

So, ideally we can try keeping both as same services account.

NOTE: this needs to be applied only in case we are not able to change the access rights of SQL agent service account.

answered on Stack Overflow Sep 15, 2018 by AMAN AKASH • edited Sep 16, 2018 by Alex.K.

User contributions licensed under CC BY-SA 3.0