Discussion:
sftp Couldn't read packet: Connection reset by peer
(too old to reply)
Jon Grant
2009-04-05 19:58:17 UTC
Permalink
Hello

I saw this error below. My feeling is that the second line is not
needed. Would a patch be accepted to change it? If it's easy enough to
do I could probably track down the bit of code generating it.

the ssh error is also not quite as good as it could be, My feeling is
that it doesn't need to tag "Name or service not known" on to the end
of the line when it has already said it Could not resolve the
hostname!

Please include my email address in any replies as I am not on this mailing list.

Regards, Jon

***@laptop:~$ sftp ***@unknown-web-qbcdef.com
Connecting to unknown-web-qbcdef.com...
ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
Couldn't read packet: Connection reset by peer
***@laptop:~$


***@laptop:~$ ssh unknown-web-qbcdef.com
ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
***@laptop:~$
William Ahern
2009-04-05 20:14:31 UTC
Permalink
Post by Jon Grant
Hello
I saw this error below. My feeling is that the second line is not
needed. Would a patch be accepted to change it? If it's easy enough to
do I could probably track down the bit of code generating it.
the ssh error is also not quite as good as it could be, My feeling is
that it doesn't need to tag "Name or service not known" on to the end
of the line when it has already said it Could not resolve the
hostname!
That's what strerror(errno) gives, and you only think it's not needed
because you probably already knew what the problem was. If the system error
was "Network unreachable", but it was never printed, you might be ripping
your hair out.
J.A. Neitzel
2009-04-05 20:59:19 UTC
Permalink
Post by William Ahern
Post by Jon Grant
Hello
I saw this error below. My feeling is that the second line is not
needed. Would a patch be accepted to change it? If it's easy enough to
do I could probably track down the bit of code generating it.
the ssh error is also not quite as good as it could be, My feeling is
that it doesn't need to tag "Name or service not known" on to the end
of the line when it has already said it Could not resolve the
hostname!
That's what strerror(errno) gives, and you only think it's not needed
because you probably already knew what the problem was. If the system error
was "Network unreachable", but it was never printed, you might be ripping
your hair out.
And by the same token, removing the diagnostic message:

fatal("Couldn't read packet: %s", strerror(errno));

...
from sftp-client.c would be equally unkind to the user since knowing
that packet cannot be read and why is too useful to remove.

Removing it could provoke users to generate a local patch to add
the diagnostic back in when it should not be necessary for them to
do so. In short, proper diagnostics are critical for users to
understand why an operation fails.

Jeff
Damien Miller
2009-04-05 22:46:58 UTC
Permalink
Please file a bug at https://buzgilla.mindrot.org/ so it doesn't get
lost.

-d
Post by Jon Grant
Hello
I saw this error below. My feeling is that the second line is not
needed. Would a patch be accepted to change it? If it's easy enough to
do I could probably track down the bit of code generating it.
the ssh error is also not quite as good as it could be, My feeling is
that it doesn't need to tag "Name or service not known" on to the end
of the line when it has already said it Could not resolve the
hostname!
Please include my email address in any replies as I am not on this mailing list.
Regards, Jon
Connecting to unknown-web-qbcdef.com...
ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
Couldn't read packet: Connection reset by peer
ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
_______________________________________________
openssh-unix-dev mailing list
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
J.A. Neitzel
2009-04-05 23:41:54 UTC
Permalink
Jon,

Sorry, I must have misunderstood your "second line is not needed"
statement in my other reply. Just to clarify if I may...

Did you mean the:
"Connecting to unknown-web-qbcdef.com..."
or the:
"Couldn't read packet: Connection reset by peer"
...
line is not needed?

Jeff
Post by Damien Miller
Please file a bug at https://buzgilla.mindrot.org/ so it doesn't get
lost.
-d
Post by Jon Grant
Hello
I saw this error below. My feeling is that the second line is not
needed. Would a patch be accepted to change it? If it's easy enough to
do I could probably track down the bit of code generating it.
the ssh error is also not quite as good as it could be, My feeling is
that it doesn't need to tag "Name or service not known" on to the end
of the line when it has already said it Could not resolve the
hostname!
Please include my email address in any replies as I am not on this mailing list.
Regards, Jon
Connecting to unknown-web-qbcdef.com...
ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
Couldn't read packet: Connection reset by peer
ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
Jon Grant
2009-04-06 11:33:50 UTC
Permalink
Post by William Ahern
Post by Jon Grant
Hello
I saw this error below. My feeling is that the second line is not
needed. Would a patch be accepted to change it? If it's easy enough to
do I could probably track down the bit of code generating it.
the ssh error is also not quite as good as it could be, My feeling is
that it doesn't need to tag "Name or service not known" on to the end
of the line when it has already said it Could not resolve the
hostname!
That's what strerror(errno) gives, and you only think it's not needed
because you probably already knew what the problem was. If the system error
was "Network unreachable", but it was never printed, you might be ripping
your hair out.
Hmm, I thought the "Could not resolve hostname" was sufficient myself.
Where is that determined from? if you think it needs to remain as it
is, then i'll withdraw my idea.

Please include my email address in any replies.
Regards, Jon
Jon Grant
2009-04-06 11:35:24 UTC
Permalink
SGkgSmVmZiwKCgoKMjAwOS80LzYgSi5BLiBOZWl0emVsIDxnc29jc2Z0cEB2NnNoZWxsLm9yZz46
Cj4gSm9uLAo+Cj4gU29ycnksIEkgbXVzdCBoYXZlIG1pc3VuZGVyc3Rvb2QgeW91ciAic2Vjb25k
IGxpbmUgaXMgbm90IG5lZWRlZCIKPiBzdGF0ZW1lbnQgaW4gbXkgb3RoZXIgcmVwbHkuIMKgSnVz
dCB0byBjbGFyaWZ5IGlmIEkgbWF5Li4uCj4KPiBEaWQgeW91IG1lYW4gdGhlOgo+IMKgIMKgIMKg
IMKgIkNvbm5lY3RpbmcgdG8gdW5rbm93bi13ZWItcWJjZGVmLmNvbS4uLiIKPiBvciB0aGU6Cj4g
wqAgwqAgwqAgwqAiQ291bGRuJ3QgcmVhZCBwYWNrZXQ6IENvbm5lY3Rpb24gcmVzZXQgYnkgcGVl
ciIKCnllcywgSSBtZWFudCB0aGlzIG9uZS4KClNTSCBkb2VzIG5vdCBpbmNsdWRlIHRoYXQgb3V0
cHV0LCBzbyBkb2VzIFNGVFAgbmVlZCB0bz8KClBsZWFzZSBpbmNsdWRlIG15IGVtYWlsIGFkZHJl
c3MgaW4gYW55IHJlcGxpZXMuClJlZ2FyZHMsIEpvbgpfX19fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fXwpvcGVuc3NoLXVuaXgtZGV2IG1haWxpbmcgbGlzdApvcGVu
c3NoLXVuaXgtZGV2QG1pbmRyb3Qub3JnCmh0dHBzOi8vbGlzdHMubWluZHJvdC5vcmcvbWFpbG1h
bi9saXN0aW5mby9vcGVuc3NoLXVuaXgtZGV2Cg==
J.A. Neitzel
2009-04-07 03:00:04 UTC
Permalink
Hi Jeff,
Post by J.A. Neitzel
Jon,
Sorry, I must have misunderstood your "second line is not needed"
statement in my other reply. =A0Just to clarify if I may...
=A0 =A0 =A0 =A0"Connecting to unknown-web-qbcdef.com..."
=A0 =A0 =A0 =A0"Couldn't read packet: Connection reset by peer"
yes, I meant this one.
SSH does not include that output, so does SFTP need to?
No, I think the "Connecting to <host>..." message is not needed.
I patched sftp.c to remove the message this morning but ran into
an unrelated problem. I can add the patch to Bugzilla if you want.

-- =

J.A. Neitzel
V6 Thompson Shell Port - http://v6shell.org/
J.A. Neitzel
2009-04-07 05:18:51 UTC
Permalink
Post by J.A. Neitzel
Hi Jeff,
Post by J.A. Neitzel
Jon,
Sorry, I must have misunderstood your "second line is not needed"
statement in my other reply. =A0Just to clarify if I may...
=A0 =A0 =A0 =A0"Connecting to unknown-web-qbcdef.com..."
=A0 =A0 =A0 =A0"Couldn't read packet: Connection reset by peer"
yes, I meant this one.
SSH does not include that output, so does SFTP need to?
No, I think the "Connecting to <host>..." message is not needed.
I patched sftp.c to remove the message this morning but ran into
an unrelated problem. I can add the patch to Bugzilla if you want.
Bug added to Bugzilla.
See https://bugzilla.mindrot.org/show_bug.cgi?id=3D1588 for details.

-- =

J.A. Neitzel
V6 Thompson Shell Port - http://v6shell.org/
Jon Grant
2009-04-07 11:50:12 UTC
Permalink
Hello

2009/4/7 J.A. Neitzel <***@v6shell.org>:
[..]
Post by J.A. Neitzel
Bug added to Bugzilla.
See https://bugzilla.mindrot.org/show_bug.cgi?id=1588 for details.
thank you for adding the patch to bugzilla.

Re the output text, my understanding is it would now look like with
numbers added:

1) j at laptop:~$ sftp oops at unknown-web-qbcdef.com
2) ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
3) Couldn't read packet: Connection reset by peer

So just to confirm, are (2) and (3) lines both needed? If it is me,
and it "could not resolve the host name" I would not try and read a
packet after that.

Also for the English, "Couldn't" is different from "Could not" on the
line above. Normally the short form is only used colloquially, so I
would suggest to change (3) to be "Could not" if it is being retained.

Regards, Jon
J.A. Neitzel
2009-04-08 01:47:42 UTC
Permalink
Hello Jon,
Post by Jon Grant
Hello
[..]
Post by J.A. Neitzel
Bug added to Bugzilla.
See https://bugzilla.mindrot.org/show_bug.cgi?id=1588 for details.
thank you for adding the patch to bugzilla.
I am glad to help, but getting the patched code committed to the
source trees is something that is beyond my control. I do not have
commit access, and there is a related issue that could probably be
addressed in the same set of patches.

See, there is also a message, Attaching to %s..., that could be
turned into a debug message instead.
Post by Jon Grant
Re the output text, my understanding is it would now look like with
1) j at laptop:~$ sftp oops at unknown-web-qbcdef.com
2) ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
3) Couldn't read packet: Connection reset by peer
Yes.
Post by Jon Grant
So just to confirm, are (2) and (3) lines both needed? If it is me,
and it "could not resolve the host name" I would not try and read a
packet after that.
Yes, in essence, they are both needed. The fact that sftp calls
ssh to connect to the server on the user's behalf is why you see
two error messages, one from ssh and one from sftp. I could be
wrong, but the cost vs. the benefit of turning the two messages
into one might not be worth it.

Someone else could probably do a better job of explaining this than
I can since I am not yet completely familiar with the sftp-related
source code.
Post by Jon Grant
Also for the English, "Couldn't" is different from "Could not" on the
line above. Normally the short form is only used colloquially, so I
would suggest to change (3) to be "Could not" if it is being retained.
Since "...n't" is a pattern used throughout the OpenSSH source tree,
I suspect that someone in charge would need to make such a decision.

Cheers,
Jeff
--
J.A. Neitzel
V6 Thompson Shell Port - http://v6shell.org/
Loading...