?
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
Medium Priority
?
1,217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 66

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 15

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
10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Suggested Courses

771 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