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

Error: list: Packet length 49989 exceeds max length of 34000 #1048

Closed
ardean opened this issue Aug 13, 2021 · 8 comments
Closed

Error: list: Packet length 49989 exceeds max length of 34000 #1048

ardean opened this issue Aug 13, 2021 · 8 comments

Comments

@ardean
Copy link

ardean commented Aug 13, 2021

A folder on a SFTP server does have a lot of files (history of 1 year so far, 340 files). I try to list that folder and i get this error:

Error: list: Packet length 49989 exceeds max length of 34000

If i adjust the max packet size (?) to 100000 it does list my files.

The questions are now:

Why is this limit there?
Update: it is specified as min packet length for servers: https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13#section-4

Can I adjust the limit by an option? (not possible as far as I can see)
Is there a better way to implement this?

Can you split the command in separate packets?

-> there could be even more files in this folder

So it makes not really sense to increase the limit. As the limit will be reached sometime again in the future.

Here is the limit that i adjusted on my machine:

this._maxPktLen = (this._isOpenSSH ? OPENSSH_MAX_PKT_LEN : 34000);

I hope we have a better way to implement this as the folder size should not depend on the packet size.

Thank you for your help

@ardean ardean changed the title Error: list: Packet length 74249 exceeds max length of 34000 Error: list: Packet length 49989 exceeds max length of 34000 Aug 13, 2021
@mscdex
Copy link
Owner

mscdex commented Aug 23, 2021

Does 4606d0e work for you?

@ardean
Copy link
Author

ardean commented Aug 23, 2021

Thank you very much @mscdex! Your latest change did the trick. It now works without a problem.

Do you know already when this feature will be available on npm?

@ardean
Copy link
Author

ardean commented Sep 7, 2021

It seems fixed and released. Thanks!

@ardean ardean closed this as completed Sep 7, 2021
@future-mine
Copy link

It didn't work for me.
image

@zxdong262
Copy link

zxdong262 commented May 14, 2024

Do still exist, when user add something like "source /opt/intel/vtune_amplifier_xe_2013/amplxe-vars.sh" to .bashrc, would ge extra output like

Intel(R) Parallel Studio XE 2019 Update 4 for Linux*

Copyright (C) 2009-2019 Intel Corporation. All rights reserved.

when read data length from first 4 bytes, would get a wrong length exceed max length, I think other sftp client would just ignore these data.

Code should be in

if (this._pktLenBytes < 4) {

@mscdex

@mscdex
Copy link
Owner

mscdex commented May 14, 2024

@zxdong262 There's nothing that can be done in that situation because SFTP is completely binary in nature so there is no way any (generic) SFTP client could reliably ignore any such data.

Besides, most bashrc scripts exit immediately when they detect a non-interactive mode.

@zxdong262
Copy link

@zxdong262 There's nothing that can be done in that situation because SFTP is completely binary in nature so there is no way any (generic) SFTP client could reliably ignore any such data.

Besides, most bashrc scripts exit immediately when they detect a non-interactive mode.

How about ignore length seems impossible like 1349281121(or set a impossible const to compare) intead of throw error? Is that safe or right thing to do?

@mscdex
Copy link
Owner

mscdex commented May 15, 2024

Is that safe or right thing to do?

It's not safe.

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

4 participants