SSIS Openning file on Samba Share

  • Hi All,

    I'm having some problems on SSIS when trying access files on a Samba share.

    One part of my task attempts to access the file and check to see if it is writable, if it isn't it's assumed the file is in use (as the folder is an In directory for SFTp, so is likely still being uploaded). This method worked fine when the folder share was on Windows, however, we're having to migrate the server, as it was running Windows server 2003 (and thus, no longer supported).

    When getting to the task to check if the file is writable however, I always get a result back of that it isn't. I initially thought this would be a permission problem, but I'm changed the file permissions for the folder, and file (to test), to 777, and no luck.

    Has anyone else had any luck using a Samba share and accessing files (as well have performing File System tasks), and if so, how did you achieve granting permissions for SSIS. What user does it actually attempt to perform the process under (both locally and server based). I thought it was my the local user and the Agent User, but if that's the case, as the local user I should definitely be able to write to the file (tested it in Windows explorer, and it's quite happy for me to open, modify, rename, etc). Is it possible to change which user the File System task and VB scripts run as?

    For those wondering, here if the code I run to check to see if the file is in use. it may be you notice something that doesn't quite work for a Linux Samba share:

    Try

    ' Try to open the file. If it succeeds, set variable to false and close stream

    Dim fs As FileStream = New FileStream(Dts.Variables("User::NewFiles").Value.ToString(), FileMode.Open)

    Dts.Variables("User::InUse").Value = False

    fs.Close()

    Catch ex As Exception

    ' If opening fails, it's probably locked by an other process

    Dts.Variables("User::InUse").Value = True

    ' Log actual error to SSIS to be sure

    Dts.Events.FireWarning(0, "Get File Properties", ex.Message, String.Empty, 0)

    End Try

    Thanks all for any help you can give.

    Edit: P.s. I am running Ubuntu 15.10.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • No experience of Samba but when I have had to check for completion of file upload I have used the file size to determine if the file is ready rather than if I can open the file. If the file size hasn't changed over e.g. 1 minute then I have deemed that any copy process is complete and that the file is ready for processing.

    Jez

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply