8

When I had installed Jenkins on Amazon Linux AMI following steps mentioned in http://bhargavamin.com/how-to-do/install-jenkins-on-amazon-linux-aws/

After installation I was able to open Jenkins through browser but when I selected option "Install Plugins" it showed error as "Unable to connect to Jenkins Server."

So then how to troubleshoot this issue??

Community
  • 1
  • 1
Bhargav Amin
  • 1,157
  • 3
  • 11
  • 21

5 Answers5

16

The problem here is pretty simple, if you do curl http://127.0.0.1:8080 on your host machine, you should get a message stating:

Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:

Permission you need to have (but didn't): hudson.model.Hudson.Administer
-->

This means that jenkins has anonymous priviledges which is not allowing any connection.

To solve this issue, you will have to do two changes:

  1. Add Jenkins user to root group: sudo usermod -a -G root jenkins

  2. Make Jenkins listen to all external IPs by editing file /etc/sysconfig/jenkins and changing the JENKINS_LISTEN_ADDRESS="0.0.0.0"

Once this is done, restart the jenkins server and then try to install plugins for jenkins.

Pang
  • 9,564
  • 146
  • 81
  • 122
Bhargav Amin
  • 1,157
  • 3
  • 11
  • 21
4

I'm using this trick https://issues.jenkins-ci.org/browse/JENKINS-45388 and it works. What I did is add passwd: as prefix of file /var/lib/jenkins/secrets/initialAdminPassword and click retry button for several times and finally it works.

0

Updating java-1.7.0-openjdk to java-1.8.0-openjdk will do the trick and restart the jenkins service or else change the port number and try it.

0

I got the same error on my ubuntu VPC, here is how I solve Unable to connect to Jenkins issue.

In my VPC Nginx is installed. Nginx is listening on port 80 so you need to open the firewall to that port as well.

To open the firewall use the following command: sudo ufw allow 80.

And run this command sudo ufw status to verify the firewall is opened for port 80

After that, you can get the default web page for Nginx by using your_public_ip:80 and Jenkins by entering your_public_ip:8080.

Md Alamin
  • 1,084
  • 11
  • 19
-2

1.Click on retry 2.Fill admin user name, pwd ,mail, full name 3.If filled already use pwd given in initialAdminPassword folder 4.proceed