Announcement

Collapse
No announcement yet.

File corruption merging files from windows share to SFTP endpoint

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • File corruption merging files from windows share to SFTP endpoint

    Setup:
    Development environment : Server 2008 file share, we'll call it \\devserver\files
    Production environment: Server 2008 with SFTP (using CrushFTP). We'll call this sftp://[email protected] I'm using PPK authentication.
    BeyondCompare3 Pro for Windows (3.3.4 build 14431)

    I've been running into problems when attempting to merge some file changes from the dev environment to the production environment. Here's a specific example: (but it seems to happen on almost all merges of this sort).

    I needed to merge some changes (3 lines) in the middle of an asp file over to production.
    Code:
    <tr>
    Just some junk to test merge.
    </tr>
    That change merged fine, however there was an additional change that got written to the bottom of the destination file. It went from:
    Code:
    43: <td align="center" valign="middle"><img src="<%=sSource%>" alt="" border="0"/></td>
    44: </tr>
    45: </table>
    46: </body>
    47: </html>
    to:
    Code:
    43: <td align="center" valign="middle"><img src="<%=sSource%>" alt="" border="0"/></td>
    44: </tr>
    45: </table>
    46: </body>
    47: </html>rder="0"/></td>
    48: </tr>
    49: </table>
    50: </body>
    51: </html>
    As you can see, the tail end of line 43 all the way to the end of the file was appended to the end of the destination file.
    Of course, when I run the compare again, BC3 recognizes that difference (the extra lines). If I try to merge that change over again (just the removal of the extra lines), the same thing happens.

    I've confirmed that the files have the same <line endings> set <CR><LF>. I've updated the Transfer Type to Binary in the Transfer tab of the FTP profile.

    I can't figure out why this is happening? Any ideas?
    Thanks in advance!
    Jason

  • #2
    Hello,

    Are you currently using the Text Compare session type? When you copy over the text to a side, then hit save, do these changes then appear immediately? Or do you need to refresh the view to see this additional text appear on the bottom of the file?
    Aaron P Scooter Software

    Comment


    • #3
      When I go to Session -> Session Settings... the title of the window says "Folder Compare - Session Settings"

      I should clarify, that this same thing happens whether I merge just some changes, or if I send the entire file over wholesale, overwriting an existing file. But if the file does NOT exist on the destination, the file gets written cleanly.

      Some more details when copying a file and completely overwriting an existing destination file.
      When comparing: Source=1535 bytes, Destination=1541 bytes (I added one junk line to the destination file)

      CTRL-R opens a pop-up window asking me to confirm... "Would I like to replace the destination file (sftp location, 1541 bytes, mod 5/1/2012 4:24pm) with the source (devserver location, 1535 bytes, mod 3/22/2012 8:30am)"

      I say Yes.

      Log says "Successfully copied 1 items"

      Immediately in BC3 (with no refresh), the file sizes are still different (1535 and 1541) and the file is corrupt on the destination.
      Interestingly, the extra line I added was exactly "JUNK<CR><LF>" (six characters), and the amount of extra junk that got appended to the file was exactly "/html>" (six characters)

      And if I right away attempt to compare those two files (by double clicking on one of them) BC3 can see that there's extra characters on the destination.

      It should be noted that the behavior is slightly different when merging changes into the destination. In order for BC3 file compare to see the difference, I need to refresh the file list. Otherwise, if I just merge changes, the folder view shows the files to be different, however double clicking on the left side to open the file compare shows identical files (Line endings and all).

      Sorry that was a little long winded...

      Comment


      • #4
        Hello,

        If instead of using the fileshare, if you copy some simple text files from your local Desktop to a temp folder on the sftp://productionServer, then alter them and recopy them over, does this simple test case produce similar results? Do you see any similar/other issues if you use another FTP client, such as Filezilla?

        You mention switching BC3 to a binary transfer mode. Have you restarted BC3 since making this switch? When you pick to load your FTP profile, are you using the Browse dialog, FTP tab to be sure it is picking the FTP Profile you expect (with this setting enabled)?
        Aaron P Scooter Software

        Comment


        • #5
          Hmm, I'm working with WinSCP right now and I can replicate that issue. If I try to overwrite the file it appends junk on the end.This does not appear to be the fault of BC3.
          Obviously some config issue I'm missing on Crush...
          If you have any idea of what that might be, I'd be grateful.

          Thanks for the leads.

          Comment


          • #6
            I showed this thread to one of our developers. He's worked with many FTP's over the years but this behavior doesn't appear to be a general error or scenario driven. It could just be a bug in the version of CrushFTP you are using. Are there any updates available?
            Aaron P Scooter Software

            Comment


            • #7
              I submitted a help request to Crush and it turns out that it was a bug in 6.0.0_6. The automatic update of Crush did not take correctly and was advised to download and manually place the new files on the Crush install. Once I restarted the Crush services I have 6.0.0_98 and everything is working like a charm!

              Thanks for your time and attention.

              Comment

              Working...
              X