SQL Job completes successfully but does not execute packages - sql-server

I have taken a look at several articles including this unanswered question: SQL Server Job runs successfully but doesn't execute packages
I have the exact same problem in SQL Server 2012 using the integration services MSDB catalog. I can execute the SSIS packages manually from that catalog, but the agent job doesn't do anything except state that it completed successfully. I have also executed my SSIS packages from within Visual Studio and they worked just fine. Here's the situation and am wondering if it may be permissions:
SSIS packages look for Excel files matching criteria in a network location.
Once found, the SSIS packages writing the data into the database and archive the file to another folder on that same network location.
Emails are sent upon any failure of import of data into the database or migration into the archive folders.
I have the SQL Agent job running the SSIS packages from a package store (MSDB) using the SQL Server Agent Service Account to run under. Currently we are not doing any sort of project deployment to these servers so I am sticking with package deployment. Here are some steps I've taken:
Run packages manually from Visual Studio 2010 (fully successful).
Run packages manually from SQL Server MSDB catalog (fully successful).
Run job manually from SQL Server Agent using parent package as a step that will execute child packages as an external reference (success but nothing happens).
Run job manually from SQL Server Agent using each package as its own step excluding the parent package (success but nothing happens).
Any ideas? Permissions to the network location or need a proxy? Again, I am running Microsoft SQL Server 2012 Enterprise Edition 64-bit. Many thanks for any help you can provide.

Found the problem. My SSIS package has a foreach loop container and, while the tasks inside the loop container couldn't access the destination, the loop container technically completed successfully. We had to give permissions to the account the steps were running under for the job to correct that. These permissions were put on the network location to allow that account access to read and write to that location. Additionally, my Excel connection was 64-bit so we enabled it to 32-bit runtime and this allowed that portion of the process to complete successfully. I re-enabled any disabled tasks and it looks good to go now. Thanks!

I have also faced this scenario many times but when I checked running the package manually,its completing successfully because I was using for each loop container and sequence container as well.In both cases for each loop and sequence were completing without validating other ones.So I checked precedence constraint and change it,Now it working and all the component ran successfully.
Sometimes we miss to choose appropriate precedence constraint, there are many option like on Success ,failure,completion and then for you can choose values from Constraint ,Expression,Expression AND Constraint and Expression OR Constraint.
Initially i was using Expression OR Constraint for success and now changed it to Expression AND Constraint, its working fine for me.
You also need to do this,it will definitely work please try and let me know.

Related

SQL Server SSIS Package Scheduling

We have a package that we created in VS. The package executes perfectly in VS. We then saved and deployed the package to SSIS. Inside SQL Server Management Studio, the SSIS package executes perfectly when done manually. We have 2 packages that we manually execute. We are trying to schedule these 2 packages to run automatically using the SQL Server Agent. When we set up a job and schedule it, the job fails. The first step in the package fails with the error: Failed Validation and returned validation status "VS_ISBROKEN"
We think it has to do with the security on SQL Server Agent, but we have checked and all the permissions seem to be set correctly.
Any help is greatly appreciated!
You should be getting additional error messages other than the VS_ISBROKEN, which will be more helpful in figuring out what's going on. It has been my experience that VS_ISBROKEN almost always refers to an invalid query. For example, the query could be referencing an object that doesn't exist on the target server.
I came across a similar problem in an earlier version of SSMS and found the problem was that the owner of the package in SQL server Agent was incorrect and should be sa or dbo
I don't know if it helps but the symptoms for this seem very similar to mine

SQL Server 2012 Agent SSIS Job Succeeds with Project Config to Environment Broken

