Internal/External
Internal if an IOHK staff member.
Area
Other Any other topic (Delegation, Ranking, ...).
Summary
On SIGHUP, the node reloads its RPC configuration from the node config file.
This reload always fails with:
Error while updating RPC configuration: Missing YAML config file
logged at Error severity. The reload is non-fatal (it is silently skipped),
but every SIGHUP now emits a spurious Error-level trace.
This applies to the new tracing system.
Steps to reproduce
Steps to reproduce the behavior:
- Start a node (new tracing enabled).
- Send
SIGHUP to the node process: kill -HUP <pid>.
- Observe the node log.
Observed log line:
[<host>:Startup.RpcConfigUpdateError](Error,166) Error while updating RPC configuration: Missing YAML config file
Expected behavior
A SIGHUP RPC config reload from an otherwise valid config file should succeed
(or, if RPC is disabled, be a no-op) and not emit an Error-level trace.
System info (please complete the following information):
- OS Name: Fedora 43
- Node version: 11.0.1
Additional context
The SIGHUP handler calls updateRpcConfiguration, passing the node config
file path (ncConfigFile nc):
cardano-node/src/Cardano/Node/Run.hs
updateRpcConfiguration startupTracer (ncConfigFile nc) rpcConfigVar
updateRpcConfiguration re-parses the file and runs the full
makeNodeConfiguration validation:
cardano-node/src/Cardano/Node/Run.hs
updateRpcConfiguration tracer configFilePath rpcConfigVar = do
result <- fmap (join . first Exception.displayException)
. try @Exception.SomeException
. fmap makeNodeConfiguration
. parseNodeConfigurationFP
$ Just configFilePath
case result of
Left err ->
-- reload failure, we don't do anything this time
traceWith tracer (RpcConfigUpdateError $ pack err)
...
parseNodeConfigurationFP only decodes the file contents:
cardano-node/src/Cardano/Node/Configuration/POM.hs
parseNodeConfigurationFP (Just (ConfigYamlFilePath fp)) = do
nc <- decodeFileThrow fp
-- Make all the files be relative to the location of the config file.
pure $ adjustFilePaths (takeDirectory fp </>) nc
The FromJSON PartialNodeConfiguration instance never reads pncConfigFile —
the config file path is normally injected from the --config CLI argument
by the option parser, not stored inside the file. So after decoding,
pncConfigFile == mempty.
makeNodeConfiguration then requires pncConfigFile and fails:
cardano-node/src/Cardano/Node/Configuration/POM.hs
makeNodeConfiguration pnc = do
configFile <- lastToEither "Missing YAML config file" $ pncConfigFile pnc
...
→ Left "Missing YAML config file" → traced as RpcConfigUpdateError at
severity Error.
Because the config file path is structurally never present in the parsed file,
this validation can never pass on the reload path — the failure is
deterministic for any node.
Internal/External
Internal if an IOHK staff member.
Area
Other Any other topic (Delegation, Ranking, ...).
Summary
On
SIGHUP, the node reloads its RPC configuration from the node config file.This reload always fails with:
logged at Error severity. The reload is non-fatal (it is silently skipped),
but every
SIGHUPnow emits a spuriousError-level trace.This applies to the new tracing system.
Steps to reproduce
Steps to reproduce the behavior:
SIGHUPto the node process:kill -HUP <pid>.Observed log line:
Expected behavior
A
SIGHUPRPC config reload from an otherwise valid config file should succeed(or, if RPC is disabled, be a no-op) and not emit an
Error-level trace.System info (please complete the following information):
Additional context
The
SIGHUPhandler callsupdateRpcConfiguration, passing the node configfile path (
ncConfigFile nc):cardano-node/src/Cardano/Node/Run.hsupdateRpcConfigurationre-parses the file and runs the fullmakeNodeConfigurationvalidation:cardano-node/src/Cardano/Node/Run.hsparseNodeConfigurationFPonly decodes the file contents:cardano-node/src/Cardano/Node/Configuration/POM.hsThe
FromJSON PartialNodeConfigurationinstance never readspncConfigFile—the config file path is normally injected from the
--configCLI argumentby the option parser, not stored inside the file. So after decoding,
pncConfigFile == mempty.makeNodeConfigurationthen requirespncConfigFileand fails:cardano-node/src/Cardano/Node/Configuration/POM.hs→
Left "Missing YAML config file"→ traced asRpcConfigUpdateErroratseverity
Error.Because the config file path is structurally never present in the parsed file,
this validation can never pass on the reload path — the failure is
deterministic for any node.