Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

kovaxxx's avatar

SFTP error - Expected NET_SFTP_DATA or NET_SFTP_STATUS. Got packet type: 105

I have an remote SFTP connection:

    'exportfile_sftp' => [
        'driver' => 'sftp',
        'host' => env('EXPORTFILE_SFTP_HOST'),
        'throw' => true,
        // Settings for basic authentication...
        'username' => env('EXPORTFILE_SFTP_USERNAME'),
        'password' => env('EXPORTFILE_SFTP_PASSWORD'),

        'permissions' => [
            'file' => [
                'public' => 0664,
                'private' => 0664,
            ],
            'dir' => [
                'public' => 0775,
                'private' => 0775,
            ],
        ],
        // Settings for SSH key based authentication with encryption password...
        // 'privateKey' => env('IMAGE_SFTP_PRIVATE_KEY'),
        // 'passphrase' => env('IMAGE_SFTP_PASSPHRASE'),

        // Optional SFTP Settings...
        // 'hostFingerprint' => env('SFTP_HOST_FINGERPRINT'),
        // 'maxTries' => 4,
        // 'passphrase' => env('SFTP_PASSPHRASE'),
        // 'port' => env('SFTP_PORT', 22),
        // 'root' => env('SFTP_ROOT', ''),
        // 'timeout' => 30,
        // 'useAgent' => true,
    ],

I want upload simple xml files to the remote server:

                Storage::disk('exportfile_sftp')->put(($remoteBase . $fileRelative), file_get_contents($outputFile));

But I got the following error:

Expected NET_SFTP_STATUS. Got packet type: 105

How can I debug the sftp/ssh connection laravel? I tried with define('NET_SSH2_LOGGING', SSH2::LOG_COMPLEX); but not working.

Thanks!

0 likes
4 replies
colbyalbo's avatar

Log the exception to the log file, and review the output

try {
   Storage::disk('exportfile_sftp')->put(($remoteBase . $fileRelative), file_get_contents($outputFile));
} catch(\Exception $e){
	Log::info($e->getMessage())
}
colbyalbo's avatar

@kovaxxx The output of the log will have a Stacktrace , which should reveal a clue as to what is going on. Most likely a connectivity issue (SSH key issue maybe)

patoui's avatar

Not sure if this is your issue, but I've run into this error because the timeout value in the configuration was set to a low value (or low default value).

Please or to participate in this conversation.