This sounds similar to SSIS package SQL job not using new environment variable configuration, but when I did a test on my dev SQL Server box, I didn't have to restart the SQL Server agent. And honestly, if that is what it takes to prevent someone from 'hurting' themselves with this product, then. . . that is absolutely unacceptable.
UPDATE: And now, to follow up on that comment about SSIS package SQL
job not using new environment variable configuration possibly
being a solution.
It is not. I restarted the agent. No dice. Job still runs
successfully. I restarted the SQL Server Agent and Service. Again, no
failure.
This also sounds peripherally related to SSIS 2012 SQL Agent Job
ConnectionString vs InitialCatalog, but I've been working with SSIS
since 2005 and have never seen a connection string configure from it's
individual components. We have ALWAYS put the connecting string in the
.config files and had success.
I've got a problem that I haven't been able to resolve. Appears to be a bug, honestly, but I don't want to be so presumptuous.
I'm running SQL Server 2012 SP3 on Windows Server 2012 R2 in my test environment.
On my dev box, I'm running VS2012 + SSDT-BI.
I built a solution with a single SSIS 2012 project.
I deployed the SSIS Project to my Test SQL Server box.
I configured a new Environment (let's call it Fred).
I add variables to the Fred environment.
Some of these variables are connection strings.
I go back to the SSIS Project in the SSISDB tree. Right-click and configure.
I set all of my project's connection manager's connection string properties (only) to configure from one of Fred's connection string variables.
Now I have everything, connection-wise at least, wired to configure from my Fred Environment.
I created a SQL Server Agent job (of type SSIS) to execute a package.
I check the box to say Configure from environment .\Fred
I complete job configuration.
I right-click the job and choose 'Start Job at Step. . .'
The job executes. Yay! Everything works. Packages all execute. (Everyone is doing the dance of joy!)
Now here comes the part I can't resolve.
As part of my system testing (I'm new and cautious to the 2012+ Project Deployment model) I change a connection string value stored in one of my Fred Environment variables. This connection string was one that my SSIS project's connection manager's connection string (I triple-checked this) was configured to use.
The connection string is now invalid/incomplete and, now if I was to execute the same SQL Agent Job, the expectation is that the executed Package should fail (validation), right?
Well guess what. The job succeeds. (Dance of joy stops.) The packages all execute successfully. I check my test database environment and rows have been added to a table in a DB whose connection string is completed wrong (in the Fred environment).
So, now I think hmm, well, maybe I missed something. I go back in and I delete the environment variable that contains the invalid/incomplete connection string.
I execute the job again. Job succeeds. Uh, What?
I launch my dev instance of SQL Server 2012 (RTM, not SP3, incidentally)
I deploy a test project with the same project connection manager/environment configuration mapping
I go through the same steps. . .
BUT now this time, the job fails as expected. Note: No SQL Server agent restart made/required.
I go back to my Test box
I right click the SQL Agent (SSIS) job
I go to Properties > Steps (page) > Edit (first step. There's only one), and now I'm seeing the warning:
The parameter "SomeOtherSSISProjectParameter" is configured to use an
environment variable, but no environment variable has been selected.
Check the "Environment" checkbox and specify the environment to use,
or specify a literal value for the parameter.
(Microsoft.DataTransformationServices.DTSExecUI.Controls)
Uh, what!?
First off, the Environment check box in this job step is already checked.
Secondly, this parameter is not related or mapped to the the Fred enviro. variable that I changed and then removed.
Thirdly the Environment variable value is not null or empty. It's still there, un-touched from when I first added it to the environment.
(At this point, I'm thinking the SSISDB is corrupt.)
I click passed the warning. Now that I am here in the SSIS Package SQL Server Agent config page, as I try to click OK (without making any changes) I NOW get an expected error message related to the orphaned Environment config.
Property "ConnectionString" of connection manager
"MySSISProjConnManagerName" is configured to receive a value from an
environment variable named "MyFredEnviroVariableName" but there is not
environment variable named "MyFredEnviroVariableName" in environment
".\Fred". Select a different environment, or use a literal value for
the property.
(Microsoft.DataTransformationServices.DTSExecUI.Controls)
So the good news is that I can't click OK to save this corrupt job/step, but the bad news is that I CAN click cancel, and I can right click the job and choose 'Start Job at Step. . .' and have it complete successfully when it absolutely shouldn't.
Yes, I restarted the agent. Yes, I restarted to server.
I tested the scenario on my dev instance (RTM) of SQL Server 2012, and I can't reproduce it. Can anyone else? Better yet, is there a fix solution? SP4?
Any help with this would be MUCH appreciated. As far as I'm concerned this is a show-stopper for using the Project Deployment model with 2012.

SQL Agent Job doesn't execute SSIS package, but doesn't fail

I set up a job to run a SSIS package in the SSIS Catalog, but the SSIS package doesn't start. If I right-click the package and run it, it completes successfully.
When I look in the execution history of the package in the Catalog, there is no sign that it the package was even started by the job.
I created a test package to make sure it isn't the specific package failing, so the package I'm testing with has a SQL Task that does a 'SELECT 1'. Still fails.
The job just stays in the "Executing" state until I stop the job.
I am running SQL Server 2014 Standard Edition, and running the job with a sysadmin account.
Why is the SQL Agent Job not running my package?
Edit: I had a look through this article but it either doesn't apply or I gave it a shot and it didn't work either.
Edit 2: I found an error under the SQL Server Agent Job History: Unable to terminate process 1850 launched by step 1 of job 0x5DAD5416FA09C445B82ABDBB49F75E38 (reason: Access is denied)
Does that mean my service account doesn't have enough permissions on the local machine? However, I AM able to run the job with DTEXEC using the service account without issues...
I have also faced this scenario many times but when I checked running the package manually,its completing successfully because I was using for each loop container and sequence container as well.In both cases for each loop and sequence were completing without validating other ones.So I checked precedence constraint and change it,Now it working and all the component ran successfully. Sometimes we miss to choose appropriate precedence constraint, there are many option like on Success ,failure,completion and then for you can choose values from Constraint ,Expression,Expression AND Constraint and Expression OR Constraint. Initially i was using Expression OR Constraint for success and now changed it to Expression AND Constraint, its working fine for me. You also need to do this,it will definitely work please try and let me know.
When you look at the connections in the SSIS package, did you put in a user id and password? If so, did you add a package password? The reason I ask is that if you don't add a package password, it will strip out things it thinks should be secure (like passwords). You might want to try putting the connection password in a configuration file, and add that file to the job. Either that or password encrypt the SSIS package but you will have to take special care when you run the package for the first time (or when you create the job) because you will need to provide the password that you used to encrypt the package.
Reboot fixes this issue. Reason is because if you look at this message. Unable to terminate process 1850. That is a windows process. I would say reboot. If you really like to enquire before rebooting. You could use sysinternals process explorer. Download it and use that to find process id 1850 which may be hung process in windows.
Thanks
Ali

sql server 2000 dts package fails when scheduled

I have a SQL Server 2000 dts package which copies data from a DBF file to SQL Table
I have created a System DSN and provided UNC Names for both Connection and Database file itself.
It runs smoothly when ran manually but fails when scheduled as a job?
I googled and found that it has to do with the permissions of SQL Server Agent etc
Can anyone guide me to the right source/post a solution?
"The error says xyz.dbf doesn't exist" in the job history
This is related but separate question
If i am pulling data from one SQL server to another using dts package provided a condition only,For example ,copy the data between the servers if SourceServer table has a value "OK"
i.e if SourceServer.SourceDB.Dbo.CheckStatusTable.Statuscolumn="OK" then copy the value else do not copy
If I have something like above condition how do i embed this into a dts package?
Thanks
Hey - I'll answer the first question in your post regarding the error you are receiving. When you run a DTS package manually, it runs under your context using your permissions. When run as a scheduled job, the package runs under the context of the job agent, in this case SQL Server agent.
It appears that the agent is lacking permissions that you have in attempting to complete the operation. Since the error is mentioning the DBF file, I'd start there. Check any permissions for the file itself or whether the context is being passed properly.

SQL Server 2000 job failure from DTS package versions?

I've been having a reoccurring problem that escapes me at this point. I have a job set up in SQL Server 2k that has a few command steps which are followed up by 4 steps that just call DTS packages on the same server. When it comes to calling the packages, the job fails with no real reason given. Ok fine...
Well the thing that I can't figure out is that if I run the packages in order separately they work 100% of the time. I've deleted the packages entirely and re-added them as well as modifying the corresponding step. Am I missing something?
Is there something inherit with the DTS package versioning that causes the job to fail when the package runs just fine as a standalone?
Thanks.
We've always had issues with DTS packages on our SQL Server 2000 databases. You could try checking the windows event viewer/system error logs to see if there is anything more detailed in there.
We've had credentialing issues before that jobs would fail because the windows account running the job may have become inactive - so maybe the credentials the first job is running under doesn't have access to run dts packages, but you (as an administrator) do ?

Resources