cdddd64a42
Log the failure error when the agent fails to start. Previously, the agent startup failure error would be emitted to the command UI but not logged. So it doesn't get emitted to syslog or `log_file` if they are set, and it makes debugging much harder. Also, logging the error again before exit makes the error more visible: previously, the operator needed to scroll to the top to find the error. On a sample failure, the output will look like: ``` ==> WARNING: Bootstrap mode enabled! Potentially unsafe operation. ==> Loaded configuration from sample-configs/config-bad ==> Starting Nomad agent... ==> Error starting agent: setting up server node ID failed: mkdir /path-without-permission: read-only file system 2021-10-20T14:38:51.179-0400 [WARN] agent.plugin_loader: skipping external plugins since plugin_dir doesn't exist: plugin_dir=/path-without-permission/plugins 2021-10-20T14:38:51.181-0400 [DEBUG] agent.plugin_loader.docker: using client connection initialized from environment: plugin_dir=/path-without-permission/plugins 2021-10-20T14:38:51.181-0400 [DEBUG] agent.plugin_loader.docker: using client connection initialized from environment: plugin_dir=/path-without-permission/plugins 2021-10-20T14:38:51.181-0400 [INFO] agent: detected plugin: name=java type=driver plugin_version=0.1.0 2021-10-20T14:38:51.181-0400 [INFO] agent: detected plugin: name=docker type=driver plugin_version=0.1.0 2021-10-20T14:38:51.181-0400 [INFO] agent: detected plugin: name=mock_driver type=driver plugin_version=0.1.0 2021-10-20T14:38:51.181-0400 [INFO] agent: detected plugin: name=raw_exec type=driver plugin_version=0.1.0 2021-10-20T14:38:51.181-0400 [INFO] agent: detected plugin: name=exec type=driver plugin_version=0.1.0 2021-10-20T14:38:51.181-0400 [INFO] agent: detected plugin: name=qemu type=driver plugin_version=0.1.0 2021-10-20T14:38:51.181-0400 [ERROR] agent: error starting agent: error="setting up server node ID failed: mkdir /path-without-permission: read-only file system" ``` This change adds the final `ERROR` message. It's easy to miss the `==> Error starting agent` above. |
||
---|---|---|
.. | ||
consul | ||
event | ||
host | ||
monitor | ||
pprof | ||
test-resources | ||
testdata | ||
acl_endpoint.go | ||
acl_endpoint_test.go | ||
agent.go | ||
agent_endpoint.go | ||
agent_endpoint_test.go | ||
agent_oss.go | ||
agent_test.go | ||
alloc_endpoint.go | ||
alloc_endpoint_test.go | ||
bindata_assetfs.go | ||
command.go | ||
command_test.go | ||
config.go | ||
config_oss.go | ||
config_parse.go | ||
config_parse_test.go | ||
config_test.go | ||
csi_endpoint.go | ||
csi_endpoint_test.go | ||
deployment_endpoint.go | ||
deployment_endpoint_test.go | ||
eval_endpoint.go | ||
eval_endpoint_test.go | ||
event_endpoint.go | ||
event_endpoint_test.go | ||
fs_endpoint.go | ||
fs_endpoint_test.go | ||
helpers.go | ||
helpers_test.go | ||
http.go | ||
http_oss.go | ||
http_stdlog.go | ||
http_stdlog_test.go | ||
http_test.go | ||
job_endpoint.go | ||
job_endpoint_test.go | ||
keyring.go | ||
keyring_test.go | ||
log_file.go | ||
log_file_bsd.go | ||
log_file_linux.go | ||
log_file_test.go | ||
log_file_windows.go | ||
log_levels.go | ||
log_levels_test.go | ||
metrics_endpoint.go | ||
metrics_endpoint_test.go | ||
namespace_endpoint.go | ||
namespace_endpoint_test.go | ||
node_endpoint.go | ||
node_endpoint_test.go | ||
operator_endpoint.go | ||
operator_endpoint_oss.go | ||
operator_endpoint_test.go | ||
plugins.go | ||
region_endpoint.go | ||
region_endpoint_test.go | ||
retry_join.go | ||
retry_join_test.go | ||
scaling_endpoint.go | ||
scaling_endpoint_test.go | ||
search_endpoint.go | ||
search_endpoint_test.go | ||
stats_endpoint.go | ||
stats_endpoint_test.go | ||
status_endpoint.go | ||
status_endpoint_test.go | ||
stub_asset.go | ||
syslog.go | ||
syslog_test.go | ||
system_endpoint.go | ||
system_endpoint_test.go | ||
testagent.go | ||
testagent_oss.go | ||
testingutils_test.go |