Jenkins - Plugin Manager Configuration - jenkins

I'm new to Jenkins and I'm not sure about what info should in --> Server "[ ]"
Should i paste the Jenkins url ?, my computer ip ?, ipv4, ipv6?
I'm getting an error probably because that configuration is not ok.
I try to paste url Jenkins localhost info but I'm getting error.

I presume you mean on /pluginManager/advanced, "Manage Jenkins > Manage Plugins > Advanced. HTTP Proxy Configuration | Server".
If you can click on "Check Now" on the Plugins page it it updates the plugins list, then you don't need to do anything.
Assuming you are behind a firewall, enter a Proxy Configuration (1) value. It can be an IP address, a hostname or a PAC file. Port is necessary, other fields optional as needed.
]
After adding a value, click on the "Advanced" button; there is a Validate Proxy option. Make sure the "Server" value omits the "http://", but the "Test URL" includes the full url (it can be any external url you choose; eg: https://google.com or https://github.com).
The Server (?) help option also notes:
If your Jenkins server sits behind a firewall and does not have the
direct access to the internet, and if your server JVM is not
configured appropriately (See JDK networking properties for more
details) to enable internet connection, you can specify the HTTP proxy
server name in this field to allow Jenkins to install plugins on
behalf of you. Note that Jenkins uses HTTPS to communicate with the
update center to download plugins.
Leaving this field empty means
Jenkins will try to connect to the internet directly.
If you are unsure about the value, check the browser proxy
configuration.
Note: There is a field under the configure "Manage Jenkins > Configure System" page for:
Jenkins Location
Jenkins URL "[ ]"
That would be your localhost name / IP if necessary
This value is used to let Jenkins know how to refer to itsel
(1) No idea why this wiki page was not migrated to the new wiki.

Related

how to configure 'send email' in jenkins by proxy

My Jenkins machine cannot connect to the internet. I want to configure Jenkins to work with a proxy server to send email. The startup parameter is:
-Dhttp.proxyHost=172.16.0.10 -Dhttp.proxyPort=3128
But it doesn't work.
Jenkins proxy settings are configured on the Manage Jenkins > Manage Plugins > Advanced tab.
If you can't get to that page in your Jenkins instance you will need to ask the person with Admin access to that Jenkins instance.
I configured the proxy by appending the below string in 'JAVA_ARGS' setting in '/etc/default/jenkins' and restart the Jenkins server.
-Dhttp.proxyHost=172.16.0.10 -Dhttp.proxyPort=3128-Dhttps.proxyHost=172.16.0.10 -Dhttps.proxyPort=3128
You can configure the proxy properties on Manage Jenkins > System configurations. In this page you can find "Global Properties" configuration and in this part you have to push the "add" button and put there the HTTP_PROXY, HTTPS_PROXY and NO_PROXY properties. These proxy properties should contain the proxy configuration like in the operating system. You can see an example of this configuration in the next image:
You should replace the properties:
<$PROTOCOL> -> Proxy address protocol (http, https, ...)
<$USER> -> Proxy user authorization (If the proxy require it)
<$PASS> -> Proxy password (If the proxy require it)
<$PROXY_DNS> -> Proxy URL or Proxy IP
<$PORT> -> Proxy port
<$DNS1>,<$DNS2>,... -> URL where the proxy don't should be used

Why does Jenkins keep telling me it is offline?

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

Jenkins not accessible with http://<hostname>:8080 in Windows server 2012

I have installed Jenkins in Windows server 2012 64-bit machine and want to make it available in internal network.
I have added --httpListenAddress to 0.0.0.0 and restarted Jenkins and tried to access it with http://hostname:8080 but no page shows up(though It showing Jenkins icon in URL bar). However http://localhost:8080 works fine.
Further I checked the firewall inbound rule for the Jenkins but seems it has no issues.
I tried to catch the listening ports with "netstat -aon | find /i "8080" and found <host ip address>:8080 FIN_WAIT_2 which sign towards that the request is stuck(May be I am wrong).
I am clueless what exactly is blocking to use hostname with jenkins. Please share your solution if you already fixed this issue.
You might try adding a Windows Firewall rule. Go to Windows Firewall, Advanced Configuration, Inbound Rules rule and create an Allow rule for the specific version of java.exe you have installed.
This worked for us with the drawback that every time you upgrade Java, you must also modify the firewall rule. This is because Java creates a new subfolder for every version. We've tried using %JAVA_HOME% in firewall rules but it doesn't seem to work. We were on Windows Server 2012R2 at the time.
Similar answer here: https://stackoverflow.com/a/17479566/7752
On the server open a new command prompt and type
ipconfig
You should get a list of ips. Open a browser and type each up followed by 8080 for e.g.
http://202.123.2.1:8080
If Jenkins opens up, from another computer ping the ip and see if you can get a ping reply
ping 202.123.2.1
If you get a ping reply, you can access jenkins from any pc on the network by typing in the ip and port number.
Now to get to the hostname,you need to edit your host file
c:\Windows\System32\Drivers\etc\hosts
Type in the ip followed by the hostname
202.123.2.1 jenkins
If you can't get through, you need to open port 8080. See https://www.vultr.com/docs/how-to-open-a-port-in-windows-firewall-on-windows-server-2012
You cannot access from outside the machine because Jenkins Service does not have credentials to use that machine, only from localhost is accessible.
This is how to enter the credentials in Jenkins service.
In the Windows search bar, type services then enter.
Then scroll down to Jenkins and double-click on it.
In Jenkins Properties, select the tab "Log On".
Select Check box "This account"
Update your username and password.
Voila! Now Jenkins web can connect to the Jenkins machine via Jenkins service.

There is no "Launch agent via Java Web Start" option in my jenkins when I adding a windows slave node

I have already configured the java enviroment and installtion
path
This is a duplicate question from Server Fault: Answer Here
Java Web Start utilizes TCP so it has to be enabled and configured in Jenkins...
Login to Jenkins as admin
Manage Jenkins > Configure Global Security > TCP port for JNLP agents
Do yourself a favor and pick a static port assignment...
As of Jenkins version 2.176.3, there is option enabled when "Launch agent by connecting it to the master" which is same as "launch agent via java web start" once you enable the "Manage Jenkins => Configure Global Security => Agents => TCP port for inbound agents" as mentioned above.
e.g. Fixed: 50000
Make sure that you've enabled a JNLP port in Manager Jenkins -> Configure Global Security. If no JNLP port is specified, then the JNLP slave option will not appear.
I had similar issue after updating my Jenkins, I then used "Launch agent by connecting it to the master" method to launch and my port "TCP port for inbound agents" under
- Manage Jenkins => Configure Global Security => Agents => TCP port for inbound agents got changed to 8888. I have updated it back to 50000 and that resolved the issue. Hope it helps.
On some systems I used to get a button to download the agent's JNLP. On my new linux mint system, I instead get the "JNLP not available" message. So was lost as to where to get the JNLP file. However, looking in the command below I saw the URL for downloading it, eg:
http://127.0.0.1:8080/computer/build_slave/jenkins-agent.jnlp
Go to the slave machine, paste the URL in the browser to download it!
This might also be due to missing permissions for the user trying to setup the agent via java web start, at least that was the case in my scenario;
To verify this, try to download the jnlp directly; URL would be of the form [jenkins url]/computer/[agent name]/slave-agent.jnlp, if there is a permissions issue you will get something along the lines of:
Access Denied
xxxx is missing the Agent/Connect permission

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