SSIS Hangs on .Bat file
I am encountering a weird issue with SSIS. I have a very simple SSIS package that executes a .bat file. Here's the actual file it executes: @Echo Off c: F: cd ReportingServicesScripts rs -i NoteBlankSnapshots.rss -S http://10.90.160.13/ReportServerTest EXIT The .bat file executes a Reporting Services .rss script using the rs.exe utility. When I run the command from the http://10.90.160.13/ReportServerTest EXIT The .bat file executes a Reporting Services .rss script using the rs.exe utility. When I run the command from the command prompt, it runs just fine. When I execute the .bat file manually, it runs and completes. When I execute the actual package, it also completes. But when I schedule the package as a job, it just hangs...it never finishes. The owner of the job is an administrator in SQL Server. I have the SQL Server Agent configured to interact with the desktop - although my .bat file requires no input from the user. I've created other jobs that just execute plain old SQL using the same owneer and these jobs complete just fine. What am I missing? Any help would be appreciated! Thanks!!
__________________Anthony Robinson"If I'm curt with you, it's because time is a factor here. I think fast, I talk fast, and I need you guys to act fast if you want to get out of this. So, pretty please - with sugar on top..."
March 30th, 2007 7:37pm
Does rs.exe prompt you for any input? Or require you to press enter to finish? Anything like that?
Free Windows Admin Tool Kit Click here and download it now
March 30th, 2007 7:57pm
Rs.exe is the utility used to executescripts for Reporting Services. It doesn't require any user input at all. It just takes in a script name and runs it.
I also have the SQL Agentservice set up to interact with the desktop in order to eliminate the possibility it's waiting for any input.
March 30th, 2007 8:09pm
What happens if you run the batch file directly from the agent job, without having SSIS in the loop?
Free Windows Admin Tool Kit Click here and download it now
April 3rd, 2007 2:15am
Ansonee ,
You may add the below codeinto a Script task and finally schedule the package, which will work fine.I hopeyou canadd kind of code also given here. This pops upthe command windowwhich willrun the batch file.But I prefer to run the batch file in the background (run as a background process likethewscript.shelldoes)using few lines of code in script task. Do anybody have a solution for that?
Running a Batch File
Dim ps As Process
Dim psi As ProcessStartInfo
psi.WorkingDirectory = "C:\WINNT\system32"
psi.FileName = "CMD.EXE"
psi.Arguments = "/c \\Server\Job.bat"
p.StartInfo = psi
p.Start()
p.WaitForExit()
April 3rd, 2007 7:15pm
Hey Jeff,
I'm having the same problem, only it's SSIS 2008 and an EXE file. The EXE file runs fine under the SQl Job Agent, and in BIDS, but not as an SSIS package on the Server. I've trying executing the package both as an SSIS Package and via dtexec, but no joy either way.
Any other suggestions?
Thanks,
Bob
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2008 2:56am
BobSilva wrote:
Hey Jeff,
I'm having the same problem, only it's SSIS 2008 and an EXE file. The EXE file runs fine under the SQl Job Agent, and in BIDS, but not as an SSIS package on the Server. I've trying executing the package both as an SSIS Package and via dtexec, but no joy either way.
Any other suggestions?
Thanks,
Bob
turn on logging and post the messages.
September 3rd, 2008 11:44am
OK,
There areseveral places to log and I've activated every one I can find. The only one that seems to yield anything at all is the SSIS event logger...
Code SnippetOnPreExecute,REPTDEV,NT_WORLD\bs61702,Foreach EXE on Sutlej,{A4252A58-C50A-4976-A026-BEB86A502F31},{6691F36D-1090-4C6A-875F-F74C733FD14D},9/2/2008 4:51:30 PM,9/2/2008 4:51:30 PM,0,0x,(null)OnPreValidate,REPTDEV,NT_WORLD\bs61702,Execute EXE File,{A77A61F2-87AC-4E5B-A153-916308774031},{6691F36D-1090-4C6A-875F-F74C733FD14D},9/2/2008 4:51:30 PM,9/2/2008 4:51:30 PM,0,0x,(null)OnPostValidate,REPTDEV,NT_WORLD\bs61702,Execute EXE File,{A77A61F2-87AC-4E5B-A153-916308774031},{6691F36D-1090-4C6A-875F-F74C733FD14D},9/2/2008 4:51:30 PM,9/2/2008 4:51:30 PM,0,0x,(null)OnProgress,REPTDEV,NT_WORLD\bs61702,Execute EXE File,{A77A61F2-87AC-4E5B-A153-916308774031},{6691F36D-1090-4C6A-875F-F74C733FD14D},9/2/2008 4:51:30 PM,9/2/2008 4:51:30 PM,0,0x,Operation Complete
...and nothing after.
Is this the log you were expecting? If not, would you please be more specific?
Thanks,
Bob
Free Windows Admin Tool Kit Click here and download it now
September 3rd, 2008 6:37pm
Never mind, I found it...
Went into IE -> ITools -> Internet Options -> Security -> Local Intranet -> Sites and added the server where the executable was. No more hang...
Bob
September 3rd, 2008 8:48pm
Well, as it turns out...
This was not a complete answer. The process still hangs occasionally. It seems to hang on the first test of the day. If I run the EXE's manually from the server they work fine. From that point on, they work fine under SQL Agent execution.
It's something to do with background (Session 0) jobs and the trust of an executable on another box...
Bob
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2008 11:38pm
Exactly how do we log onto our machine to perform this
Went into IE -> ITools -> Internet Options -> Security -> Local Intranet -> Sites and added the server where the executable was. No more hang...
Thanks,
bill
October 21st, 2010 7:12pm