I am following the steps to install on Ubuntu but I get the same error each time.
Using apt-get:
# sudo apt-get -y install go-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
go-server is already the newest version (16.10.0-4131).
0 upgraded, 0 newly installed, 0 to remove and 31 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up go-server (16.10.0-4131) ...
[Fri Sep 30 17:22:58 UTC 2016] using default settings from /etc/default/go-server
Error starting Go Server.
dpkg: error processing package go-server (--configure):
subprocess installed post-installation script returned error exit status 255
Errors were encountered while processing:
go-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Using dpkg:
# dpkg -i /var/cache/apt/archives/go-server_16.10.0-4131_all.deb
(Reading database ... 56890 files and directories currently installed.)
Preparing to unpack .../go-server_16.10.0-4131_all.deb ...
Unpacking go-server (16.10.0-4131) over (16.10.0-4131) ...
Setting up go-server (16.10.0-4131) ...
[Fri Sep 30 17:26:22 UTC 2016] using default settings from /etc/default/go-server
Error starting Go Server.
dpkg: error processing package go-server (--install):
subprocess installed post-installation script returned error exit status 255
Processing triggers for systemd (229-4ubuntu8) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
go-server
openjdk version "9-internal"PRETTY_NAME="Ubuntu 16.04.1 LTS"Hosted at Digital Ocean
echo "deb https://download.go.cd /" | sudo tee /etc/apt/sources.list.d/gocd.list
curl "https://download.go.cd/GOCD-GPG-KEY.asc" | sudo apt-key add -
sudo apt-get -y update
sudo apt-get -y install go-server
Turns out the Java 9 install was breaking it.
Steps to fix:
apt-get -y install openjdk-8-jdk
update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
I found that you need to do this on the agent servers as well otherwise they won't show up in the server console. If you run Java 9 on the agent, no errors will show up in the logs. It even suggests that the connection is made with the server, however, the agent won't show up on the console nor are there any errors in the server logs.
For posterity, this "error 255" means go-server failed to start. I ran dpkg with --debug=33 to get more output, then looked in /var/logs/go-server/go-server.log. In my case, it ws this:
2016-12-29 16:51:15,161 ERROR [main] GoServer:76 - ERROR: Failed to start Go server.
java.lang.RuntimeException: java.lang.RuntimeException: Failed to create plugins folder in location /var/lib/go-server/plugins/bundled
I'm sure there are other causes- just wanted to post for later googlers.
Most helpful comment
Turns out the Java 9 install was breaking it.
Steps to fix: