Operators can trigger the execution of an errand at any time after the deploy and receive back the script's stdout, stderr and exit code upon its completion. This issue has been seen when an operator uses custom pipelines definitions to run errands in their deployments (VMware Tanzu Application Service for VMs, VMware Tanzu Gemfire, etc..).
Errands are run using the deployment's clock_global VMs. However, if more than one clock_global VM is available in the deployment, a race condition can occur if both VM's try to upload bits to the Blobstore at the same time during the push-apps errand. This will cause the errand to fail.
The error message depends on the errand that you run. This article will use the metric_registrar_smoke_test errand as an example. Below are some of the error messages reported on Concourse for VMware Tanzu:
FAILED Creating user provided service metric-registrar-smoke-test-structured in org system / space metric-registrar-monitor as metric_registrar_smoke_test... FAILED Server error, status code: 400, error code: 60002, message: The service instance name is taken: metric-registrar-smoke-test-structured Stderr + export PATH=/var/vcap/packages/cf-cli-6-linux/bin:/var/vcap/jobs/metric_registrar_smoke_test/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:. + PATH=/var/vcap/packages/cf-cli-6-linux/bin:/var/vcap/jobs/metric_registrar_smoke_test/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:. + echo '**************************** SETTING UP SESSION ****************************' + /var/vcap/jobs/metric_registrar_smoke_test/bin/setup_session.sh + cf -v + cf api https://XXXXXXXXXX + cf logout + cf auth metric_registrar_smoke_test XXXXXXXXXX --client-credentials + cf create-org system Org system already exists. + cf create-space metric-registrar-monitor -o system Space metric-registrar-monitor already exists + cf target -o system -s metric-registrar-monitor + echo '**************************** DEPLOYING MONITORING APP **********************' + /var/vcap/jobs/metric_registrar_smoke_test/bin/deploy.sh + pushd /var/vcap/packages/smoke_test/bin + delete-service metric-registrar-smoke-test-structured + cf service metric-registrar-smoke-test-structured Service instance metric-registrar-smoke-test-structured not found + cf create-user-provided-service metric-registrar-smoke-test-structured -l structured-format://DogStatsD Error: failed to run job-process: exit status 1 (exit status 1) 2 errand(s) Errand 'metric_registrar_smoke_test' completed with error (exit code 1) Exit code 1
bosh -d <affected deployment name> vms
$ bosh -d <deployment name> run-errand <name of the errand> --instances clock_global/0 or $ bosh -d <deployment name> run-errand <name of the errand> --instances clock_global/first or $ bosh -d <deployment name> run-errand <name of the errand> --instances <clock global instance name>
$ bosh -d <affected deployment name> vms
$ bosh -d <affected deployment> ssh <clock global instance name>
# cd /var/vcap/jobs
# cd /var/vcap/jobs/<errand name>/bin
# ./run
$ bosh -d <deployment name> run-errand <name of the errand> --instances clock_global/0 or $ bosh -d <deployment name> run-errand <name of the errand> --instances clock_global/first or $ bosh -d <deployment name> run-errand <name of the errand> --instances <clock global instance name>