Integration Services Catalog - Access To Path Is Denied - sql-server

Cannot seem to find any concise information on this at all so trying my luck here.
Recently have setup Integration Services Catalogs because at present all our SSIS packages are stored within a folder and just ran as a File. We wish to move these, which has worked fine.
I have created a basic SSIS Package that puts a Username into a SQL Table and then also a File System Task to Delete a File.
When the package is ran from the Catalog via SSMS it completes the SQL side of things perfectly fine, placing both the Username running the package and the data into the SQL table, however it fails on the File System Task with
"File System Task: Error: An error occured with the following error message : "Access to the path "xxxx" is denied.
I have changed the SQL Agent Job on the SQL Server to have the permissions of our Administrator Account with no luck.
I can confirm the folder in question is Shared, it has FULL Read/Write Permission to "Everyone" and yet I still get this error.
I even went to the trouble of creating a new folder and just enabled full sharing to everybody on it - I still get the same access is denied.
Seen a previous post on stackoverflow about NETWORK SERVICE being added, can also confirm that this has full permission to the folder and thus it rules this out also.
Any thoughts would be appreciated.

Related

Double hop issue? - SSIS gives access denied when writing to a flat CSV file on a network share

I'm hoping someone can help me resolve and issue I'm running into. I have a user run app that calls an SSIS package to create a CSV file on a network file share. The app then processes the CSV file. This had been working but then we started getting an Access denied error coming from the SSIS package. The app it self is able to read/write to the file and the directory. When I run the SSIS package in Visual Studio on a VM then the package is able to create the output file and the app can process it. I was getting issues even reading the file from TSQL. I have been working with our support staff to edit the user delegation settings in Active Directory and I have gotten to the point where I can use TSQL to read the CSV file without issues. If I start the SSIS job using TSQL the job runs without errors. When I execute the package from the App using DT_EXEC then I get access denied. When I start the job using SSMS, I get access denied. I'm thinking this is still a double hop issue.
The msDS-allowedToDelegateTo setting on both server A and file server B are:
server A (running SQL Server and SSIS):
cifs/VM-SQL-B
cifs/VM-SQL-A.Domain.Biz
cifs/VM-SQL-A
cifs/VM-SQL-B.Domain.Biz
WSMAN/VM-SQL-B.Domain.Biz
HOST/VM-SQL-B
MSSQLSvc/VM-SQL-A.Domain.Biz:1433
MSSQLSvc/VM-SQL-B.Domain.Biz:1433
server B (File server):
cifs/VM-SQL-A.Domain.Biz
cifs/VM-SQL-A
cifs/VM-SQL-B.Domain.Biz
cifs/VM-SQL-B
WSMAN/VM-SQL-A.Domain.Biz
HOST/VM-SQL-A
MSSQLSvc/VM-SQL-A.Domain.Biz:1433
MSSQLSvc/VM-SQL-B.Domain.Biz:1433
I looking for input as to what I am missing.
Thanks much,

SQL Server Deployed SSIS package won't open files despite SA account having access to folder

I posted a similar question before, but I have now came back to the point where I need to deal with this and after some tuning I have managed to get rid of all the errors, except one warning that basically tells me that the path provided to the package not finding any files in the directory (which is false). This almost makes me want to believe this is again a permissions issue. As when I run the package locally it all works fine. Here is the warning:
Same message appears when I right click SSIS package under the catalogue and directly try to execute the job.
I made sure that the caller has full permissions to the folder in question
SQL Server Agent Job calls the job like so
With a single step in it to execute the SSIS package from the catalogue:
The history of the executions is all successful and the history of SQL Agent job is all green
One of the suggestions I got was to open SQL Server Configuration manager but I don't appear to have access to that. I am new to this whole process so I am not sure if authentication has something to do with it or the sa account's permissions.
Note: I am working on this on a remote dev server and not directly on my pc.
Any help would be greatly appreciated.
Since you're running the package as the Agent Service Account:
The permissions need to be applied to the SQL Server Agent Service Account or its per-service SID.
You can see the service account with PowerShell like this:
PS C:\Users\david> (Get-WmiObject win32_service | where Name -eq "SQLSERVERAGENT").StartName
NT Service\SQLSERVERAGENT
Turns out the database instance was on a whole different server that I wasn't even given access to. That server obviously didn't have the path specified in the SSIS package, so what I had to do is create a folder for files in the correct server, reroute my files there, and change the SSIS package path after obtaining the access to the server where DB instance lives. Me being new to all this, it was absolute frustration especially since our team is small and I am new in it I can't just ask someone questions about this all the time. Hopefully this will save someone a lot of time.

Deployed SSIS package will not read a file

I have an SSIS package that is supposed to read a folder and if the folder contains any text files, it will read them and store the data into a database. The package works flawlessly from the file system, however when I deployed it it fails.
The package uses a project level variable that remains consistent that acts as a folder path to see which folder to look in for files.
The SQL Server Agent gives me this error:
After looking at the execution report I see following error messages if I execute it with the service account through SQL Server Agent:
"The file name property is not valid. The file name is a device or contains invalid characters"
"The file name '(path here)' specified in the connection was not valid"
"The Flat File Connection manager failed validation"
However, if I run it myself by directly right clicking on the package in the catalog and executing, the execution report will come back as successful but it will contain a warning that says: "Read Files From File Input Folder Warning: The For Each File enumerator is empty. The For Each File enumerator did not find any files that matched the file pattern, or the specified directory was empty"
I suspect it is a permissions error, but I haven't dealt much with the permissions in Microsoft SQL Server and the service account that I am using was not created by me. I have tried changing the security of both package and project from the default "Encrypt sensitive data with user key" to "Do not save sensitive data", rebuilding and redeploying but that didn't help at all.
It is most likely a permissions error but I've been puzzled on how to go about it. Any help is much appreciated!
EDIT: After setting the "Delay Validation" on tasks in the control flow and executing the package with SQL Server Agent it now comes back with 2 less errors
For filesystem task to work the executing account need permission to the folder in question. When you execute the package via the SQL-agent the package is executed under the account running the SQL-agent account, when you right click the package and press execute the package is executed as your account.
One problem could be that the SQL-agent account doesn't have permission to the folder, and can't enumerate the content. You can verify this by changing the SQL-server account to your own account temporary and running the job again:
Open Sql Server Configuraiton Manager
Under SQL Server Services double click SQL Server Aggent
Change the account to your own account
Restart the service
If this resolvs the problem, change back to the SQL-server account and check the folder permissions on the folder you are trying to enumerate. Add the SQL-agent account or group the account is included in to have permission to read the folder. Obviously you can also just check the folder permissions to begin with, and make sure the executing account have permission to it.

SSIS Foreach File Enumerator finds no files when executed from deployed package

I've seen this question asked several times but never with a satisfacory answer. I have read through all the posts I can related to this and tried as much as I possibly can.
I have an SSIS package that loops thru a network folder of Excel files, I won't explain what it does inseide the loop container as that is not relevant.
I refernce the folder via a UNC \servername\folder
The package works fine from within Visual Studio.
I deployed the package to the Integration Services Catalogs on the
server
After I deploy, I connect to the server from my local pc via SSMS and then I execute it from SSMS via "Integration Services Catalogs"... Execute - This fails.
However If I remote desktop onto the SQL Server box, then start SSMS, connect to the SQL Server using my own credentials and execute the package using exactly the same method as above it works fine.
When I look in the logs of the failed attempts I see a warning that "The For Each File enumerator is empty". I'm not sure if this is telling the full story as, if I rename the network folder, I get the same message, (I expected to see an error that the folder was not found) - this may or may not be relevant.
I've sketched up a quick overview of what works and what doesn't
NOTE The "script execution" method is just a t-sql script for running these packages. This is the method I will use eventually but at the moment I'm focusing on the simple right-click execute method as this essentially does the same thing.
Since I did this I have tried a few more things...
I've tried accessing the folder as a UNC, a mapped drive and also UNC using IP address instead of server name.
I recreated the issue on our development server so I could change
service accounts etc.
I tried the default accounts on both SSIS and SQL Agent services.
I tried changing these to domain accounts and network service accounts.
I get the package to log the folder name which is and expression - this always looks correct. I do the same with the user name which always shows me as the exection user.
I can change most things as I can test on the development server with the excpetion of testing with a domain admin account so any suggestions would be greatly appreciated.

ssis [File System Task] Error: An error occurred with the following error message: "Access to the path is denied."

So, I have an SSIS package that checks for file existence on the server, copies data from the file onto a table on sql server and moves the file to a done folder.
I have created environment variables and since I have full access to folders and to the server..the package got executed successfully. But, When I selected QA environment in the configuration manager and when I run the package..it's failing to move the file to the done folder and the error in execution result is - [File System Task] Error: An error occurred with the following error message: "Access to the path is denied.".
I have used user variables within the File system task
and the package overview
My question here is - since the file is present in file explorer on QA box and I don't have access..is it the reason for it to fail. But, I am not using my credentials to login at the connection manager level. I am using SQL server authentication (got a service account created).
Please let me know if you have any questions.
Thank you!
My question here is - since the file is present in file explorer on QA box and I don't have access..is it the reason for it to fail.
This is the reason for the failure, yes.
When running a SSIS package in Visual Studio most things will run under your credentials. Yes, you need to specify credentials for some connection managers, but File System Tasks use the Local User's credentials. If you, personally, do not have access to a file, neither does an SSIS package you are running.

Resources