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

UpdateCenter stuck at preparation phase when jenkins server is behind GFW

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • MacOS X Mavericks;
      jenkins Mac installation package;
      Server is in PR. China without any proxies. Google.com cannot accessed due to GFW blocking

      Try to install a plugin in PluginManager; click "Install and restart".
      in UpdateCenter, screen stuck at "Preparation Checking internet connectivity".

      No logs printed out in `var/log/jenkins/jenkins.log`

      This bug is caused by method `getConnectionCheckUrl` using url "google.com" to check connectivity.
      https://github.com/jenkinsci/jenkins/blob/afd8da49901775900a80eb2b2a9746b01156b0ba/core/src/main/java/hudson/model/UpdateCenter.java#L841

      ------- update:
      I just built jenkins.war replaced the google.com with another url. But It still not work.

      I got these warnings, and the log is the same when using 'google.com' url. So it may not be the url problem.

      七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
      警告: Adding dependent install of ssh-credentials for plugin git
      七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
      警告: Adding dependent install of credentials for plugin ssh-credentials
      七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
      警告: Adding dependent install of git-client for plugin git
      七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
      警告: Dependent install of ssh-credentials for plugin git-client already added, skipping
      七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
      警告: Adding dependent install of scm-api for plugin git
      七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
      警告: Dependent install of credentials for plugin git already added, skipping

          [JENKINS-23654] UpdateCenter stuck at preparation phase when jenkins server is behind GFW

          Sean Wang created issue -
          Sean Wang made changes -
          Description Original: Try to install a plugin in PluginManager; click "Install and restart".
          in UpdateCenter, screen stuck at "Preparation Checking internet connectivity".

          No logs printed out in `var/log/jenkins/jenkins.log`

          This bug is caused by method `getConnectionCheckUrl` using url "google.com" to check connectivity.
          https://github.com/jenkinsci/jenkins/blob/afd8da49901775900a80eb2b2a9746b01156b0ba/core/src/main/java/hudson/model/UpdateCenter.java#L841
          New: Try to install a plugin in PluginManager; click "Install and restart".
          in UpdateCenter, screen stuck at "Preparation Checking internet connectivity".

          No logs printed out in `var/log/jenkins/jenkins.log`

          This bug is caused by method `getConnectionCheckUrl` using url "google.com" to check connectivity.
          https://github.com/jenkinsci/jenkins/blob/afd8da49901775900a80eb2b2a9746b01156b0ba/core/src/main/java/hudson/model/UpdateCenter.java#L841

          ------- update:
          I just built jenkins.war replaced the google.com with another url. But It still not work.

          I got these warnings:

          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of ssh-credentials for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of credentials for plugin ssh-credentials
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of git-client for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Dependent install of ssh-credentials for plugin git-client already added, skipping
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of scm-api for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Dependent install of credentials for plugin git already added, skipping
          Sean Wang made changes -
          Description Original: Try to install a plugin in PluginManager; click "Install and restart".
          in UpdateCenter, screen stuck at "Preparation Checking internet connectivity".

          No logs printed out in `var/log/jenkins/jenkins.log`

          This bug is caused by method `getConnectionCheckUrl` using url "google.com" to check connectivity.
          https://github.com/jenkinsci/jenkins/blob/afd8da49901775900a80eb2b2a9746b01156b0ba/core/src/main/java/hudson/model/UpdateCenter.java#L841

          ------- update:
          I just built jenkins.war replaced the google.com with another url. But It still not work.

          I got these warnings:

          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of ssh-credentials for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of credentials for plugin ssh-credentials
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of git-client for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Dependent install of ssh-credentials for plugin git-client already added, skipping
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of scm-api for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Dependent install of credentials for plugin git already added, skipping
          New: Try to install a plugin in PluginManager; click "Install and restart".
          in UpdateCenter, screen stuck at "Preparation Checking internet connectivity".

          No logs printed out in `var/log/jenkins/jenkins.log`

          This bug is caused by method `getConnectionCheckUrl` using url "google.com" to check connectivity.
          https://github.com/jenkinsci/jenkins/blob/afd8da49901775900a80eb2b2a9746b01156b0ba/core/src/main/java/hudson/model/UpdateCenter.java#L841

          ------- update:
          I just built jenkins.war replaced the google.com with another url. But It still not work.

          I got these warnings, and the log is the same when using 'google.com' url. So it may not be the url problem.

          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of ssh-credentials for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of credentials for plugin ssh-credentials
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of git-client for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Dependent install of ssh-credentials for plugin git-client already added, skipping
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Adding dependent install of scm-api for plugin git
          七月 02, 2014 7:49:14 下午 hudson.model.UpdateSite$Plugin deploy
          警告: Dependent install of credentials for plugin git already added, skipping

          Daniel Beck added a comment -

          The connection check URL actually used is part of the update center metadata, see the comment.

          You'll need to host your own update center and replace the URL with one that can be reached from your network.

          Daniel Beck added a comment - The connection check URL actually used is part of the update center metadata, see the comment. You'll need to host your own update center and replace the URL with one that can be reached from your network.

          Sean Wang added a comment - - edited

          @Daniel
          In my update, I mentioned that I changed google url in source code, but still not work.
          According to the logs I attached, this maybe lead to another problem. It seems connected to UpdateSite.java line no. 789
          After some test, I found that "job" in "UpdateCenter.InstallationJob job = uc.getJob(dep);" returned null.

          How would it be null then?

          Sean Wang added a comment - - edited @Daniel In my update, I mentioned that I changed google url in source code, but still not work. According to the logs I attached, this maybe lead to another problem. It seems connected to UpdateSite.java line no. 789 After some test, I found that "job" in "UpdateCenter.InstallationJob job = uc.getJob(dep);" returned null. How would it be null then?

          Daniel Beck added a comment -

          Why do you think that that value being null is a problem?

          Did you change the connectionCheckUrl entry in updated/default.json (replace default by the update center name if you changed its configuration)? Because the hard-coded value you're referencing is never actually used...

          Daniel Beck added a comment - Why do you think that that value being null is a problem? Did you change the connectionCheckUrl entry in updated/default.json (replace default by the update center name if you changed its configuration)? Because the hard-coded value you're referencing is never actually used...

          Sean Wang added a comment - - edited

          Finally, I know what's the cause.
          As you said, the log did nothing wrong.

          It's due to two other hard-coded google urls:

          Line 333 in method getConnectionCheckUrl() of UpdateSite.java:
          if(dt==null) return "http://www.google.com/";

          and

          key-value "connectionCheckUrl": "http://www.google.com/" in $JENKINS_HOME/updates/default.json

          Sean Wang added a comment - - edited Finally, I know what's the cause. As you said, the log did nothing wrong. It's due to two other hard-coded google urls: Line 333 in method getConnectionCheckUrl() of UpdateSite.java: if(dt==null) return "http://www.google.com/"; and key-value "connectionCheckUrl": "http://www.google.com/" in $JENKINS_HOME/updates/default.json

          Daniel Beck added a comment -

          This is a weird one.

          On one hand, it makes sense to allow update centers to do their own connectivity check configuration, to account for corporate intranets. And it's a very rare situation that Google cannot be reached while still having actual connectivity, so it's a good default for the public update center. So I'd really like to resolve this as Won't Fix, unless you have a nice, generally applicable solution available.

          OTOH, telling you to fix your network issues would lead nowhere. And I assume this affects all Chinese users, so a straightforward solution would be good. How easy (or difficult) would it be to route google.com to a host you can connect to, such as baidu, in your hosts file or local DNS?

          Daniel Beck added a comment - This is a weird one. On one hand, it makes sense to allow update centers to do their own connectivity check configuration, to account for corporate intranets. And it's a very rare situation that Google cannot be reached while still having actual connectivity, so it's a good default for the public update center. So I'd really like to resolve this as Won't Fix, unless you have a nice, generally applicable solution available. OTOH, telling you to fix your network issues would lead nowhere. And I assume this affects all Chinese users, so a straightforward solution would be good. How easy (or difficult) would it be to route google.com to a host you can connect to, such as baidu, in your hosts file or local DNS?

          Sean Wang added a comment -

          I do not think changing hosts file is a good idea.

          IMHO, the best solution at present is a graceful error notice appearing when checking connectivity hang there after some time. That notice should guide user to change the url in `key-value "connectionCheckUrl": "http://www.google.com/" in $JENKINS_HOME/updates/default.json `

          Sean Wang added a comment - I do not think changing hosts file is a good idea. IMHO, the best solution at present is a graceful error notice appearing when checking connectivity hang there after some time. That notice should guide user to change the url in `key-value "connectionCheckUrl": "http://www.google.com/" in $JENKINS_HOME/updates/default.json `
          Jenkins IRC Bot made changes -
          Component/s New: core [ 15593 ]
          Component/s Original: update-center [ 15629 ]

            Unassigned Unassigned
            seganw Sean Wang
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: