Skip to content

[BUG] - SIGHUP RPC config reload always fails with "Missing YAML config file" #6589

@mkoura

Description

@mkoura

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:

  1. Start a node (new tracing enabled).
  2. Send SIGHUP to the node process: kill -HUP <pid>.
  3. 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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions