SSIS FTP Task Sending Files to Wrong Directory - ssis

I'm using the FTP Task in SSIS to send files. They task succeeds but the files get uploaded to the wrong folder. Instead of being sent to the cg268301 folder they are being sent to the cg268300 despite selecting /cg268301 from the remote path field in the FTP task editor.
I've tried uploading this file to the /cg268301 file using an execute process task and it works fine. I just don't know why it won't work with the FTP task.

Related

File System Move File doesn not work but Script Task System.IO does

I have an SSIS Package that as part of the process uses a File System Task to move a file to an archive folder.
The Source is a variable from a For Each Loop. The Destination is a File Connection with the connection string set to a Variable. The variable is static assigned in dev, and pulled from a package config when deployed.
Everything works in VS in the dev environment. I deploy to SQL Server and schedule with a SQL Job. Job fails. Immediately, I think it's a permissions issue but my Proxy has Modify to the destination and read on the source.
I then rewrite the package so the move file is done in a script task using system.io. Deploy that and it works with the same proxy account on the job, so it's not a permissions issue.
I'm happy it works, but want to know why it failed before.
The error I got when it failed was, "File or Directory "\destinationpath" represented by connection "archiveconnectioname" does not exist."
Has anyone any ideas?

Where does the downloaded file go when execute robot framework using Jenkins

I need one help,
I am Executing a script of robot framework using Jenkins, as per the flow the script should download one XLS and validate the data using Pandas.
When I am executing the script using Jenkins and searching the downloaded file in a hardcoded path i.e. "C:\Users\Administrator\Downloads" the file is not found.
but when executing it manually the file downloaded on the same path
Can anyone please help me by telling me where do Jenkins stores all the downloaded files?
PS : I am using Google Chrome as web browser
For each job Jenkins runs, it creates a workspace directory, usually at:
$JENKINS_HOME/workspace/(Name of the Job)
The scripts (and robotframework's in this case) are run there, as the root directory. Most probably the downloaded file will be in a path from there (or an error should have occurred because the Jenkins user does not have access to the C:\Users... path).
There is a step in the Jenkins job, which is to archive (download) files from workspace, to Jenkins database, to be shown as "artifacts". Even the screenshots images or videos recording, must be registered in that step, so they can be viewed on the Report and Log in Jenkins (Robot Framework Plugin).

SSIS FTP won't send files

I am currently trying to send a single file through to an FTP site, using an SSIS FTP task to which it is failing and I'm receiving the error:
[FTP Task] Error: Unable to send files using "FTP Connection Manager".
Using the SSIS FTP Task, I am trying to send a file from a local drive to an FTP root folder. I have all the permissions to read and write. I have tried to delete the file on the FTP server (successful), move the file using WinSCP (successful), delete the file from the FTP folder (successful) as well as create a directory on the FTP site. However, when I try and send from a local folder to the root drive of the FTP site, I get the above-mentioned error. My local path includes the file I am wanting to send as well
C:\WebSites\Files\Import\SFTP\Extract\CE_CS_Shipment.xlsx
Is there anything else I can try because I am at my wits ends.
I seemed to have found a workaround because using the FTP Task in SSIS just wasn't budging.
I created the file on the FTP site, followed by copying the stream and that works perfectly.
FtpWebRequest request = (FtpWebRequest)WebRequest.Create(sftpServer + result);
request.Credentials = new NetworkCredential(sftpUser, strFTPPassword);
request.Method = WebRequestMethods.Ftp.UploadFile;
using (Stream fileStream = File.OpenRead(archiveFolder.Replace("//", "/") + #"/" + result))
using (Stream ftpStream = request.GetRequestStream())
{
fileStream.CopyTo(ftpStream);
}
This now works perfectly in the event that someone else is looking for or struggling with the same problem.

SSIS 2012 File Paths

I am using SSIS 2012 to perform a couple basic tasks. The issue I am having occurs in both a Process Execute task and a Flat File connection. When developing the file is local, but I am using an expression to replace the file directory once deployed. I have the files, which are a CSV and a BAT file in the "Miscellaneous" folder.
I would like to be able to reference the relative path of the files rather than an explicit directory on my computer. This would also prevent other developers from having to stage the files locally before being able to even validate the package.
Try using Project Parameter as your folder path.. and use it in your expression Something like
#[$Project::FileLocation] +#[User::FileName]

SSIS package not running when called as step in SQL Job

I have a .dtsx file (an SSIS package) that downloads files from an FTP server and imports data. It runs fine whenever I run it manually. However, when I schedule calling the package as a step in a SQL server agent job, it fails. The step it fails at is the one where I call a .bat file. The error in the job history viewer says this:
Error: 2009-05-26 12:52:25.64
Code: 0xC0029151 Source: Execute
batch file Execute Process Task
Description: In Executing
"D:\xxx\import.bat" "" at "", The
process exit code was "1" while the
expected was "0". End Error DTExec:
The package execution returned
DTSER_FAILURE (1).
I think it's a permissions issue, but I'm not sure how to resolve this. The job owner is an admin user, so I've verified they have permissions to the directory where the .bat file is located. I've tried going into Services and changing the "Log On As" option for SQL Server Agent, and neither option works (Local System Account and This Account). Does anyone have ideas as to what other permissions need to be adjusted in order to get this to work?
I tried executing just the batch file as a SQL Job step, and it gave more specifics. It showed that it failed when I was trying to call an executable, which was in the same directory as my .bat file, but not in the windows/system32 directory, which is where it was executing from.
I moved the executable to the system32 directory, but then I had no clue where my files were being downloaded to. Then I found that there's a property for the Execute Process Task (the one that executes the .bat) called WorkingDirectory. I set this to be the directory where the bat is located, moved the executable back into the same one as the .bat file, and it's now working as expected.
For me it was a permissions issue. Go to Environment --> Directories, then change Local directory to something the SQLAgentUser can access. I used C:\temp. Click the dropdown for Save, and choose "Set defaults".
Are you executing the SSIS job in the batch file, or is the batch file a step in the SSIS control flow?
I'm assuming the latter for this answer. What task are you using to execute the batch file (e.g. simple execute program task or a script task). If the latter, it looks like your batch file is actually failing on some step, not the SSIS script. I'd check the permissions of what your batch file is trying to access
In fact, it might be a better idea to rewrite the batch file as a script task in SSIS, because you'll get much better error reporting (it'll tell you which step in the script fails).
You could try executing the batch file using the runas command in a command window. If you try and execute it under the local system or network system account, it should give you a better error. If it does error, you can check the error level by going "echo %ERRORLEVEL%".
If it wasn't the latter, and you're executing the SSIS package via a batch file, why?
Are you possibly accessing a mapped drive in your .bat file? If so, you can't rely on the mapped drive from within the service, so you'd have to use UNC path.
I had the same error and I resolved it by logging on to the user account that runs the job, opened Coreftp site in question there, test the site access, made the change there (in my case, I had to reenter the new password) and now it works.
So yes, it is an issue of file access. This one is file access to the coreftp site in question.