java.io.IOException: Bad file descriptor

Atlassian JIRA | Adam Ahmed [Atlassian] | 3 years ago
  1. 0

    Similar to STASH-3820, the process() method could be interrupted by a .cancel() on the Git ExternalProcess. We call {{Closeables.closeQuietly(out);}} in a finally block, which closes the outputStream (the stdin of the Git process). But if the Git process has been cancelled, this causes a "Bad file descriptor" warning. NOTE: I have not attempted to reproduce this, so this is a hunch - it's possible that the cause of this error is different to STASH-3820. {noformat} 2013-08-28 02:02:54,458 DEBUG [NioProcessor-5] c.a.s.i.scm.git.ssh.GitSshScmRequest upload-pack canceled 2013-08-28 02:02:54,468 WARN [ExtProcess - IO Pump:thread-14696] Kontagent QA 122x337792x7 30c6f0 10.36.103.130 SSH - git-upload-pack '/ETL/etl-stream.git' com.google.common.io.Closeables IOException thrown while closing Closeable. java.io.IOException: Bad file descriptor at java.io.FileOutputStream.close0(Native Method) ~[na:1.6.0_22] at java.io.FileOutputStream.close(FileOutputStream.java:279) ~[na:1.6.0_22] at java.io.FilterOutputStream.close(FilterOutputStream.java:143) ~[na:1.6.0_22] at com.google.common.io.Closeables.close(Closeables.java:79) [guava-10.0.1.jar:na] at com.google.common.io.Closeables.closeQuietly(Closeables.java:98) [guava-10.0.1.jar:na] at com.atlassian.stash.internal.scm.git.ssh.GitSshInputHandler.process(GitSshInputHandler.java:42) [stash-scm-git-2.7.0_1376959322000.jar:na] at com.atlassian.utils.process.PluggableProcessHandler.provideInput(PluggableProcessHandler.java:135) [atlassian-processutils-1.5.10.jar:na] at com.atlassian.utils.process.ExternalProcessImpl$1.doTask(ExternalProcessImpl.java:302) [atlassian-processutils-1.5.10.jar:na] at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:36) [atlassian-processutils-1.5.10.jar:na] at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:68) [stash-platform-2.7.0.jar:na] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_22] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_22] at java.lang.Thread.run(Thread.java:662) [na:1.6.0_22] {noformat}

    Atlassian JIRA | 3 years ago | Adam Ahmed [Atlassian]
    java.io.IOException: Bad file descriptor
  2. 0

    Similar to STASH-3820, the process() method could be interrupted by a .cancel() on the Git ExternalProcess. We call {{Closeables.closeQuietly(out);}} in a finally block, which closes the outputStream (the stdin of the Git process). But if the Git process has been cancelled, this causes a "Bad file descriptor" warning. NOTE: I have not attempted to reproduce this, so this is a hunch - it's possible that the cause of this error is different to STASH-3820. {noformat} 2013-08-28 02:02:54,458 DEBUG [NioProcessor-5] c.a.s.i.scm.git.ssh.GitSshScmRequest upload-pack canceled 2013-08-28 02:02:54,468 WARN [ExtProcess - IO Pump:thread-14696] Kontagent QA 122x337792x7 30c6f0 10.36.103.130 SSH - git-upload-pack '/ETL/etl-stream.git' com.google.common.io.Closeables IOException thrown while closing Closeable. java.io.IOException: Bad file descriptor at java.io.FileOutputStream.close0(Native Method) ~[na:1.6.0_22] at java.io.FileOutputStream.close(FileOutputStream.java:279) ~[na:1.6.0_22] at java.io.FilterOutputStream.close(FilterOutputStream.java:143) ~[na:1.6.0_22] at com.google.common.io.Closeables.close(Closeables.java:79) [guava-10.0.1.jar:na] at com.google.common.io.Closeables.closeQuietly(Closeables.java:98) [guava-10.0.1.jar:na] at com.atlassian.stash.internal.scm.git.ssh.GitSshInputHandler.process(GitSshInputHandler.java:42) [stash-scm-git-2.7.0_1376959322000.jar:na] at com.atlassian.utils.process.PluggableProcessHandler.provideInput(PluggableProcessHandler.java:135) [atlassian-processutils-1.5.10.jar:na] at com.atlassian.utils.process.ExternalProcessImpl$1.doTask(ExternalProcessImpl.java:302) [atlassian-processutils-1.5.10.jar:na] at com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:36) [atlassian-processutils-1.5.10.jar:na] at com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:68) [stash-platform-2.7.0.jar:na] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_22] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_22] at java.lang.Thread.run(Thread.java:662) [na:1.6.0_22] {noformat}

    Atlassian JIRA | 3 years ago | Adam Ahmed [Atlassian]
    java.io.IOException: Bad file descriptor
  3. 0

    Error while applying patch: The handle is invalid

    YouTrack | 8 years ago
    java.io.IOException: The handle is invalid
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How to gracefully clean up an HTTPURLConnection when an exception is caught?

    Stack Overflow | 5 years ago | Jonah Bishop
    java.io.IOException: insufficient data written

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      Bad file descriptor

      at java.io.FileOutputStream.close0()
    2. Java RT
      FilterOutputStream.close
      1. java.io.FileOutputStream.close0(Native Method)[na:1.6.0_22]
      2. java.io.FileOutputStream.close(FileOutputStream.java:279)[na:1.6.0_22]
      3. java.io.FilterOutputStream.close(FilterOutputStream.java:143)[na:1.6.0_22]
      3 frames
    3. Guava
      Closeables.closeQuietly
      1. com.google.common.io.Closeables.close(Closeables.java:79)[guava-10.0.1.jar:na]
      2. com.google.common.io.Closeables.closeQuietly(Closeables.java:98)[guava-10.0.1.jar:na]
      2 frames
    4. com.atlassian.stash
      GitSshInputHandler.process
      1. com.atlassian.stash.internal.scm.git.ssh.GitSshInputHandler.process(GitSshInputHandler.java:42)[stash-scm-git-2.7.0_1376959322000.jar:na]
      1 frame
    5. com.atlassian.utils
      LatchedRunnable.run
      1. com.atlassian.utils.process.PluggableProcessHandler.provideInput(PluggableProcessHandler.java:135)[atlassian-processutils-1.5.10.jar:na]
      2. com.atlassian.utils.process.ExternalProcessImpl$1.doTask(ExternalProcessImpl.java:302)[atlassian-processutils-1.5.10.jar:na]
      3. com.atlassian.utils.process.LatchedRunnable.run(LatchedRunnable.java:36)[atlassian-processutils-1.5.10.jar:na]
      3 frames
    6. com.atlassian.stash
      StateTransferringExecutor$StateTransferringRunnable.run
      1. com.atlassian.stash.internal.concurrent.StateTransferringExecutor$StateTransferringRunnable.run(StateTransferringExecutor.java:68)[stash-platform-2.7.0.jar:na]
      1 frame
    7. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[na:1.6.0_22]
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[na:1.6.0_22]
      3. java.lang.Thread.run(Thread.java:662)[na:1.6.0_22]
      3 frames