Failed to open package file due to error 0x800070035 - batch-file

Full error message:
Could not load package "\\File.dtsx" because of error 0xC0011002.
Description: Failed to open package file "\\File" due to error 0x80070035 "The network path was not found.". This occurs when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of specifying an incorrect file name when calling LoadPackage or the specified XML file has an incorrect format.
This is a really strange issue. We have an SSIS package which is called via dtexec in a batch file. The SSIS package runs in 64 bit and we also use the 64 bit version of dtexec.
We have a task scheduler which calls the batch file which calls package. It looks like so:
cd C:\Program Files\Microsoft SQL Server\120\DTS\Binn
dtexec.exe /f "\\local\it$\Development\.NET Projects\Reporting\DailyUpload_DEV\DailyUpload\File.dtsx"
However sometimes the package will run with no problems at all and sometimes it throws an error which you can see above.
Why is this happening?
We don't change accounts, we also use admin so I know it's not a security issue.

Try adding net use before running the command so it makes that initial connection before pulling the file
Net use \\local\it$ "passwordhere" /USER:domain.username
cd C:\Program Files\Microsoft SQL Server\120\DTS\Binn
dtexec.exe /f "\\local\it$\Development\.NET Projects\Reporting\DailyUpload_DEV\DailyUpload\File.dtsx"

Related

SSIS Run through a batch file using DTExec.exe

I have an SSIS package that needs to run by a batch file. When I execute the SSIS package through SSDT it's working fine. But When I execute through "DTExec.exe" it's throwing below error message. I tried the deferent location of "
" but I was failed. What could be the reason?
After switching to the 64bit dtexec located in the 140 directory, I have an error indicating it cannot create a task from XML for task "Script Task"
Targets SQL Server 2017
The dtexec you'll find under IDE\CommonExtensions\Microsoft\SSIS\XXX\Binn\ where XXX is your version number is not for "regular" use. Those are for use with the Visual Studio/SSMS installation.
Instead, you're likely going to want one that is located in
C:\Program Files\Microsoft SQL Server\140\DTS\Binn\DTExec.exe
or
C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\DTExec.exe
depending on your 32 vs 64 bit requirements as well as the version of SQL Server you have installed (and have targeted your packages)
Your screenshot shows 150 but I don't see a 150 version of the dtexec installed on your machine but that could just be my eyes

Run ssis package in agent job while both are on separate machines

I am trying to run ssis package through agent jobs. The packages and the sql server are on different machines.
When the agent job tries to run ssis package step the job fails with following error:
Executed as user: Domain\username. Microsoft (R) SQL
Server Execute Package Utility Version 13.0.5026.0 for 64-bit
Copyright (C) 2016 Microsoft. All rights reserved. Started:
1:42:42 AM Error: 2020-01-23 01:42:42.49 Code: 0xC0011007
Source: {07BB41B6-D0DF-4349-B9AE-498397D214D7} Description:
Unable to load the package as XML because of package does not have a
valid XML format. A specific XML parser error will be posted. End
Error Error: 2020-01-23 01:42:42.49 Code: 0xC0011002 Source:
{07BB41B6-D0DF-4349-B9AE-498397D214D7} Description: Failed to
open package file
"D:\ssis_packages\package.dtsx"
due to error 0x80070003 "The system cannot find the path specified.".
This occurs when loading a package and the file cannot be opened or
loaded correctly into the XML document. This can be the result of
specifying an incorrect file name when calling LoadPackage or the
specified XML file has an incorrect format. End Error Could not load
package
"D:\ssis_packages\package.dtsx"
because of error 0xC0011002. Description: Failed to open package file
"D:\ssis_packages\CoreLogic\CoreLogicSSIS\Real_Estate_Monthly.dtsx"
due to error 0x80070003 "The system cannot find the path specified.".
This occurs when loading a package and the file cannot be opened or
loaded correctly into the XML document. This can be the result of
specifying an incorrect file name when calling LoadPackage or the
specified XML file has an incorrect format. Source:
{07BB41B6-D0DF-4349-B9AE-498397D214D7} Started: 1:42:42 AM
Finished: 1:42:42 AM Elapsed: 0.047 seconds. The package could not
be found. The step failed.
I need some suggestion as what is the best way to run ssis package when sql server and packages are on different machines.
There can be below defined reasons and solutions.
1. The error says it cannot find the package. Just double-check if this is the correct path for your package:
D:\ssis_packages\CoreLogic\CoreLogicSSIS\Real_Estate_Monthly.dtsx
2. It looks like a local path, so if indeed your package is on the D: Drive of another server make sure to add the server name in front of the path:
//server-name/ d$/
ssis_packages\CoreLogic\CoreLogicSSIS\Real_Estate_Monthly.dtsx
3. Grant the account running your SQL Agent job (I am guessing it's the SQL Agent account, but you should double-check that) access rights to the folder where your SSIS package is stored.
4. If the above did not solve the issue, also check if the SSIS package and your SSIS installation on the server where you are running it are the same. Running a 32bit SSIS package on a 64-bit system/SSIS will result in a similar error message.

Could not load package "\File System\ because of error 0x80070002. Description: Unable to find the specified file. Source: MsDtsSrvr

We are building a new environment having SQL server 2014 and migrating our SSIS job to the new environment.
We have a SSIS job named as ABCD (assume)
The job is deployed as file system deployment:
C:\Program Files\Microsoft SQL Server\90\DTS\Packages\ABCD\ABCD.dtsx
While executing, It gives an error as
Could not load package "\File System\ABCD\ABCD because of error 0x80070002. Description: Unable to find the specified file. Source: MsDtsSrvr
Please suggest how to solve this issue, Also as the environment is controlled I am unable to try changes

How to run a vbscript in wix burn ExePackage?

I need to make some changes in an xml file after I've installed a couple of MSI. For that I was thinking calling a vbscript using the bat file with the %* trick. My problem is that I get an 0X80070001 error, but when I run the script manually it works fine.
Code in chain:
<ExePackage
Id="CultureChange"
SourceFile="run.bat"
DisplayName="Changing Default Language"
InstallCommand='cscript Script.vbs "[DefaultCulture]"'
PerMachine="yes"
Cache="yes"
Compressed="yes">
<Payload SourceFile="Script.vbs"/>
</ExePackage>
I also tried calling cscript with C:\windows\SysNative\cscript.exe but same result.
log:
Applying execute package: CultureChange, action: Install, path: C:\ProgramData\Package Cache\1608BB75347CD8C40187E5F3C0A969ED73A98D51\run.bat, arguments: '"C:\ProgramData\Package Cache\1608BB75347CD8C40187E5F3C0A969ED73A98D51\run.bat" C:\windows\SysNative\cscript.exe Script.vbs "it-IT"'
Error 0x80070001: Process returned error: 0x1
Error 0x80070001: Failed to execute EXE package.
Error 0x80070001: Failed to configure per-machine EXE package.
Also note that the MSI can't be modified so I can't make the changes in the xml file there.
Update:
I gave a solution that worked on Windows 8.1 but when I tested it on Windows 7 it still gave me the same error.
here is the code:
#echo off
pushd %~dp0
C:\Windows\SysWOW64\cmd.exe /c cscript Script.vbs "%1"
I also found some documentation on the error:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd319335(v=vs.85).aspx
A write request was made to a resource on the device that was opened
in Read mode using IPortableDeviceResources::GetStream, or a read
request was made to a resource opened for Write or Create.
I watched the vbscript file and it was never accessed.
Anyway, I went with editing the xml file in my managed bootstrapper in c# and not trying to run the vbscript but I'm leaving this question open since it's not really a good enough solution.

Launching SSMS 2014 VsDebugPresentationPackage Error

I am getting this error when trying to launch SQL Server Management Studio 2014.
Package VsDebugPresentationPackage did not load correctly.
And in error log:
SetSite failed for package [VsDebugPresentationPackage, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]
Any ideas?
If you run the SSMS with /Log you would be able to find an xml file named "ActivityLog.xml" here:
"C:\Users\\AppData\Roaming\Microsoft\AppEnv\10.0"
Going through that file you will find a line which is saying config files is not having the root element. If so, simply remove any sub folder of "C:\Users\\AppData\Local\Microsoft_Corporation". Then run SSMS with admin privilege and bingo...
This little solution took 1 day of my sprint...

Resources