Issue
-
After disabling Elasticsearch following the steps given in Disable Elasticsearch and the Analytics stack in CJE,
worker-*
operations and / orcje upgrade
fails when updating Servers information with the following log:
[cjoc] Rendering /bastion-host/.dna/servers/tiger/config/jce-castle-config.xml => /bastion-host/.dna/servers/tiger/jce-castle-config.rendered.xml [cjoc] 01:49:36 Waiting for CJOC at https://your_cluster_url/cjoc/ [cjoc] 01:49:38 OK [cjoc] CJOC Login successful. [cjoc] Updating Servers info [cjoc] curl: (22) The requested URL returned error: 404 Not Found [cjoc] 01:49:39 Failure (22) Retrying in 5 seconds... [cjoc] curl: (22) The requested URL returned error: 404 Not Found [cjoc] 01:49:44 Failure (22) Retrying in 5 seconds... [cjoc] curl: (22) The requested URL returned error: 404 Not Found [cjoc] 01:49:49 Failure (22) Retrying in 5 seconds... [cjoc] curl: (22) The requested URL returned error: 404 Not Found [cjoc] 01:49:54 Failure (22) Retrying in 5 seconds... [cjoc] curl: (22) The requested URL returned error: 404 Not Found [cjoc] 01:50:00 Failure (22) Retrying in 5 seconds... [cjoc] 01:50:05 Failed in the last attempt [cjoc] There were one or more errors
Environment
-
CloudBees Jenkins Enterprise (CJE) between 1.11.7 and 1.11.16
Explanation
This happens because to complete the Elasticsearch disabling procedure, we need to disable the CloudBees Operations Center Analytics related plugins. Nevertheless, certain operations like worker-*
and upgrade
update servers information in CJOC by reaching out to the endpoint served by some of those plugins. Since plugins are disabled, the endpoint are not reachable and the operation fails.
Resolution
This should be skipped when Elasticsearch is disabled. This is a known issue CPLT2-5259. that has been fixed in CloudBees Jenkins Enterprise 1.11.16.
The solution is to upgrade CloudBees Jenkins Enterprise to version 1.11.16 or later.
Workaround
The workaround is to edit the file $CJE_CLI_HOME/share/setup-templates/core/templates/tiger/set-pse-config-info
in the CJE CLI directory and comment the line(s) that do the cjoc-set-pse-config-info-element
as following:
#!/bin/bash -eu {% include "cjoc-support" %} {% include "jce-system-support" %} {% render "config/jce-castle-config.xml" => "jce-castle-config.rendered.xml" %} set -o pipefail get-pse-servers-info() { dna run pse-info tiger } cjoc-waitfor cjoc-init-security #echo Updating Servers info #cjoc-set-pse-config-info-element "servers" "$(get-pse-servers-info)" #echo Updating Castle info #cjoc-set-pse-config-info-element "castle" "$(cat jce-castle-config.rendered.xml)"
Then restart the operations.
Tested product/plugin versions
-
CloudBees Jenkins Enterprise versions higher than 1.11.7 until 1.11.14