Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54030

"java.lang.IllegalStateException: closed" for GitHub Branch Source 2.4.0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • None
    • Jenkins 2.138.2 LTS on Windows Server 2012 R2, GitHub Branch Source 2.4.0

      Seemingly spontaneously a few hours ago, all builds started failing and MultiBranch Pipeline log scans stopped working (resulting in no new builds getting picked up), due to the following:

      java.lang.IllegalStateException: closed 
      	at okio.RealBufferedSink.writeUtf8(RealBufferedSink.java:56) 
      	at com.squareup.okhttp.internal.DiskLruCache.get(DiskLruCache.java:433) 
      	at com.squareup.okhttp.Cache.get(Cache.java:184) 
      	at com.squareup.okhttp.Cache$1.get(Cache.java:139) 
      	at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:207) 
      	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:450) 
      	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:399) 
      	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getHeaders(HttpURLConnectionImpl.java:155) 
      	at com.squareup.okhttp.internal.huc.HttpURLConnectionImpl.getHeaderField(HttpURLConnectionImpl.java:199) 
      	at com.squareup.okhttp.internal.huc.DelegatingHttpsURLConnection.getHeaderField(DelegatingHttpsURLConnection.java:190) 
      	at com.squareup.okhttp.internal.huc.HttpsURLConnectionImpl.getHeaderField(HttpsURLConnectionImpl.java:25) 
      	at org.kohsuke.github.Requester.noteRateLimit(Requester.java:350) 
      	at org.kohsuke.github.Requester._to(Requester.java:300) 
      	at org.kohsuke.github.Requester.to(Requester.java:239) 
      	at org.kohsuke.github.GitHub.checkApiUrlValidity(GitHub.java:734) 
      	at org.jenkinsci.plugins.github_branch_source.Connector.checkApiUrlValidity(Connector.java:324) 
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.checkApiUrlValidity(GitHubSCMSource.java:1379) 
      	at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:1432) 
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:583) 
      	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:95) 
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:303) 
      	at hudson.model.ResourceController.execute(ResourceController.java:97) 
      	at hudson.model.Executor.run(Executor.java:429) 
      

      This looks like it could be related to https://github.com/square/okhttp/issues/3842, although there isn't a lot of information about that particular problem.

      We resolved it through restarting the Jenkins service, but it has recurred.

      Update

      The original cause appears to be this:

      SEVERE: A thread (OkHttp DiskLruCache/10983) died unexpectedly due to an uncaught exception, this may leave your Jenkins in a bad way and is usually indicative of a bug in the code.
      java.lang.RuntimeException: java.io.IOException: failed to rename C:\Jenkins\org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache\kzk2LrAbdd47xxsEedV9rBIosvEH-synA16s_1p8zVw\journal to C:\Jenkins\org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache\kzk2LrAbdd47xxsEedV9rBIosvEH-synA16s_1p8zVw\journal.bkp
      	at com.squareup.okhttp.internal.DiskLruCache$1.run(DiskLruCache.java:181)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.io.IOException: failed to rename C:\Jenkins\org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache\kzk2LrAbdd47xxsEedV9rBIosvEH-synA16s_1p8zVw\journal to C:\Jenkins\org.jenkinsci.plugins.github_branch_source.GitHubSCMProbe.cache\kzk2LrAbdd47xxsEedV9rBIosvEH-synA16s_1p8zVw\journal.bkp
      	at com.squareup.okhttp.internal.io.FileSystem$1.rename(FileSystem.java:85)
      	at com.squareup.okhttp.internal.DiskLruCache.rebuildJournal(DiskLruCache.java:407)
      	at com.squareup.okhttp.internal.DiskLruCache.access$400(DiskLruCache.java:88)
      	at com.squareup.okhttp.internal.DiskLruCache$1.run(DiskLruCache.java:177)
      

      This has now recurred twice within the last 6 hours. My upgrade to Jenkins 2.138.2 was this morning, but also included a set of plugin updates, including GitHub Branch Source 2.4.0. I'm contemplating which to revert.

            Unassigned Unassigned
            medianick Nick Jones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: