Execute Process Task: Issues encrypting text file using PGP in SSIS 2022

  • Hello SSC,

    Has anyone encountered this before???

    I have an odd issue that I need to debug. I am encrypting a text file to PGP. I am able to do this locally without any issues, but when I try to transfer the file to the SFTP site, it fails. I Googled this issue and actually watched a bunch of videos on file encryption, and it looks like I am doing this correctly. Code sample and the response from the recipient is below.

    Any assistance would be greatly appreciated!

    Execute Process Task:

    Executable: C:\blah\blah\bin\gpg.exe

    Arguments: --output Somefile.txt.gpg --encrypt --recipient Somewhere@Someplace.com Somefile.txt

    "Non-UTF8 characters aren’t accepted and can cause issues during the file load process. I noticed your file contains non-UTF8 characters in multiple rows. When opened in Notepad++, these lines typically look like the example below. Error loading client records. File received contained over 90 percent invalid records."

    encryption_issue

     

     

     

     

    The are no problems, only solutions. --John Lennon

  • What does gpg.exe do?


  • Hi Phil,

    Happy new year!

    That is the executable for the software that encrypts the file. I think...

    The are no problems, only solutions. --John Lennon

  • So ... you're using PGP and the executable is called GPG ... weird, but OK!

    If that is just the encryption process, what is doing the SFTP part which is when the error occurs?

    Or are you saying that just the encryption part is failing (meaning that the SFTP bit is not really relevant)?


  • GnuPG = gpg.exe

  • The error message is coming from the company which we are sending the encrypted file to. Just to be clear, this file is being rejected from the client's side. On our side, we are getting success. Here is the reply from the client and error message.

    "Non-UTF8 characters aren’t accepted and can cause issues during the file load process. I noticed your file contains non-UTF8 characters in multiple rows."

    Thanks

    The are no problems, only solutions. --John Lennon

    1. is SSIS calling a Powershell Script that moves the file to SFTP?
    2. SSIS only supports FTP/FTPS not SFTP

    • This reply was modified 5 days, 18 hours ago by Tav29.
  • You can try running this PS Script on the text file before encrypting it.

    (Get-Content "C:\path\file.txt") |
    Set-Content -Encoding UTF8 "C:\path\file_utf8.txt"
  • FYI: in your Argument your sending the unencrypted file.  Shouldn't you be sending the  Somefile.txt.gpg file instead?

    Execute Process Task:

    Executable: C:\blah\blah\bin\gpg.exe

    Arguments: --output Somefile.txt.gpg --encrypt --recipient Somewhere@Someplace.com Somefile.txt

    • This reply was modified 5 days, 17 hours ago by Tav29.
  • Isn't this the output?

    --output Somefile.txt.gpg

    The are no problems, only solutions. --John Lennon

  • Yes but in your Argument your sending the unencrypted file.  Somefile.txt

  • The file is being rejected due to Non-UTF8 characters by the client. I am able to encrypt it locally. If the output was a text file, I would think the file would have no issues? I could be wrong, I do not have a lot of experience with file encryption.

    The are no problems, only solutions. --John Lennon

  • Which File  are you sending? Somefile.txt.gpg  or  Somefile.txt, you should be sending the Somefile.txt.gpg

  • So, you are saying that the txt and txt.gpg should be reversed? I am not saying that you are wrong, but I Googled this and watched a few videos on encryption, and this was the order.

    The are no problems, only solutions. --John Lennon

  • You should be sending the file ending in .gpg

     

Viewing 15 posts - 1 through 15 (of 21 total)

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