-
-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception: Expected NET_SFTP_VERSION. Got packet type: #1793
Comments
If you could enable logging ( Thanks! |
Hi @terrafrost I am trying to get logs from a live environment but it seems to not output everything (This could be part of the problem?)
That is the whole thing. This is when it fails, it does not fail all the time. When it fails, all we get is
No value to packet type. How I output: define('NET_SFTP_LOGGING', SFTP::LOG_COMPLEX);
try {
if ($ftp->connect()) {
// Code to do FTP stuff
}
} catch (Exception $e) {
print_r($ftp->getSFTPLog());
$ftp->disconnect();
$error = $e->getMessage(); //Error message would be the NET_SFTP_VERSION one mentioned above
} Why would the logs be empty? |
It's possible the SSH server is killing the connection. Could you do SSH logging ( It's also possible the SSH server is straight up killing the connection. The SSH logs would show me the server identification string. Like are you connecting to an OpenSSH server or some proprietary SSH server? Proprietary SSH servers are more likely to have bugs. Also, if it were OpenSSH and if it were a server you had full control over I could give you further directions to help diagnose what's going on if the SSH logs didn't yield any insights. |
@terrafrost How can I get the log to you without posting it here? Just want to be cautious with the info. |
You can email the logs to ***@***.***
Thanks!
…On Wed, May 18, 2022, 10:01 AM Schalk ***@***.***> wrote:
@terrafrost <https://github.com/terrafrost> How can I get the log to you
without posting it here? Just want to be cautious with the info.
Note: We also have access to the server should additional info be required.
—
Reply to this email directly, view it on GitHub
<#1793 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABULSTLS56I4JRYBBZFZHDVKUA3PANCNFSM5VQ6J46A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@terrafrost For some reason I can't see that email... It shows |
Oh. I guess github replaces emails with that when replies are sent via email. Anyway, the email is [email protected]. Thanks! |
I got the logs - thanks! I'll take a look this evening or tomorrow as time permits! |
Hey guys, |
Get logs by doing
The OP's issue got more fleshed out over email. At one point he said this:
I posted about it on the OpenSSH mailing lists: https://lists.mindrot.org/pipermail/openssh-unix-dev/2021-October/039773.html Quoting some of the responses I got:
Also:
I sent these responses to the OP and never heard back. But TLDR the OPs issue doesn't seem to be either a phpseclib or OpenSSH issue but an issue that lies elsewhere. |
Thanks! |
So, we finally got some logs. Stuff that can be relevant:
First example:
|
One possibility is that there was a time consuming packet in one part of the logs that I am unable to see. In that scenario, doing I have an AWS account that I can try to set AWS Transfer Family up on and see what that offers, in-so-far as server-side logging goes, but, based on the logs, I'm not sure there's anything phpseclib can really do as it kinda seems to me like it's an issue with the server. Once I setup AWS Transfer Family I can try to reproduce the issue, as well, but if you're saying it only happens every 10-20 days even that could be tricky. How often are you doing the transfers? Is it daily? Multiple times a day? If you only attempt to use phpseclib to transfer files every 10-20 days and every time you make such an attempt you encounter this error then, at that point, it seems like it would be fairly easy to reproduce, but if, over the course of 10-20 days, you make 1,000,000+ connections with phpseclib and only 1 of them fails out of the 1,000,000+ that it successfully does, then I'm not sure there's a whole lot i could do! |
Hard to estimate, but calling
It's super hard to reproduce, we tried it. Some other hints:
https://docs.aws.amazon.com/transfer/latest/userguide/transferfamily-ug.pdf Thank you very much for your time! |
I have the same issue, but can reproduce it every time. Started happening after sftp server was upgraded. I can login to the server from CLI without issues. Code snippet:
Help please:) |
SFTP server admin changed the config(would not say how) and now it works fine. Thanks! |
I've been experiencing this issue for awhile now. The SFTP I connect to is AWS Transfer Family where it's hooked up to an S3. It doesn't happen all the time but I do see it occur every couple of days... which I can't understand. |
@ikudosi - sorry for not responding sooner - I guess I didn't see this. As a general rule, it's easier to spot new tickets vs new replies. Anyway, if you could get me the SSH2 logs that'd be helpful. You can get them by doing Thanks! |
I sometimes get an Exception but don't really know why
It seems sometimes when the
get()
function is called, somehow the$this->packet_type
is empty?I do not know how I can give more info. The exception does not come back consistently.
Any ideas on why the exception would occur would be helpful :)
Function used
The text was updated successfully, but these errors were encountered: