Solved

File System Task in a SSIS Package behaves differently when run as SQL Agent job as when run in BIDS/SSDT in SSIS 2012

Posted on 2014-09-24
10
1,057 Views
Last Modified: 2016-02-11
I have an ssis package that runs a file system task to copy all files from one folder on one server to another. It loops through the files using a for each loop container. I assign values via variables in this. It runs fine in BIDS/SSDT, but when I run it as a sql agent job on my production server it comes up with the following error and I can't fathom why. Any one got any ideas please?

Executed as user: xxx. Microsoft (R) SQL Server Execute Package Utility  Version 11.0.5058.0 for 32-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  18:22:40  Error: 2014-09-24 18:25:02.61     Code: 0xC0014054     Source: Inform of error      Description: Failed to lock variable "" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".  End Error  Error: 2014-09-24 18:25:02.61     Code: 0xC002F304     Source: Inform of error Send Mail Task     Description: An error occurred with the following error message: "Failed to lock variable "" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".  System.Runtime.InteropServices.COMException: Failed to lock variable "" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".".  End Error  Error: 2014-09-24 18:25:02.64     Code: 0x00000006     Source: Check for Missing Files      Description: The script returned a failure result.  End Error  DTExec: The package execution returned DTSER_SUCCESS (0).  Started:  18:22:40  Finished: 18:25:04  Elapsed:  144.031 seconds.  The package executed successfully.  The step succeeded.

Open in new window

0
Comment
Question by:Grffster
10 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 40342413
<potentially stupid question>
Are you using a fully-qualified path, such as \\server\share\folder\file.txt, or a mapped letter such as F:\folder\file.txt?
If letter, then the server has to have the same letter mapping as on your dev box.
0
 

Author Comment

by:Grffster
ID: 40343548
Yes, I am using fully-qualified path here unfortunately so not that easy a fix sorry.
0
 
LVL 14

Expert Comment

by:Vikas Garg
ID: 40343599
Hi,

I think you have used variables in SSIS package for which you have applied values while calling them as a Job.

You need to create environment and assign values to the variables..
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Author Comment

by:Grffster
ID: 40343614
But I've created many variables and the others seem to be working fine.
0
 

Author Comment

by:Grffster
ID: 40348132
I've requested that this question be closed as follows:

Accepted answer: 0 points for Grffster's comment #a40343614

for the following reason:

Found the issue. My event handler didn't have a variable set.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 40348133
Re-opening the question to allow the author to post a valid solution or request the question be deleted.
0
 

Accepted Solution

by:
Grffster earned 0 total points
ID: 40349557
I had an event handler for errors which was assigning some text according to a variable but the variable had not been set. Setting that variable to equal some text fixed the issue. It was erroring on the server due to a folder permission issue running under that user account.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
My client sends a request to me that they want me to load data, which will be returned by Web Service APIs, and do some transformation before importing to database. In this article, I will provide an approach to load data with Web Service Task and X…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now