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 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 `

          Daniel Beck added a comment -

          That advice would have very limited geographical relevance, as google.com was specifically chosen because of it's solid availability. In most countries, if google.com isn't available, nothing else is either.

          That said, maybe something like Microsoft's http://www.msftncsi.com/ncsi.txt would be a better choice. Can you connect to that site?

          Daniel Beck added a comment - That advice would have very limited geographical relevance, as google.com was specifically chosen because of it's solid availability. In most countries, if google.com isn't available, nothing else is either. That said, maybe something like Microsoft's http://www.msftncsi.com/ncsi.txt would be a better choice. Can you connect to that site?

          Daniel Beck added a comment -

          JENKINS-15124 notes that some shit proxies return nice looking error pages instead of error responses, so having a reference URL with defined content that can be compared would be nice.

          Daniel Beck added a comment - JENKINS-15124 notes that some shit proxies return nice looking error pages instead of error responses, so having a reference URL with defined content that can be compared would be nice.

          Daniel Beck added a comment -

          Please answer the question in the comment from Oct 11 if you're still interested in a solution to this.

          Daniel Beck added a comment - Please answer the question in the comment from Oct 11 if you're still interested in a solution to this.

          If the need in the end is that it is possible to reach the update site, then why bother checking www.google.com, why not check that you can reach the update site?

          It is possible to rsync the update site and update the update site URL in Jenkins, so it appears to be a valid use case to have an internal update site anyway. In that case this internet issue is artificial and should be able to be avoided if desired as a configuration option within the update management IMO.

          NetAppBlueDevil added a comment - If the need in the end is that it is possible to reach the update site, then why bother checking www.google.com, why not check that you can reach the update site? It is possible to rsync the update site and update the update site URL in Jenkins, so it appears to be a valid use case to have an internal update site anyway. In that case this internet issue is artificial and should be able to be avoided if desired as a configuration option within the update management IMO.

          y g added a comment -

          Any update on this problem?

          I can ping updates.jenkins-ci.org and download package manually but cannot use the update center.

          I guess the problem is because the server is behind GFW. But why bother test against other site when you want to connect to THE SITE if I follow the comments correctly.

          y g added a comment - Any update on this problem? I can ping updates.jenkins-ci.org and download package manually but cannot use the update center. I guess the problem is because the server is behind GFW. But why bother test against other site when you want to connect to THE SITE if I follow the comments correctly.

          mgy tdxmgy added a comment -

          If you want to update some plugins, you can modify jenkins_home/updates/default.json ,change connectionCheckUrl from http://www.google.com/ to some one you can access ,maybe https://www.baidu.com for china, then reload configuration,and install plugins.But jenkins will get this file daily,so if you need,you can do it.

          mgy tdxmgy added a comment - If you want to update some plugins, you can modify jenkins_home/updates/default.json ,change connectionCheckUrl from http://www.google.com/ to some one you can access ,maybe https://www.baidu.com for china, then reload configuration,and install plugins.But jenkins will get this file daily,so if you need,you can do it.

          mgy tdxmgy added a comment -

          mgy tdxmgy added a comment - pipehappy

          danielbeck: What do you think?

          Could we just set http://updates.jenkins-ci.org/ as the connectivity check URL in the JSON? It is reliable, and is what the code currently checks anyway at the moment (after checking Google):
          https://github.com/jenkinsci/jenkins/blob/jenkins-1.647/core/src/main/java/hudson/model/UpdateCenter.java#L1062

          If you can't reach the Jenkins update server, then you have problems anyway. In the worst case, if that host really is down, then the user would be informed, and asked if they need to make proxy changes. But that should be rare, and the same would happen anyway for people in countries where Google can end up being blocked.

          Just wondering, as somebody was asking about the connection check URL here:
          https://github.com/jenkinsci/backend-update-center2/pull/40#issuecomment-183517346

          Christopher Orr added a comment - danielbeck : What do you think? Could we just set http://updates.jenkins-ci.org/ as the connectivity check URL in the JSON? It is reliable, and is what the code currently checks anyway at the moment (after checking Google): https://github.com/jenkinsci/jenkins/blob/jenkins-1.647/core/src/main/java/hudson/model/UpdateCenter.java#L1062 If you can't reach the Jenkins update server, then you have problems anyway. In the worst case, if that host really is down, then the user would be informed, and asked if they need to make proxy changes. But that should be rare, and the same would happen anyway for people in countries where Google can end up being blocked. Just wondering, as somebody was asking about the connection check URL here: https://github.com/jenkinsci/backend-update-center2/pull/40#issuecomment-183517346

          R. Tyler Croy added a comment -

          I have no idea if this helps at all, but seganw you might be to hit our mirrors directly for your update-center.json.

          A list of the mirrors can be found here and from each mirror listed you should be able to navigate to updates/ and then select either the latest update-center.json or the LTS version (stable/update-center.json)

          R. Tyler Croy added a comment - I have no idea if this helps at all, but seganw you might be to hit our mirrors directly for your update-center.json. A list of the mirrors can be found here and from each mirror listed you should be able to navigate to updates/ and then select either the latest update-center.json or the LTS version ( stable/update-center.json )

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

              Created:
              Updated: