Why does Jenkins keep telling me it is offline? - jenkins

I am not getting option to install plugins in Jenkins. Instead getting two options Configure Proxy and Skip Plugin Installations.

Might be worth checking - I did a mistake myself and spent a day checking.
Just mention the IP, and not the complete address in Server field in jenkins while configuring proxy.
So, let us suppose your proxy is http://x.x.x.x:8080 - so just put x.x.x.x in server field.

Navigate to C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins,
Modify "hudson.model.UpdateCenter.xml" file by changing the URL property to "http"
Finally Open CMD with Admin privilege and run.
net stop jenkins
net start jenkins

Related

How to give a meaningful hostname (XYZ.com), replacing "localhost:8080" in Jenkins

I recently started working with Jenkins for CI/CD for ASP.net applications.
I have built a Jenkins server and created the required jobs with appropriate plugins.
My Jenkins is configured with localhost:8080 initially.
Later I was asked to give a meaningful host name (xyz.com), so that with in the organization all IT employees can access without logging in to the server to access Jenkins.
I have already tried to change the configurations under manage Jenkins -> Configure -> Jenkins Location (Jenkins URL), changed it to "localhost:80" and added "127.0.0.1 xyz.com" in the host file.
I have changed the port number in Jenkins.xml file even.
It didn't work for me because I had to browse "xyz.com:8080"
My final result should be "xyz.com" and should be accessible for the entire team.(I will take care of DNS).
Any help would be appreciated.
Thanks in advance.

Why does Jenkins say "This Jenkins instance appears to be offline"

I have a fresh install of Jenkins 2.32.2 on Ubuntu.
Opened a browser on the instance and get to a page titled Offline, with the message "This Jenkins instance appears to be offline" and offers options to "Configure Proxy" or "Skip Plugin Installation"
The machine clearly isn't offline as I just used the internet connection to do the installation.
I also had a previous installation, done exactly the same way, that was working.
I removed the previous installation as Pipelines wouldn't work and Google told me it was because of JDK 9. So I removed all the JDK/JRE installations as well as jenkins, fresh installed JDK 8 only, installed Jenkins, and got to here.
Jenkins has worked on this box in the past so what makes it think it is offline?
Update: Found a log file /var/lib/jenkins/logs/tasks/Download metadata.log
and it starts with a message FATAL: Connection refused (Connection refused)
I would think that indicates that the internet connection is OK, but something else is stopping it getting data?
Update: Based on other research I checked the Update Site in the Plugin Manager. This is listed as http://updates.jenkins-ci.org/update-center.json and, from the command line a wget of this file succeeds. So most definitely not a connection issue. Worked with both http and https, jenkins works with neither.
In my case, it has something to do with SSL. I manage to fix it by editing /var/lib/jenkins/hudson.model.UpdateCenter.xml and change url to use http instead of https.
Restart jenkins and reload the website, it no longer shows offline.
For macOS users:
Step -1: Edit /Users/Shared/Jenkins/Home/hudson.model.UpdateCenter.xml and change url to use http instead of https.
Step -2: Restart jenkins (for instance by going to http:localhost:8080) and reload the website
Step -3(Optional): If it asks for user and password and if you don't remember creating one; default user is admin and copy the password from
sudo cat /Users/Shared/Jenkins/Home/secrets/initialAdminPassword
credits - #Alex in this post and #Tuan Pham here and #Joe Walsh for the comment on macOS directory path
There is something wrong with the internet connection of update center.I have met the same situation with Jenkins installed on macOS.
You can try to modify the hudson.model.UpdateCenter.xml file.
Jenkins installed with .pkg package on macOS,the file path is:
/Users/Shared/Jenkins/Home/hudson.model.UpdateCenter.xml
Jenkins installed by Homebrew on macOS,the file path is:
/Users/{username}/.jenkins/hudson.model.UpdateCenter.xml
Open the file:
<?xml version='1.1' encoding='UTF-8'?>
<sites>
<site>
<id>default</id>
<url>https://updates.jenkins.io/update-center.json</url>
</site>
</sites>
You can try to change https://updates.jenkins.io/update-center.json to:
http://updates.jenkins.io/update-center.json
or
// If you are in China or near China area,https and http are both OK.
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json
And then you can restart Jenkins by:
//loading the URL to restart Jenkins.
http://localhost:8080/restart
or
// Use Homebrew command to restart Jenkins if you installed Jenkins LTS version by Homebrew.
brew services restart jenkins-lts
in my case (macOS), updating jdk to 8 and reinstall jenkins solved the problem.
The issue is that for some reason Jenkins doesn't have access to the certificates chain of the Jenkins updates service.
On Ubuntu 18.04 I had this issue and the next links and instructions helped me to start Jenkins properly without modifying the default url or using a proxy of some sort.
Installing a new JDK 8(u101+) with JAVA_HOME should do the trick like at:
https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04
is making sure that Lets Encrypt certificates are installed and available on the OS/SYSTEM.
To test it you can use the instructions at:
Does Java support Let's Encrypt certificates?
And to install manually if required the Let's encrypt root chain using the next script:
https://gist.github.com/Firefishy/109b0f1a90156f6c933a50fe40aa777e
I also faced this issue i.e. This Jenkins instance appears to be offline on windows 10.
Below are the steps I followed to solve it:
Navigate to the Jenkins Home Directory.
For me, the default home directory is: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins
Changed the protocol from HTTPS to HTTP in the file hudson.model.UpdateCenter.xml
Restarted Jenkins (Go to C:\Program Files\Jenkins and then execute jenkins.exe stop, jenkins.exe start)
Logged in to Jenkins again (http://localhost:8080/).
The offline error got solved.
In my case i have changed https to http in URL line of /var/lib/jenkins/hudson.model.UpdateCenter.xml file
and restarted the jenkins. It started functioning.
in case you are running jenkins in a container and vi is not installed
access your container in interactive mode
docker exec -it jenkins-ci /bin/bash
use this sed command to replace https with http
sed -i 's/https/http/g' /var/jenkins_home/hudson.model.UpdateCenter.xml
This mostly happens when you are working with company issued PC Windows OS.
Fix :-
click on "Configure Proxy" ask your IT team for specific server and port values that can bypass firewall and give your windows username & password. In this way you can resolve windows firewall and offline Jenkins issue.
I researched a lot over Internet but nowhere the fix is available.
Thanks!
For Ubuntu,
go to /home/username/.Jenkins/Hudson.model.UpdateCenter.xml and
edit the file from https to http.
On MacOS 10.11.6 :
Go to /Users/<UserName>/.jenkins
Open the file hudson.model.UpdateCenter.xml
Change the value of default from https://xxx to http://xxx
Took note of the secret Administrator password path that Jenkins displays when first opening http://localhost:8080/ on a browser.
The path was: C:\Users{username}\AppData\Local\Jenkins.jenkins\secrets.
Therefore the hudson.model.UpdateCenter file was at C:\Users{username}\AppData\Local\Jenkins.jenkins\
Updated the hudson.model.UpdateCenter file in notepad to have text http instead of https as follows:
http://updates.jenkins.io/update-center.json
Reloaded the http://localhost:8080/ page but still showed the text "This Jenkins instance appears to be offline."
Then navigated to the Services App in Windows (click Windows and type 'Services App' and it should display the App in the search list)
In the services App right clicked the Jenkins service and selected Restart.
After Windows restarted the Jenkins service navigated to http://localhost:8080/
The Jenkins page wouldn't even load. Navigated to the Jenkins login page: http://localhost:8080/login?from=%2F
Then got a loading page with text:'Please wait while Jenkins is getting ready to work ...
Your browser will reload automatically when Jenkins is ready.'
Assumed that Jenkins was still restarting.
Once the Jenkins login page loaded, entered that password/secret again and clicked Continue.
This time the page with "This Jenkins instance appears to be offline." was not displayed. Jenkins displayed a Getting Started -> Customize Jenkins page with buttons to install plugins.
For Windows OS,
follow below steps:
Go to C:\Users\\*your user name*\\.jenkins
Open the file hudson.model.UpdateCenter.xml
Update the value of url from https://xxx to http://xxx
I make no claims about this, especially Java related (I personally cannot stand the language), but on my Ubuntu 18.04 L/T, I needed to stand-up a standalone Jenkins instance; So I installed both the Java on which Jenkins appears to be dependent and Jenkins itself
sudo apt install openjdk-8-jdk jenkins
Then I updated the Jenkins defaults
sudo gvim /etc/default/jenkins
... inserting the following at the top of the file - only because editing /etc/init.d/jenkins appeared to serve no purpose as it had no effect whatsoever ...
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/
PATH=$JAVA_HOME:$PATH
Finally, save & quit ... then attempt Jenkins restart
sudo service jenkins restart
HTH - it certainly worked for me :-)
I'm working on a Mac, and in my case, it turned out that the version of Java Jenkins was using (1.8.0u66) wasn't up to date enough. I had both Java 11 and Java 14 installed, but the jenkins-lts script was coded to force use of Java 8. Rather than install a more up to date JDK 8 installation, I modified the script to run ${JAVA_HOME}/bin/java and set JAVA_HOME to the JDK 11 installation.
It might not always be an option but if you have a choice use different Image. I used Debian GNU/Linux 10 and it worked like a charm.
Re-installing JAVA JDK8 worked for me.
Another possibility - make sure DNS functions properly for Jenkins.
In my case, I followed Kubernetes setup instructions here to install Jenkins, and it led to this problem.
I enabled logging on CoreDNS and saw this:
│ [INFO] 10.70.116.14:45888 - 50490 "AAAA IN updates.jenkins.io.svc.cluster.local. udp 54 false 512" NXDOMAIN qr,aa,rd 147 0.0001896s │
│ [INFO] 10.70.116.14:45888 - 32566 "A IN updates.jenkins.io.svc.cluster.local. udp 54 false 512" NXDOMAIN qr,aa,rd 147 0.000169468s │
│ [INFO] 10.70.116.14:57907 - 22912 "A IN updates.jenkins.io.localdomain. udp 48 false 512" NOERROR qr,aa 110 0.000907476s │
│ [INFO] 10.70.116.14:57907 - 52100 "AAAA IN updates.jenkins.io.localdomain. udp 48 false 512" NOERROR qr,aa 110 0.001709031s
The lookups were all cluster-local.
If I edited the URL (as suggested in other answers here) to include a dot after updates.jenkins.io. then hostname lookup worked and the URL resolved. Though Jenkins' next step errors for the same reason.
In the end I discovered the problem was ClusterFirst mode of the pod's DNS. I added dnsPolicy: Default to the deployment's pod template spec (the instructions link above), and now it works.
Even I faced similar issue, then figured out that JDK that I was using is 8 instead of 11.
Check jenkins jdk combination under jenkins official site
I used JDK11 with Jenkins 2.3031 version and it worked fine - all plugins got downloaded
In my case, I use WINDOWS OS. So, jenkins was installed in my C drive.
PATH : C:\Users\Username\ .jenkins
Under "hudson.model.UpdateCenter" file change "https" to "http"
<?xml version='1.1' encoding='UTF-8'?>
<sites>
<site>
<id>default</id>
<url>http://updates.jenkins.io/update-center.json</url>
</site>
</sites>
As some others pointed out, in Windows, this could be because of firewall restrictions set by company infrastructure.
For my case, I need the recommended plugins to be present (e.g. Folders plugin)
My workaround was:
A. Install same Jenkins version into my personal laptop/VM, and be sure to install the recommended plugins the first time you browse to the Jenkins Web Page.
B. Copy the plugins folder from my personal laptop's JENKINS HOME folder (i.e. ProgramData\Jenkins...) into the Jenkins plugins folder of the company laptop.
Total size of the plugins folder was around 150MB (zipped).
Enter this before running Jenkins.
# iptalbes -F
It may be because of the firewall.
jenkins_enable="YES"
jenkins_home="/usr/local/jenkins"
jenkins_user="jenkins"
jenkins_args="--webroot=${jenkins_home}/war --httpListenAddress=*.*.*.* --httpPort=8180"
#jenkins_java_opts="-Djavax.net.ssl.trustStore=/usr/local/jenkins/cacerts -Djava.net.preferIPv6Addresses=true"
#jenkins_java_opts="-Djavax.net.ssl.trustStore=/usr/local/jenkins/cacerts -Djava.net.preferIPv4Addresses=true"

Jenkins Update Center broken -- java.io.IOException: Downloaded file /var/lib/jenkins/plugins/*.jpi.tmp does not match expected SHA-1 [duplicate]

I have installed Jenkins by deploying its WAR file to Tomcat. On typing
http://localhost:8080/jenkins
In browser, jenkins home page is opening which means jenkins is successfully installed. I configured system settings, gave jdk and maven path and save them. Then to install plugins, I clicked on Jenkins->Manage plugins and clicked on Available tab but could not find any plugins. I tried three solutions:
Configured proxy for Jenkins by going to Jenkins->Manage Plugins->Advanced(did not find plugins)
Restarted server, refreshed browser and went to Jenkins->Manage plugins->Available (still did not find any plugins). So, I read somewhere that we have update plugins forcefully if they are not updated automatically. So, went to Jenkins->Manage Plugins->Advanced and clicked the tab 'Check now' (Still did not find any plugins on clicking on Available tab).
Finally I read somewhere that if we add the pluginGroup 'org.jvnet.hudson.tools' to settings.xml file of maven, problem may be resolved. So, added the corresponding code to settings.xml:
Then I tried again but still could not find any plugins in
Jenkins->Manage plugins->Available
If any other solution is there which can resolve this problem please let me know.
Go to: Manage Jenkins → Manage Plugins → Advanced, then click Check now in the bottom right-hand corner. When you go back to Available tab all plugins should be listed.
At the plugins section of Jenkins open the "Advanced Settings" tab and paste the following URL into the Update Server URL field (at the bottom): https://updates.jenkins.io/update-center.json
For me the following worked:
Go to Manage Jenkins->Configure Global Security
Click the checkbox for "Use browser for metadata download"
I also have security disabled and prevent cross site forgery unchecked.
You can force update the plugin list by hand.
This worked for me:
wget -O default.js http://updates.jenkins-ci.org/update-center.json
sed '1d;$d' default.js > default.json
curl -X POST -H "Accept: application/json" -d #default.json http://localhost:8080/updateCenter/byId/default/postBack --verbose
(I created this in order to be able to deploy Jenkins and install plugins in batch)
The problem may be that your browser proxy settings are not configured properly.
Jenkins doesn't retrieve the plugin list directly from the update center, it tells your browser to retrieve it and post it back to Jenkins. So the HTTP proxy settings within Jenkins are ignored for this step.
So if you are using a browser that is configured to only work within your network, to connect to local servers such as a Jenkins instance, then you won't be able to update the plugin list.
(This just happened to me and took a frustrating hour to work out.)
This was so frustrating... Not because of difficulty but lack of clarity and good documentation, at least for the issues I encountered. I ended up having to set up the Manage Plugins -> Advanced -> HTTP Proxy Configuration in a very specific, picky way. If I didn't do exactly this, minus the last noted thing on the bottom, I could not get this working. Maybe it's my work's firewall, maybe it's jenkins, either way give this a shot if you haven't been able to successfully update your proxy settings. I used the Validate Proxy tool in the menu. I'll very briefly describe the infographic basics below
Don't add http:// or https:// to your Server field
Use your jenkins credentials for Username and Password, not your proxy credentials (if that's even applicable)
Add http:// to your Test URL if you're checking something like Google or Yahoo
Submit your changes
Then run check-now
(Optional?) Change Update site from HTTP to HTTPS
You should be able to now update your plugins fingers-crossed
Change the update site from
https://updates.jenkins.io/update-center.json
to
http://updates.jenkins-ci.org/update-center.json
I had this issue when using nginx as a secure reverse proxy. I needed to update the url from which to download the updates list, as suggested above, only with https to prevent mixed content errors in chrome.
The reason why I could not find a plugin that i searched for in Jenkins->Manage plugins->Available:
It had already been installed and it was in Jenkins->Manage plugins->Installed.
I came across this SO answer while I was experiencing the same issue. When I would click "Check Now" to force Jenkins to download the latest list, my browser would just hang. It wasn't until I tailed the Jenkins log that I found this here:
Mar 10, 2014 1:15:54 PM hudson.security.csrf.CrumbFilter doFilter
WARNING: No valid crumb was included in request for /administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test. Returning 403.
Looks like the issue has to do with how I've put Jenkins behind a reverse proxy and enabled the option to prevent Cross Site Request Forgery. Once I disabled that, the "Check Now" completed within 30 seconds.
For me, the following works out. I experience this empty available list issue after a fresh install jenkins 1.638 on Ubuntu 1404 in virtual box. We're under an ISA proxy server.
Go to Jenkins->Manage Plugins->Advanced and setup the proxy as below:
Host: 192.168.x.x (your Proxy IP)
Port: 80 (Your proxy port)
Note that I find the format matters. I tried adding http:// it doesn't work. It has to be exactly like above.
Then hit the check now button in the bottom right as everyone else suggested. Then you get the list.
My solution is here
If you type in "http://updates.jenkins-ci.org/update-center.json" directory to brower's address bar, (in my case) it actually redirected to "http://ftp.tsukuba.wide.ad.jp/software/jenkins/updates/current/update-center.json."
It worked when I set "http://ftp.tsukuba.wide.ad.jp/software/jenkins/updates/current/update-center.json" to Jenkins' update site, and click "Save" & "Update."
Hope this helps.
Or your plugin can be already installed. Once it's installed it's not in the list of available plugins.
If you're using Chrome
Go to: Manage Jenkins → Manage Plugins → Advanced, then click Check now in the bottom right-hand corner. Then click a shield icon in the address bar, click Load anyway and Jenkins will start to update plugins. In Firefox this icon is situated on the left side of address bar, near back button.
You can install plugins manually, to this this, go to advanced tab in manage plugins, after downloading plugins you need, submit these
I had an issue with NginX proxy requests to Jenkins. I had error:
Nginx 413 Request Entity Too Large
I was able to fix that by adding
client_max_body_size 2M;
to the /etc/nginx/nginx.conf file. After that I went to Jenkins - Plugin Manager - Advanced tab and press Check Now button
I had the same issue and was able to resolve it by enabling the browser metadata download. Please follow the steps below the enable this configuration in Jenkins
Step 01: Select Manage Jenkins and click on Configure Global Security
Step 02: Under the Plugin Manager section tick the "Use browser for metadata download"
Step 03: View Available tab under the Plugin Manager section in Manage Jenkins
If its a fresh installation not behind proxy please follow instruction under available "Use the search field above to search for available plugins".
After trying many things (including all the solutions posted here) and hours of searching... I've ended up with the upgrade of jenkins to version 1.638.
This helps to solve the frustrated problem with empty available plugins in older version of jenkins!
This answer is specific to Windows 10. If you use the installer that Jenkins now comes bundled as, Jenkins will get installed as a service. By default, the service runs under the Local System account. You have to change it to run under the Network Service account in order for Jenkins to be able to connect with the plugin update service. If you have Administrator privileges on the system then these steps should help:
Open Command Prompt.
Type in Services.msc and hit enter.
The Services window should be open now.
Locate the Jenkins instance in the list.
Right click on it and click Properties.
Go to the Log On tab (should be the second one).
There should be 2 radio buttons.
Local System Account (selected)
This Account (unselected)
Select This Account.
Type in Network Service in the text box.
Provide your windows password.
Hit Apply and OK.
Restart the Jenkins service.
Reload Jenkins in browser.
For added measures, you could also add a rule in Windows Firewall (or any other Firewall that you may be using) to allow outbound requests from Jenkins. Point to the jenkins.exe application that should be located in the installation directory of Jenkins for this rule.
For those like me who use Jenkins with Docker with a JDK8u60+ version, you need to remove the MD5 hash in JDK_HOME/jre/lib/security/java.security to make it works:
jdk.certpath.disabledAlgorithms=MD2, MD5, RSA keySize < 1024
To
jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
This should be a temporary workaround
You don't have internet connection on Jenkins Machine.please configure Internet or installed plugin in offline mode.
Go to Jenkins -Plugin Manager-Upload Plugin
My Environment
Windows 7 Enterprise
Jenkins 2.89.2
Direct access to Internet
I tried most of the suggestions provided here but nothing worked until I tried following
First: I needed to run as 'Administrator'
Second: It was using default user home dir at C:\users\yourusername\.jenkins.
What Worked:
I changed default dir above to a different folder by defining JENKINS_HOME environment variable and I was able to get new plugins.
I faced the same issue with the latest Jenkins version, and all solutions didn't work with me so I followed the command line approach to install any plugin
sudo java -jar jenkins-cli.jar -s http://localhost:8080/ -auth USERNAME:PASSWORD -webSocket install-plugin PLUGIN_NAME
You can download the Jenkins-cli.jar from the installed Jenkins page http://localhost:8080/cli
You can search for the plugin name from the Jenkins site
https://plugins.jenkins.io/
If you have the Jenkins CLI installed uou can run this command
directly via terminal
jenkins-plugin-cli --plugins PLUGIN_NAME
I hope this solution helps if others didn't work with you.
I too tried all above,but this worked wonders
steps:
Go to https://plugins.jenkins.io (official page to get all jenkins plugins you are looking to install on jenkins)
Search "github" ( as we need github plugin to install)
You will see the github plugin,check the plugin id...it displays as id:github....so "github" is the exact plugin id
Download the jenkins-cli.jar from http://localhost:8080/cli and copy under /opt/jenkins-cli.jar in jenkins server
On jenkins server ,run the command to install github plugin
java -jar jenkins-cli.jar -s "http://localhost:8080" -auth jenkins-username:jenkins-password install-plugin github
Restart server
Now u will see the github plugin installed under installed section
For those who used Docker with MacOS. When you use Docker, there is no need to configure proxy settings for Jenkins inside Jenkins application, but you can and should do it already when running the container. For the context, I use MacOS and I was working within enterprise domain that had proxy configured.
SOLUTION
Configure proxy settings for Docker. You can do that if you open Preferences in Docker Desktop. The left menu, "Resources"->"Proxies". There you need to add correct proxy settings and then click "Apply & restart"
Add proxy settings to container when running it by giving and env variables HTTP_PROXY and HTTPS_PROXY. Add following flags with correct values to your command:-e HTTP_PROXY=<your_http_proxy:port> -e HTTPS_PROXY=<your_http_proxy:port>. An example with my own proxy configuration:
docker run \
-p 8080:8080 \
-p 50000:50000 \
-e HTTP_PROXY=http://10.65.100.13:8080 \
-e HTTPS_PROXY=http://10.65.100.13:8080 \
-v jenkins_home:/var/jenkins_home \
jenkins/jenkins:lts-jdk11
UNDERLYING ISSUE
The issue was SSL certificates. Jenkins, when downloading plugins, was unable to reach the CA certificates while working inside the container that was no configured to work using proxy. This caused the download to fail. Even if I configured Jenkins proxy settings as suggested in previous answers, it was no good, because the container itself failed to communicate over proxy.
Reading the Docker documentation, I found out that Docker should access CA certs itself from keychain, but it does not add proxy settings automatically to containers. Configuration to the container has to be added manually. Doing so configures the whole container properly in terms of proxy and container is able to reach for CA certs. Once the container works via proxy as expected, Jenkins does not need additional configuration itself.

Unable to find plugins in list of available plugins in jenkins

I have installed Jenkins by deploying its WAR file to Tomcat. On typing
http://localhost:8080/jenkins
In browser, jenkins home page is opening which means jenkins is successfully installed. I configured system settings, gave jdk and maven path and save them. Then to install plugins, I clicked on Jenkins->Manage plugins and clicked on Available tab but could not find any plugins. I tried three solutions:
Configured proxy for Jenkins by going to Jenkins->Manage Plugins->Advanced(did not find plugins)
Restarted server, refreshed browser and went to Jenkins->Manage plugins->Available (still did not find any plugins). So, I read somewhere that we have update plugins forcefully if they are not updated automatically. So, went to Jenkins->Manage Plugins->Advanced and clicked the tab 'Check now' (Still did not find any plugins on clicking on Available tab).
Finally I read somewhere that if we add the pluginGroup 'org.jvnet.hudson.tools' to settings.xml file of maven, problem may be resolved. So, added the corresponding code to settings.xml:
Then I tried again but still could not find any plugins in
Jenkins->Manage plugins->Available
If any other solution is there which can resolve this problem please let me know.
Go to: Manage Jenkins → Manage Plugins → Advanced, then click Check now in the bottom right-hand corner. When you go back to Available tab all plugins should be listed.
At the plugins section of Jenkins open the "Advanced Settings" tab and paste the following URL into the Update Server URL field (at the bottom): https://updates.jenkins.io/update-center.json
For me the following worked:
Go to Manage Jenkins->Configure Global Security
Click the checkbox for "Use browser for metadata download"
I also have security disabled and prevent cross site forgery unchecked.
You can force update the plugin list by hand.
This worked for me:
wget -O default.js http://updates.jenkins-ci.org/update-center.json
sed '1d;$d' default.js > default.json
curl -X POST -H "Accept: application/json" -d #default.json http://localhost:8080/updateCenter/byId/default/postBack --verbose
(I created this in order to be able to deploy Jenkins and install plugins in batch)
The problem may be that your browser proxy settings are not configured properly.
Jenkins doesn't retrieve the plugin list directly from the update center, it tells your browser to retrieve it and post it back to Jenkins. So the HTTP proxy settings within Jenkins are ignored for this step.
So if you are using a browser that is configured to only work within your network, to connect to local servers such as a Jenkins instance, then you won't be able to update the plugin list.
(This just happened to me and took a frustrating hour to work out.)
This was so frustrating... Not because of difficulty but lack of clarity and good documentation, at least for the issues I encountered. I ended up having to set up the Manage Plugins -> Advanced -> HTTP Proxy Configuration in a very specific, picky way. If I didn't do exactly this, minus the last noted thing on the bottom, I could not get this working. Maybe it's my work's firewall, maybe it's jenkins, either way give this a shot if you haven't been able to successfully update your proxy settings. I used the Validate Proxy tool in the menu. I'll very briefly describe the infographic basics below
Don't add http:// or https:// to your Server field
Use your jenkins credentials for Username and Password, not your proxy credentials (if that's even applicable)
Add http:// to your Test URL if you're checking something like Google or Yahoo
Submit your changes
Then run check-now
(Optional?) Change Update site from HTTP to HTTPS
You should be able to now update your plugins fingers-crossed
Change the update site from
https://updates.jenkins.io/update-center.json
to
http://updates.jenkins-ci.org/update-center.json
I had this issue when using nginx as a secure reverse proxy. I needed to update the url from which to download the updates list, as suggested above, only with https to prevent mixed content errors in chrome.
The reason why I could not find a plugin that i searched for in Jenkins->Manage plugins->Available:
It had already been installed and it was in Jenkins->Manage plugins->Installed.
I came across this SO answer while I was experiencing the same issue. When I would click "Check Now" to force Jenkins to download the latest list, my browser would just hang. It wasn't until I tailed the Jenkins log that I found this here:
Mar 10, 2014 1:15:54 PM hudson.security.csrf.CrumbFilter doFilter
WARNING: No valid crumb was included in request for /administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/test. Returning 403.
Looks like the issue has to do with how I've put Jenkins behind a reverse proxy and enabled the option to prevent Cross Site Request Forgery. Once I disabled that, the "Check Now" completed within 30 seconds.
For me, the following works out. I experience this empty available list issue after a fresh install jenkins 1.638 on Ubuntu 1404 in virtual box. We're under an ISA proxy server.
Go to Jenkins->Manage Plugins->Advanced and setup the proxy as below:
Host: 192.168.x.x (your Proxy IP)
Port: 80 (Your proxy port)
Note that I find the format matters. I tried adding http:// it doesn't work. It has to be exactly like above.
Then hit the check now button in the bottom right as everyone else suggested. Then you get the list.
My solution is here
If you type in "http://updates.jenkins-ci.org/update-center.json" directory to brower's address bar, (in my case) it actually redirected to "http://ftp.tsukuba.wide.ad.jp/software/jenkins/updates/current/update-center.json."
It worked when I set "http://ftp.tsukuba.wide.ad.jp/software/jenkins/updates/current/update-center.json" to Jenkins' update site, and click "Save" & "Update."
Hope this helps.
Or your plugin can be already installed. Once it's installed it's not in the list of available plugins.
If you're using Chrome
Go to: Manage Jenkins → Manage Plugins → Advanced, then click Check now in the bottom right-hand corner. Then click a shield icon in the address bar, click Load anyway and Jenkins will start to update plugins. In Firefox this icon is situated on the left side of address bar, near back button.
You can install plugins manually, to this this, go to advanced tab in manage plugins, after downloading plugins you need, submit these
I had an issue with NginX proxy requests to Jenkins. I had error:
Nginx 413 Request Entity Too Large
I was able to fix that by adding
client_max_body_size 2M;
to the /etc/nginx/nginx.conf file. After that I went to Jenkins - Plugin Manager - Advanced tab and press Check Now button
I had the same issue and was able to resolve it by enabling the browser metadata download. Please follow the steps below the enable this configuration in Jenkins
Step 01: Select Manage Jenkins and click on Configure Global Security
Step 02: Under the Plugin Manager section tick the "Use browser for metadata download"
Step 03: View Available tab under the Plugin Manager section in Manage Jenkins
If its a fresh installation not behind proxy please follow instruction under available "Use the search field above to search for available plugins".
After trying many things (including all the solutions posted here) and hours of searching... I've ended up with the upgrade of jenkins to version 1.638.
This helps to solve the frustrated problem with empty available plugins in older version of jenkins!
This answer is specific to Windows 10. If you use the installer that Jenkins now comes bundled as, Jenkins will get installed as a service. By default, the service runs under the Local System account. You have to change it to run under the Network Service account in order for Jenkins to be able to connect with the plugin update service. If you have Administrator privileges on the system then these steps should help:
Open Command Prompt.
Type in Services.msc and hit enter.
The Services window should be open now.
Locate the Jenkins instance in the list.
Right click on it and click Properties.
Go to the Log On tab (should be the second one).
There should be 2 radio buttons.
Local System Account (selected)
This Account (unselected)
Select This Account.
Type in Network Service in the text box.
Provide your windows password.
Hit Apply and OK.
Restart the Jenkins service.
Reload Jenkins in browser.
For added measures, you could also add a rule in Windows Firewall (or any other Firewall that you may be using) to allow outbound requests from Jenkins. Point to the jenkins.exe application that should be located in the installation directory of Jenkins for this rule.
For those like me who use Jenkins with Docker with a JDK8u60+ version, you need to remove the MD5 hash in JDK_HOME/jre/lib/security/java.security to make it works:
jdk.certpath.disabledAlgorithms=MD2, MD5, RSA keySize < 1024
To
jdk.certpath.disabledAlgorithms=MD2, RSA keySize < 1024
This should be a temporary workaround
You don't have internet connection on Jenkins Machine.please configure Internet or installed plugin in offline mode.
Go to Jenkins -Plugin Manager-Upload Plugin
My Environment
Windows 7 Enterprise
Jenkins 2.89.2
Direct access to Internet
I tried most of the suggestions provided here but nothing worked until I tried following
First: I needed to run as 'Administrator'
Second: It was using default user home dir at C:\users\yourusername\.jenkins.
What Worked:
I changed default dir above to a different folder by defining JENKINS_HOME environment variable and I was able to get new plugins.
I faced the same issue with the latest Jenkins version, and all solutions didn't work with me so I followed the command line approach to install any plugin
sudo java -jar jenkins-cli.jar -s http://localhost:8080/ -auth USERNAME:PASSWORD -webSocket install-plugin PLUGIN_NAME
You can download the Jenkins-cli.jar from the installed Jenkins page http://localhost:8080/cli
You can search for the plugin name from the Jenkins site
https://plugins.jenkins.io/
If you have the Jenkins CLI installed uou can run this command
directly via terminal
jenkins-plugin-cli --plugins PLUGIN_NAME
I hope this solution helps if others didn't work with you.
I too tried all above,but this worked wonders
steps:
Go to https://plugins.jenkins.io (official page to get all jenkins plugins you are looking to install on jenkins)
Search "github" ( as we need github plugin to install)
You will see the github plugin,check the plugin id...it displays as id:github....so "github" is the exact plugin id
Download the jenkins-cli.jar from http://localhost:8080/cli and copy under /opt/jenkins-cli.jar in jenkins server
On jenkins server ,run the command to install github plugin
java -jar jenkins-cli.jar -s "http://localhost:8080" -auth jenkins-username:jenkins-password install-plugin github
Restart server
Now u will see the github plugin installed under installed section
For those who used Docker with MacOS. When you use Docker, there is no need to configure proxy settings for Jenkins inside Jenkins application, but you can and should do it already when running the container. For the context, I use MacOS and I was working within enterprise domain that had proxy configured.
SOLUTION
Configure proxy settings for Docker. You can do that if you open Preferences in Docker Desktop. The left menu, "Resources"->"Proxies". There you need to add correct proxy settings and then click "Apply & restart"
Add proxy settings to container when running it by giving and env variables HTTP_PROXY and HTTPS_PROXY. Add following flags with correct values to your command:-e HTTP_PROXY=<your_http_proxy:port> -e HTTPS_PROXY=<your_http_proxy:port>. An example with my own proxy configuration:
docker run \
-p 8080:8080 \
-p 50000:50000 \
-e HTTP_PROXY=http://10.65.100.13:8080 \
-e HTTPS_PROXY=http://10.65.100.13:8080 \
-v jenkins_home:/var/jenkins_home \
jenkins/jenkins:lts-jdk11
UNDERLYING ISSUE
The issue was SSL certificates. Jenkins, when downloading plugins, was unable to reach the CA certificates while working inside the container that was no configured to work using proxy. This caused the download to fail. Even if I configured Jenkins proxy settings as suggested in previous answers, it was no good, because the container itself failed to communicate over proxy.
Reading the Docker documentation, I found out that Docker should access CA certs itself from keychain, but it does not add proxy settings automatically to containers. Configuration to the container has to be added manually. Doing so configures the whole container properly in terms of proxy and container is able to reach for CA certs. Once the container works via proxy as expected, Jenkins does not need additional configuration itself.

What does "Jenkins URL" means in configuration settings?

On Jenkins configuration page in section "Jenkins URL" I've set this option to "http://name_of_my_machine.jenkins:8080/"
Usually I open jenkins by: "http://localhost:8080/"
But this new option did not work for me - Jenkins does not open. So what does it mean?
Jenkins can't determine its URL on its own. So when it needs to create full links that's where the URL is taken from. In general even if you specify the wrong URL it should not affect the way Jenkins works in any significant way. It certainly has no effect on the URL that you enter in your browser to connect to Jenkins server. You can either specify http://localhost:8080 (when connecting from your machine and assuming that you started Jenkins on port 8080) or http://<machine_hostname>:8080 when connecting from anywhere.
So no matter what you specify it has no effect on connecting to Jenkins, therefore http://name_of_my_machine.jenkins:8080/ won't work, as .jenkins is not part of the name (e.g. ping name_of_my_machine.jenkins won't find the host).
Whenever Jenkins needs to create a URL that points to itself, Jenkins picks it up from the "Jenkins URL" setting in the global configuration.
Jenkins could try to guess the URL by e.g. getting the hostname and combining that with the port it is running on. But sometimes the hostname is not the same as the DNS name. And what if you have placed a front-end or proxy before Jenkins that e.g. terminates SSL connections and you would really like people to use Jenkins at https://company.com/jenkins/. Jenkins running in port 8080 cannot know about the front-end. The only reliable way for Jenkins to get the URL to itself is for an administrator setting it in Jenkins configuration.
Jenkins needs to know it's own URL when it is creating links that point back to itself. It does this e.g. when it sends out emails containing direct links to build results. Also, if you have a JNLP type slave, the slave initiates the connection to the master and the master returns a message which contains a link back to Jenkins for downloading the slave agent software.
Do you mean the option in the E-mail configuration section? This is only to generate the links in emails Jenkins sends (see the help for the option -- click the symbol with the question mark). If after changing it you cannot access your server anymore, it must be something else.

Resources