You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "wumengchao (via GitHub)" <gi...@apache.org> on 2024/08/28 13:55:45 UTC

[I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

wumengchao opened a new issue, #587:
URL: https://github.com/apache/mina-sshd/issues/587

   ### Version
   
   2.13.2
   
   ### Bug description
   
   Triggering the port after a successful access forwarding.
   
   ### Actual behavior
   
   The R connection is directly disconnected.
   
   ### Expected behavior
   
   I hope to fix this issue.
   
   ### Relevant log output
   
   _No response_
   
   ### Other information
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "wumengchao (via GitHub)" <gi...@apache.org>.
wumengchao commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2322821277

   Only forwarding the SSH protocol port and sending a request will result in an error.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "wumengchao (via GitHub)" <gi...@apache.org>.
wumengchao commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2322855085

   The following check has been added to the writeBuffer of NettyIoSession, and it is currently functioning normally:
   
   if (context == null) {
       return msg;
   }
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "wumengchao (via GitHub)" <gi...@apache.org>.
wumengchao commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2318572661

   jsch is a method used on another system and cannot be changed. It just uses mina-sshd's SSH tunnel to complete tasks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "wumengchao (via GitHub)" <gi...@apache.org>.
wumengchao commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2315508547

   Additionally, there are some error logs like this:
   SSH2_DISCONNECT_PROTOCOL_ERROR - Detected AuthTimeout after 120055/120000 ms.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2315485794

   Provide the full server log. I need to see what happened before that. Ideally you'd also have a backtrace for this exception. Maybe run your server with debug logging.
   
   What exactly was the client doing?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2322921966

   > However, an exception still occurs:
   
   I'm not surprised. I do not understand what exactly you are doing, but the whole description so far sounds like some setup bug. Maybe you're not connecting ports the way you actually intended, and end up writing the wrong stuff to the wrong port.
   
   Without seeing full code that reproduces the problem there is no way we could help.
   
   BTW, the "fix"
   ```
   if (context == null) {
     return msg;
   }
   ```
   is not correct; the `msg` future will never be fulfilled.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2315921751

   Please provide full Java code to reproduce this problem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2317235700

   What is listening on 10.0.0.1:3333? And given that the server seems to be an Apache MINA sshd server, why is JSch being used to create this second tunnel? I also don't see what the first remote forward has to do with this failure in the second tunnel. The two tunnels seem to be unrelated.
   
   It should be possible to mock your setup all on one machine and package it as some Java code.
   
   I need to be able to reproduce the problem; otherwise any changes we might make would be shots in the dark. 
   
   We could just code around this NullPointerException, but without knowing why exactly it occurs in the first place and no regression tests we won't really have solved anything. The interesting question here is "why is the context null?". Probably the answer is "because the channel is already closed", and then the next interesting question is "why is the channel closed?". Once we know that, we can decide how to fix this. If the channel is rightly closed, then just coding around the NullPointerException might be a valid solution. If the channel should not be closed at all, then there is some other problem that needs to fixed.
   
   To answer these questions I need to have a reproducible case.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2315435699

   Sorry, this is not actionable. The description is too vague. Provide full stack traces (as text, not screenshots!), and explain how to reproduce the problem.
   
   I can only guess that it might be some write on an already closed channel.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "wumengchao (via GitHub)" <gi...@apache.org>.
wumengchao commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2317144924

   The process is quite complex, so I'll describe it in words. Let's assume: Client IP: 10.0.0.1, Server IP: 192.168.0.1. The client establishes a local port mapping from port 22 to remote port 1111 using jsch. By accessing 127.0.0.1:1111 from the server (192.168.0.1), we can access the client's SSH. Then, on the server, we use jsch to create a local port mapping from server port 2222 to the client's port 3333. Accessing 127.0.0.1:2222 on the server would reach port 3333 on the client, at which point an exception will be reported.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "wumengchao (via GitHub)" <gi...@apache.org>.
wumengchao commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2315502511

   The client initiates createPortForwardingR using jsch, and then another jsch accesses the R channel through createPortForwardingL, which triggers this null problem.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "wumengchao (via GitHub)" <gi...@apache.org>.
wumengchao commented on issue #587:
URL: https://github.com/apache/mina-sshd/issues/587#issuecomment-2315475794

   exceptionCaught(ServerSessionImpl[deploy@/xx.xx.xx.xx:38684])[state=Opened] NullPointerException: Cannot invoke "io.netty.channel.ChannelHandlerContext.newPromise()" because "this.context" is null


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org


Re: [I] The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception. [mina-sshd]

Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf closed issue #587: The `context` in the `writeBuffer` function of `NettyIoSession` is throwing a null pointer exception.
URL: https://github.com/apache/mina-sshd/issues/587


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org