Skip to content
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

Server welcome message breaks connection ("Error: Unexpected packet before version") #183

Open
JPustkuchen opened this issue Jan 20, 2022 · 0 comments

Comments

@JPustkuchen
Copy link

Thank you very much for this great project!

In one of our projects we experienced an issue where a connection to a clients server wasn't possible due to the hosting providers welcome motd message (see https://ownyourbits.com/2017/04/05/customize-your-motd-login-message-in-debian-and-ubuntu for example):

 if [ -f /etc/motd ];then
 	cat /etc/motd | sed "s#LOGIN#${USER##*-}#g"
 fi

This lead to connection error:

Error: Unexpected packet before version

from the gulp tool which uses ssh2-streams:
gulp-sftp
https://github.com/gtg092x/gulp-sftp/

[19:33:33] Error: Unexpected packet before version
    at SFTPStream._transform (/xx/node_modules/ssh2-streams/lib/sftp.js:306:27)
    at SFTPStream.Transform._read (internal/streams/transform.js:205:10)
    at SFTPStream._read (/xx/node_modules/ssh2-streams/lib/sftp.js:183:15)
    at SFTPStream.Transform._write (internal/streams/transform.js:193:12)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at SFTPStream.Writable.write (internal/streams/writable.js:303:10)
    at Channel.ondata (internal/streams/readable.js:726:22)
    at Channel.emit (events.js:400:28)
    at Channel.emit (domain.js:532:15)
    at Channel.Readable.read (internal/streams/readable.js:500:10)

As we can't control what hosting providers do, is there a way to handle such welcome messages before version better?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant