Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenSSH: Dev

sftp Couldn't read packet: Connection reset by peer

 

 

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded


jg at jguk

Apr 5, 2009, 10:53 AM

Post #1 of 11 (14860 views)
Permalink
sftp Couldn't read packet: Connection reset by peer

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

j [at] lapto:~$ sftp oops [at] unknown-web-qbcdef
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
j [at] lapto:~$


j [at] lapto:~$ ssh unknown-web-qbcdef.com
ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
service not known
j [at] lapto:~$
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


william at 25thandClement

Apr 5, 2009, 1:13 PM

Post #2 of 11 (14639 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

On Sun, Apr 05, 2009 at 06:53:45PM +0100, Jon Grant wrote:
> 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.

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


gsocsftp at v6shell

Apr 5, 2009, 1:57 PM

Post #3 of 11 (14638 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

William Ahern <william [at] 25thandClement> wrote:

> On Sun, Apr 05, 2009 at 06:53:45PM +0100, Jon Grant wrote:
> > 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
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


djm at mindrot

Apr 5, 2009, 3:46 PM

Post #4 of 11 (14630 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

Please file a bug at https://buzgilla.mindrot.org/ so it doesn't get
lost.

-d

On Sun, 5 Apr 2009, Jon Grant wrote:

> 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
>
> j [at] lapto:~$ sftp oops [at] unknown-web-qbcdef
> 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
> j [at] lapto:~$
>
>
> j [at] lapto:~$ ssh unknown-web-qbcdef.com
> ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
> service not known
> j [at] lapto:~$
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev [at] mindrot
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
>
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


gsocsftp at v6shell

Apr 5, 2009, 4:40 PM

Post #5 of 11 (14645 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

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

Damien Miller wrote:

> Please file a bug at https://buzgilla.mindrot.org/ so it doesn't get
> lost.
>
> -d
>
> On Sun, 5 Apr 2009, Jon Grant wrote:
>
> > 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
> >
> > j [at] lapto:~$ sftp oops [at] unknown-web-qbcdef
> > 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
> > j [at] lapto:~$
> >
> >
> > j [at] lapto:~$ ssh unknown-web-qbcdef.com
> > ssh: Could not resolve hostname unknown-web-qbcdef.com: Name or
> > service not known
> > j [at] lapto:~$
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


jg at jguk

Apr 6, 2009, 4:33 AM

Post #6 of 11 (14633 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

2009/4/5 William Ahern <william [at] 25thandclement>:
> On Sun, Apr 05, 2009 at 06:53:45PM +0100, Jon Grant wrote:
>> 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
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


jg at jguk

Apr 6, 2009, 4:34 AM

Post #7 of 11 (14618 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

Hi Jeff,



2009/4/6 J.A. Neitzel <gsocsftp [at] v6shell>:
> 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"

yes, I meant this one.

SSH does not include that output, so does SFTP need to?

Please include my email address in any replies.
Regards, Jon
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


gsocsftp at v6shell

Apr 6, 2009, 7:58 PM

Post #8 of 11 (14630 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

Jon Grant wrote:

> Hi Jeff,
>
> 2009/4/6 J.A. Neitzel <gsocsftp [at] v6shell>:
> > 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"
>
> 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/
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


gsocsftp at v6shell

Apr 6, 2009, 10:17 PM

Post #9 of 11 (14611 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

"J.A. Neitzel" <gsocsftp [at] v6shell> wrote:

> Jon Grant wrote:
>
> > Hi Jeff,
> >
> > 2009/4/6 J.A. Neitzel <gsocsftp [at] v6shell>:
> > > 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"
> >
> > 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=1588 for details.

--
J.A. Neitzel
V6 Thompson Shell Port - http://v6shell.org/
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


jg at jguk

Apr 7, 2009, 4:49 AM

Post #10 of 11 (14612 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

Hello

2009/4/7 J.A. Neitzel <gsocsftp [at] v6shell>:
[..]
> 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
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


gsocsftp at v6shell

Apr 7, 2009, 6:46 PM

Post #11 of 11 (14621 views)
Permalink
Re: sftp Couldn't read packet: Connection reset by peer [In reply to]

Hello Jon,

Jon Grant wrote:

> Hello
>
> 2009/4/7 J.A. Neitzel <gsocsftp [at] v6shell>:
> [..]
> > 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.

> 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

Yes.

> 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.

> 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/
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.