pvpkiran
pvpkiran

Reputation: 27018

Cannot start jenkins-lts on mac using homebrew

I am trying to install/run jenkins on a mac machine using homebrew. This is what I did

  1. brew install jenkins-lts
    On running this command. I see that jenkins-lts is installed and I see this message

    Note: When using launchctl the port will be 8080.
    To have launchd start jenkins-lts now and restart at login:
    brew services start jenkins-lts.
    Or, if you don't want/need a background service you can just run:
    jenkins-lts

  2. If I run jenkins-lts, Jenkins starts at port 8080 successfully. I can reach it from the browser.

  3. If I run brew services start jenkins-lts . I see the message Successfully started jenkins-lts (label:homebrew.mxcl.jenkins-lts)

    But I cannot reach the server on port 8080. I tried checking the status of the service

  4. I tried checking the status of the service brew services list

     Name        Status  User     Plist  
    jenkins-lts unknown ec2-user /Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist
    

I see that status is unknown.

  1. After a while I see that this service is not listed anymore in the brew services list command. If I try to start it again. I see this message

    /Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist: service already loaded Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/ec2-user/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist exited with 37

Where can I find the jenkins logs and how to get it working.

Upvotes: 7

Views: 11732

Answers (5)

user119914
user119914

Reputation: 1

We had the same issues on MacBooks and this is what fixed it.

run this:

    chmod u+w /usr/local/var/log

and then run this:

    sudu chown -R $(whoami) /usr/local/var/log

then:

    brew install jenkins-lts

and it worked

Upvotes: 0

Alferd Nobel
Alferd Nobel

Reputation: 3949

This is my experience , brew services list showed up as :

Name        Status  User    Plist
jenkins-lts error   cskjk16 /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.@CD6R ~

and the fix was:

1. brew services stop jenkins-lts

2. brew services start jenkins-lts 

and now brew services list showed up as :

Name        Status  User    Plist
jenkins-lts started cskjk16 /usr/local/opt/jenkins-lts/homebrew.mxcl.jenkins-lts.@CD6R ~

Upvotes: 6

rio
rio

Reputation: 763

likely you have not configured you host setings so after starting the service use http://127.0.0.1:8080/ not http://localhost:8080/

enter image description here

Upvotes: 5

pvpkiran
pvpkiran

Reputation: 27018

The issue here is that, macos was running as a dedicated host on AWS.

I was connected to this macos from my windows machine using putty and trying to run the command.

brew services start jenkins-lts

This does not work. I had to login to macos via some Remote Desktop client like VNC and then run the same command from the the terminal window of mac.
In some cases, there will be a pop up which you needs user input. Hence this did not work when I was connected via putty from my windows machine.

Upvotes: 0

A O
A O

Reputation: 1

My solution was to uninstall Jenkins using brew (brew uninstall jenkins-lts), followed by brew doctor, followed by brew clanup, and re-install jenkins (brew install jenkins-lts).

After, I was able to start Jenkins using brew services start jenkins-lts. Your password will be available at $ cat /User/..../.jenkins/secrets/initialAdminPassword. Use it to create the admin account and continue the configuration.

Upvotes: 0

Related Questions