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
Warning: Undefined array key 2 in SSH2 initShell #1789
Comments
Normally that'd be set here: phpseclib/phpseclib/Net/SSH2.php Lines 3939 to 3947 in bff58b0
Since it isn't.... can you post your full SSH logs? You can get them by doing Thanks! |
There's something wrong with my cisco devices. I have no problem with having the error but it should be handled with exception rather than php warning. |
Can you get me the information I asked for? Errors and exceptions behave fundamentally differently. Exceptions, even if caught, will prevent the rest of the function from executing. Errors won't. Now, speaking abstractly, if the PHP error isn't a fatal error, then maybe the code should be written in such a way not to cause that error to appear, whilst still executing. What the best fix is ultimately depends on the context, and I would like to better understand what is happening. |
Just to keep the thread going, I've sent logs to @terrafrost. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Did you make any progress with this @simPod? |
No, there's nothing we can do until some exception is thrown. |
This is a weird one. It only happens on some servers. But those it does happen on, it always happens. The first connection to the server will consistently fail. The second will succeed. But if I restart a Laravel Tinker session (a PHP shell in production), the issue happens again. Something is cached, and it's not the SSH2 instance, it must be something at the PHP level or lower. After a lot of debugging, adding a The same issue doesn't happen with Does this help at all with a theory @terrafrost ? |
@mewejo - Calling http://phpseclib.com/docs/commands#gotcha-writing-without-first-reading But it's not clear to me why Could you post your SSH2 logs with and without the |
Sometimes, I get
Warning: Undefined array key 2
phpseclib/phpseclib/Net/SSH2.php
Line 2863 in bff58b0
I don't know why it happens but having an exception would be better, WDYT?
The text was updated successfully, but these errors were encountered: