Cannot start jenkins service after updating from 2.387.1 to 2.426.3 (in Mac OS)

Jenkins setup:
Mac OS ventura 13.6.1
jenkins version 2.426.3
homebrew version : 4.3.0
java : openJDK 17.0.11 zulu

hi~,
It is exactly what is written in the title.
I updated Jenkins version from 2.387.1 to 2.426.3,
Originally, when starting/stopping the Jenkins service, the following command was used.
“brew services start/stop jenkins-lts”

However, after updating the version,
It looks like it’s starting, but
If you check with the “brew services list” command, you can see the status of the Jenkins service.
The status is error 256.
image

The strange thing is,
When I manually open a terminal window and run the following, Jenkins start normally.

java -Dmail.smtp.starttls.enable=true -jar /usr/local/opt/jenkins-lts/libexec/jenkins.war --httpListenAddress=0.0.0.0 --httpPort=8080

However, if I start with brew services start jenkins-lts, error 256 is displayed as above.

so, yes, I can start Jenkins manually, but even when the PC is rebooted,
There is the inconvenience of having to start it manually.

One more thing to add, although I updated the version,
/usr/local/Cellar/jenkins-lts still contains a folder named 2.387.1.

Has anyone solved this problem?

Hi, a colleague is running into this issue. Out of curiosity, do you have an intel mac? And have you solved this yet?

no, I couldn’t resolve this problem…I’m using Apple Mac(M1)

I resolved finally.

Actually, I don’t know exactly what happened.
It happened after trying several things.
Anyway, I’ll share the current working status.

  1. rm -rf /Users/XXX/Library/LaunchAgents/homebrew.mxcl.jenkins-lts.plist ,
    The .plist file here will be automatically created later when you run ‘brew services start jenkins-lts’

  2. (The version name at the end will be different for each person.)
    Check files “jenkins-lts” and “jeknins-lts-cli” of /usr/local/Cellar/jenkins-lts/2.452.3/bin , Check the path to JAVA_HOME in these files.

  3. and see a following path, /usr/local/Cellar/jenkins-lts/2.452.3
    Modify the following two files in this path as follows:

  1. homebrew.jenkins-lts.service
[Unit]
Description=Homebrew generated unit for jenkins-lts

[Install]
WantedBy=default.target

[Service]
Type=simple
ExecStart=/usr/local/opt/openjdk@21/bin/java -Dmail.smtp.starttls.enable\=true -jar /usr/local/opt/jenkins-lts/libexec/jenkins.war --httpListenAddress\=0.0.0.0 --httpPort\=8080
  1. homebrew.mxcl.jenkins-lts.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>homebrew.mxcl.jenkins-lts</string>
	<key>LimitLoadToSessionType</key>
	<array>
		<string>Aqua</string>
		<string>Background</string>
		<string>LoginWindow</string>
		<string>StandardIO</string>
		<string>System</string>
	</array>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/opt/openjdk@21/bin/java</string>
		<string>-Dmail.smtp.starttls.enable=true</string>
		<string>-jar</string>
		<string>/usr/local/opt/jenkins-lts/libexec/jenkins.war</string>
		<string>--httpListenAddress=0.0.0.0</string>
		<string>--httpPort=8080</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>

  1. Anyway, the important thing is to match the JAVA_HOME path with the paths in the homebrew.jenkins-lts.service and homebrew.mxcl.jenkins-lts.plist files.
    Also, check carefully whether the version set as the JAVA_HOME path in the jenkins-lts file (in my case, openjdk 21) is actually installed.

good luck guys.