Issue
I installed jenkins on my Ubuntu server. It says its running but I can't connect with the browser from my local computer and I don't have access to the server's desktop to check if I can connect from localhost.
Additional information:
sudo systemctl status jenkins.service
Returns:
● jenkins.service - LSB: Start Jenkins at boot time Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled) Active: active (exited) since Thu 2018-09-13 14:46:08 -03; 1h 11min ago Docs: man:systemd-sysv-generator(8) Process: 29259 ExecStop=/etc/init.d/jenkins stop (code=exited, status=0/SUCCESS) Process: 29308 ExecStart=/etc/init.d/jenkins start (code=exited, status=0/SUCCESS) Tasks: 0 Memory: 0B CPU: 0
Sep 13 14:46:07 vp-smg2-lnx0010 systemd[1]: Starting LSB: Start Jenkins at boot time...
Sep 13 14:46:07 vp-smg2-lnx0010 jenkins[29308]: Correct java version found
Sep 13 14:46:07 vp-smg2-lnx0010 jenkins[29308]: * Starting Jenkins Automation Server jenkins
Sep 13 14:46:07 vp-smg2-lnx0010 su[29341]: Successful su for jenkins by root
Sep 13 14:46:07 vp-smg2-lnx0010 su[29341]: + ??? root:jenkins
Sep 13 14:46:07 vp-smg2-lnx0010 su[29341]: pam_unix(su:session): session opened for user jenkins by (uid=0)
Sep 13 14:46:08 vp-smg2-lnx0010 jenkins[29308]: ...done.
Sep 13 14:46:08 vp-smg2-lnx0010 systemd[1]: Started LSB: Start Jenkins at boot time.
netstat -ntulp | grep 8090
Returns:
tcp6 0 0 :::8090 :::* LISTEN -
tail /var/log/jenkins/jenkins.log
Returns (last lines):
Sep 13, 2018 2:46:24 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@5220af81: display name [Root WebApplicationContext]; startup date [Thu Sep 13 14:46:24 BRT 2018]; root of context hierarchy Sep 13, 2018 2:46:24 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@5220af81]: org.springframework.beans.factory.support.DefaultListableBeanFactory@1dccc1f3 Sep 13, 2018 2:46:24 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1dccc1f3: defining beans [filter,legacy]; root of factory hierarchy Sep 13, 2018 2:46:24 PM jenkins.InitReactorRunner$1 onAttained INFO: Completed initialization Sep 13, 2018 2:46:24 PM hudson.WebAppMain$3 run INFO: Jenkins is fully up and running
journalctl -xe
Returns:
` -- Unit UNIT has finished starting up.
-- The start-up result is done. Sep 13 14:46:07 vp-smg2-lnx0010 systemd[29342]: Reached target Default. -- Subject: Unit UNIT has finished start-up -- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit UNIT has finished starting up.
-- The start-up result is done. Sep 13 14:46:07 vp-smg2-lnx0010 systemd[29342]: Startup finished in 38ms. -- Subject: System start-up is now complete -- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- All system services necessary queued for starting at boot have been -- successfully started. Note that this does not mean that the machine is
-- now idle as services might still be busy with completing start-up.
-- Kernel start-up required KERNEL_USEC microseconds.
-- Initial RAM disk start-up required INITRD_USEC microseconds.
-- Userspace start-up required 38392 microseconds. Sep 13 14:46:07 vp-smg2-lnx0010 systemd[1]: Started User Manager for UID 116. -- Subject: Unit [email protected] has finished start-up -- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit [email protected] has finished starting up.
-- The start-up result is done. Sep 13 14:46:07 vp-smg2-lnx0010 su[29341]: pam_unix(su:session): session closed for user jenkins Sep 13 14:46:08 vp-smg2-lnx0010 jenkins[29308]: ...done. Sep 13 14:46:08 vp-smg2-lnx0010 systemd[1]: Started LSB: Start Jenkins at boot time. -- Subject: Unit jenkins.service has finished start-up -- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Unit jenkins.service has finished starting up.
-- The start-up result is done. Sep 13 14:46:08 vp-smg2-lnx0010 sudo[29305]: pam_unix(sudo:session): session closed for user root Sep 13 14:46:12 vp-smg2-lnx0010 sudo[29373]: administrador : TTY=pts/0 ; PWD=/var/log/jenkins ; USER=root ; COMMAND=/bin/systemctl status jenkins.service `
I'm setting jenkins to run on port 8090, and my ufw status is:
To Action From
-- ------ ----
8081 ALLOW Anywhere
8090 ALLOW Anywhere
22 ALLOW Anywhere
80 ALLOW Anywhere
8080 ALLOW Anywhere
8081 (v6) ALLOW Anywhere (v6)
8090 (v6) ALLOW Anywhere (v6)
22 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)
curl -i localhost:8090
Returns:
X-Content-Type-Options: nosniff
Set-Cookie:
JSESSIONID.a54dcd68=node018je3pqsr2xyroubaw1ypmg4e2.node0;Path=/;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: text/html;charset=utf-8
X-Hudson: 1.395
X-Jenkins: 2.138.1
X-Jenkins-Session: 79f324ac
X-You-Are-Authenticated-As: anonymous
X-You-Are-In-Group-Disabled: JENKINS-39402: use -
Dhudson.security.AccessDeniedException2.REPORT_GROUP_HEADERS=true or use
/whoAmI
to diagnose
X-Required-Permission: hudson.model.Hudson.Administer
Content-Length: 677
Server: Jetty(9.4.z-SNAPSHOT)
<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F'/>
<script>window.location.replace('/login?from=%2F');</script></head><body
style='background-color:white; color:white;'>
Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
Permission you need to have (but didn't): hudson.model.Hudson.Administer
-->
</body></html>
I have other browser applications on the same server running on port 80 and 8080 and I can access them normally. I've tried to access it from ip-address:8090 and ip-address:8090/jenkins and both failed with ERR_CONNECTION_TIMED_OUT time out error. What could be the problem?
Solution
The problem was solved. It turned out that I didn't have port 8080 open on that server, so I asked the company to open it and it worked.
Answered By - LFN Answer Checked By - Willingham (WPSolving Volunteer)