X Tutup
Skip to content

SFTP uploads randomly fail #1851

@daanhaitsma

Description

@daanhaitsma

We're using phpseclib in Laravel through the thephpleague/flysystem-sftp-v3 package and after updating we have encountered a lot of errors. We have previously created an issue at Flysystem as well

Quick overview of the versions:

Before After
phpseclib 2.0.32 3.0.15
flysystem 1.0.22 3.5.2

From the flysystem package, we are randomly getting an UnableToCreateDirectory exception, when directory has already existed for years. Now after storing the logs from phpseclib, we believe we've found some interesting leads.

  • A successful upload sends NET_SSH2_MSG_CHANNEL_OPEN 1 time, receives NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION 1 time
  • A failed upload sends NET_SSH2_MSG_CHANNEL_OPEN 5 times, but receives NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION only 4 times

These are the parts of the logs that I think are most interesting and show a clear difference:


Now our next question is: What would cause NET_SSH2_MSG_CHANNEL_OPEN to be sent twice in a row (in the beginning, before NET_SSH2_MSG_GLOBAL_REQUEST), without receiving either NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION or NET_SSH2_MSG_CHANNEL_OPEN_FAILURE in between?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup