org.apache.mina.core.RuntimeIoException: java.net.SocketException: Invalid argument

Atlassian JIRA | Tbricks AB | 4 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    The following occurs on Solaris 10 update 9, Intel x86 platform and is currently unsupported per [Supported Platforms|https://confluence.atlassian.com/display/STASH/Supported+platforms]: {noformat} -bash-3.00# uname -a SunOS stash 5.10 Generic_144489-11 i86pc i386 i86pc {noformat} {code} 2013-06-22 11:43:03,022 WARN [NioSocketAcceptor-1] o.a.m.util.DefaultExceptionMonitor Unexpected exception. org.apache.mina.core.RuntimeIoException: java.net.SocketException: Invalid argument at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:259) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.AbstractSocketSessionConfig.doSetAll(AbstractSocketSessionConfig.java:53) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.session.AbstractIoSessionConfig.setAll(AbstractIoSessionConfig.java:63) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketSession.<init>(NioSocketSession.java:62) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:176) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:51) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.processHandles(AbstractPollingIoAcceptor.java:501) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:442) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [stash-ssh-2.5.0_1370884020000.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_09] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_09] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09] Caused by: java.net.SocketException: Invalid argument at sun.nio.ch.Net.setIntOption0(Native Method) ~[na:1.7.0_09] at sun.nio.ch.Net.setSocketOption(Net.java:279) ~[na:1.7.0_09] at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:180) ~[na:1.7.0_09] at sun.nio.ch.SocketAdaptor.setIntOption(SocketAdaptor.java:300) ~[na:1.7.0_09] at sun.nio.ch.SocketAdaptor.setReceiveBufferSize(SocketAdaptor.java:384) ~[na:1.7.0_09] at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:257) ~[stash-ssh-2.5.0_1370884020000.jar:na] ... 11 common frames omitted 2013-06-22 11:43:05,022 WARN [NioSocketAcceptor-1] o.a.m.util.DefaultExceptionMonitor Unexpected exception. org.apache.mina.core.RuntimeIoException: java.net.SocketException: Invalid argument at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:259) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.AbstractSocketSessionConfig.doSetAll(AbstractSocketSessionConfig.java:53) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.session.AbstractIoSessionConfig.setAll(AbstractIoSessionConfig.java:63) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketSession.<init>(NioSocketSession.java:62) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:176) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:51) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.processHandles(AbstractPollingIoAcceptor.java:501) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:442) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [stash-ssh-2.5.0_1370884020000.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_09] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_09] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09] Caused by: java.net.SocketException: Invalid argument at sun.nio.ch.Net.setIntOption0(Native Method) ~[na:1.7.0_09] at sun.nio.ch.Net.setSocketOption(Net.java:279) ~[na:1.7.0_09] at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:180) ~[na:1.7.0_09] at sun.nio.ch.SocketAdaptor.setIntOption(SocketAdaptor.java:300) ~[na:1.7.0_09] at sun.nio.ch.SocketAdaptor.setReceiveBufferSize(SocketAdaptor.java:384) ~[na:1.7.0_09] at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:257) ~[stash-ssh-2.5.0_1370884020000.jar:na] ... 11 common frames omitted {code} Eventually, stash will have many thousands sockets open and will fail to open a new files and Stash starts throwing TomCat exceptions or simply stops responding: # files <PID> {code} 158: S_IFSOCK mode:0666 dev:299,0 ino:37987 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 159: S_IFSOCK mode:0666 dev:299,0 ino:59601 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 160: S_IFSOCK mode:0666 dev:299,0 ino:48629 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 161: S_IFSOCK mode:0666 dev:299,0 ino:15165 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 162: S_IFSOCK mode:0666 dev:299,0 ino:42437 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 {....} 26318: S_IFSOCK mode:0666 dev:299,0 ino:20483 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 26319: S_IFSOCK mode:0666 dev:299,0 ino:16944 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 26320: S_IFSOCK mode:0666 dev:299,0 ino:59289 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 26321: S_IFSOCK mode:0666 dev:299,0 ino:15675 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 26322: S_IFSOCK mode:0666 dev:299,0 ino:32611 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 {code} Java version: {code} /usr/jdk/jdk1.7.0_09/bin/java -version java version "1.7.0_09" Java(TM) SE Runtime Environment (build 1.7.0_09-b05) Java HotSpot(TM) Server VM (build 23.5-b02, mixed mode) {code}

    Atlassian JIRA | 4 years ago | Tbricks AB
    org.apache.mina.core.RuntimeIoException: java.net.SocketException: Invalid argument
  2. 0

    The following occurs on Solaris 10 update 9, Intel x86 platform and is currently unsupported per [Supported Platforms|https://confluence.atlassian.com/display/STASH/Supported+platforms]: {noformat} -bash-3.00# uname -a SunOS stash 5.10 Generic_144489-11 i86pc i386 i86pc {noformat} {code} 2013-06-22 11:43:03,022 WARN [NioSocketAcceptor-1] o.a.m.util.DefaultExceptionMonitor Unexpected exception. org.apache.mina.core.RuntimeIoException: java.net.SocketException: Invalid argument at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:259) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.AbstractSocketSessionConfig.doSetAll(AbstractSocketSessionConfig.java:53) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.session.AbstractIoSessionConfig.setAll(AbstractIoSessionConfig.java:63) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketSession.<init>(NioSocketSession.java:62) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:176) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:51) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.processHandles(AbstractPollingIoAcceptor.java:501) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:442) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [stash-ssh-2.5.0_1370884020000.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_09] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_09] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09] Caused by: java.net.SocketException: Invalid argument at sun.nio.ch.Net.setIntOption0(Native Method) ~[na:1.7.0_09] at sun.nio.ch.Net.setSocketOption(Net.java:279) ~[na:1.7.0_09] at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:180) ~[na:1.7.0_09] at sun.nio.ch.SocketAdaptor.setIntOption(SocketAdaptor.java:300) ~[na:1.7.0_09] at sun.nio.ch.SocketAdaptor.setReceiveBufferSize(SocketAdaptor.java:384) ~[na:1.7.0_09] at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:257) ~[stash-ssh-2.5.0_1370884020000.jar:na] ... 11 common frames omitted 2013-06-22 11:43:05,022 WARN [NioSocketAcceptor-1] o.a.m.util.DefaultExceptionMonitor Unexpected exception. org.apache.mina.core.RuntimeIoException: java.net.SocketException: Invalid argument at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:259) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.AbstractSocketSessionConfig.doSetAll(AbstractSocketSessionConfig.java:53) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.session.AbstractIoSessionConfig.setAll(AbstractIoSessionConfig.java:63) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketSession.<init>(NioSocketSession.java:62) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:176) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:51) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.processHandles(AbstractPollingIoAcceptor.java:501) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:442) ~[stash-ssh-2.5.0_1370884020000.jar:na] at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [stash-ssh-2.5.0_1370884020000.jar:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_09] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_09] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09] Caused by: java.net.SocketException: Invalid argument at sun.nio.ch.Net.setIntOption0(Native Method) ~[na:1.7.0_09] at sun.nio.ch.Net.setSocketOption(Net.java:279) ~[na:1.7.0_09] at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:180) ~[na:1.7.0_09] at sun.nio.ch.SocketAdaptor.setIntOption(SocketAdaptor.java:300) ~[na:1.7.0_09] at sun.nio.ch.SocketAdaptor.setReceiveBufferSize(SocketAdaptor.java:384) ~[na:1.7.0_09] at org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:257) ~[stash-ssh-2.5.0_1370884020000.jar:na] ... 11 common frames omitted {code} Eventually, stash will have many thousands sockets open and will fail to open a new files and Stash starts throwing TomCat exceptions or simply stops responding: # files <PID> {code} 158: S_IFSOCK mode:0666 dev:299,0 ino:37987 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 159: S_IFSOCK mode:0666 dev:299,0 ino:59601 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 160: S_IFSOCK mode:0666 dev:299,0 ino:48629 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 161: S_IFSOCK mode:0666 dev:299,0 ino:15165 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 162: S_IFSOCK mode:0666 dev:299,0 ino:42437 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 {....} 26318: S_IFSOCK mode:0666 dev:299,0 ino:20483 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 26319: S_IFSOCK mode:0666 dev:299,0 ino:16944 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 26320: S_IFSOCK mode:0666 dev:299,0 ino:59289 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 26321: S_IFSOCK mode:0666 dev:299,0 ino:15675 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 26322: S_IFSOCK mode:0666 dev:299,0 ino:32611 uid:0 gid:0 size:0 O_RDWR SOCK_STREAM SO_REUSEADDR,SO_SNDBUF(49152),SO_RCVBUF(49152),IP_NEXTHOP(0.192.0.0) sockname: AF_INET 127.0.0.1 port: 7999 {code} Java version: {code} /usr/jdk/jdk1.7.0_09/bin/java -version java version "1.7.0_09" Java(TM) SE Runtime Environment (build 1.7.0_09-b05) Java HotSpot(TM) Server VM (build 23.5-b02, mixed mode) {code}

    Atlassian JIRA | 4 years ago | Tbricks AB
    org.apache.mina.core.RuntimeIoException: java.net.SocketException: Invalid argument

    Root Cause Analysis

    1. java.net.SocketException

      Invalid argument

      at sun.nio.ch.Net.setIntOption0()
    2. Java RT
      SocketAdaptor.setReceiveBufferSize
      1. sun.nio.ch.Net.setIntOption0(Native Method)[na:1.7.0_09]
      2. sun.nio.ch.Net.setSocketOption(Net.java:279)[na:1.7.0_09]
      3. sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:180)[na:1.7.0_09]
      4. sun.nio.ch.SocketAdaptor.setIntOption(SocketAdaptor.java:300)[na:1.7.0_09]
      5. sun.nio.ch.SocketAdaptor.setReceiveBufferSize(SocketAdaptor.java:384)[na:1.7.0_09]
      5 frames
    3. Apache MINA Core
      AbstractPollingIoAcceptor$Acceptor.run
      1. org.apache.mina.transport.socket.nio.NioSocketSession$SessionConfigImpl.setReceiveBufferSize(NioSocketSession.java:257)[stash-ssh-2.5.0_1370884020000.jar:na]
      2. org.apache.mina.transport.socket.AbstractSocketSessionConfig.doSetAll(AbstractSocketSessionConfig.java:53)[stash-ssh-2.5.0_1370884020000.jar:na]
      3. org.apache.mina.core.session.AbstractIoSessionConfig.setAll(AbstractIoSessionConfig.java:63)[stash-ssh-2.5.0_1370884020000.jar:na]
      4. org.apache.mina.transport.socket.nio.NioSocketSession.<init>(NioSocketSession.java:62)[stash-ssh-2.5.0_1370884020000.jar:na]
      5. org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:176)[stash-ssh-2.5.0_1370884020000.jar:na]
      6. org.apache.mina.transport.socket.nio.NioSocketAcceptor.accept(NioSocketAcceptor.java:51)[stash-ssh-2.5.0_1370884020000.jar:na]
      7. org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.processHandles(AbstractPollingIoAcceptor.java:501)[stash-ssh-2.5.0_1370884020000.jar:na]
      8. org.apache.mina.core.polling.AbstractPollingIoAcceptor$Acceptor.run(AbstractPollingIoAcceptor.java:442)[stash-ssh-2.5.0_1370884020000.jar:na]
      8 frames
    4. MINA
      NamePreservingRunnable.run
      1. org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)[stash-ssh-2.5.0_1370884020000.jar:na]
      1 frame
    5. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[na:1.7.0_09]
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[na:1.7.0_09]
      3. java.lang.Thread.run(Thread.java:722)[na:1.7.0_09]
      3 frames