[GH-ISSUE #1372] example_forwarder.toml config can't be parsed #658

Closed
opened 2026-03-15 23:43:16 +03:00 by kerem · 2 comments
Owner

Originally created by @cole-miller on GitHub (Feb 2, 2021).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1372

Describe the bug
The example_forwarder.toml configuration in tests/test-data/named_test_configs/ can't be parsed by trust_dns_server::config::Config::read_config.

To Reproduce
Put dependencies.trust_dns_server = "0.20.0" in Cargo.toml and the following in main.rs:

fn main() {
    dbg!(trust_dns_server::config::Config::read_config(
        &std::path::Path::new("./example_forwarder.toml")
    ));
}

Then copy example_forwarder.toml from the trust-dns repo to the crate root and cargo run.

Expected behavior
The config file should be parsed successfully and an Ok value should be returned from Config::read_config.

Actual behavior
An Err is returned. The dbg! output is

[src/main.rs:2] trust_dns_server::config::Config::read_config(&std::path::Path::new("./example_forwarder.toml")) = Err(
    Error {
        kind: TomlDecode(
            Error {
                inner: ErrorInner {
                    kind: Custom,
                    line: Some(
                        39,
                    ),
                    col: 18,
                    at: Some(
                        1191,
                    ),
                    message: "unknown variant `forward`, expected `file`",
                    key: [
                        "zones",
                        "stores",
                    ],
                },
            },
        ),
    },
)

System:

  • OS: Debian bullseye/sid
  • Architecture: x86_64
  • rustc version: 1.49.0

Version:
Crate: server
Version: 0.20.0

Originally created by @cole-miller on GitHub (Feb 2, 2021). Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1372 **Describe the bug** The `example_forwarder.toml` configuration in `tests/test-data/named_test_configs/` can't be parsed by `trust_dns_server::config::Config::read_config`. **To Reproduce** Put `dependencies.trust_dns_server = "0.20.0"` in `Cargo.toml` and the following in `main.rs`: ```rust fn main() { dbg!(trust_dns_server::config::Config::read_config( &std::path::Path::new("./example_forwarder.toml") )); } ``` Then copy `example_forwarder.toml` from the trust-dns repo to the crate root and `cargo run`. **Expected behavior** The config file should be parsed successfully and an `Ok` value should be returned from `Config::read_config`. **Actual behavior** An `Err` is returned. The `dbg!` output is ``` [src/main.rs:2] trust_dns_server::config::Config::read_config(&std::path::Path::new("./example_forwarder.toml")) = Err( Error { kind: TomlDecode( Error { inner: ErrorInner { kind: Custom, line: Some( 39, ), col: 18, at: Some( 1191, ), message: "unknown variant `forward`, expected `file`", key: [ "zones", "stores", ], }, }, ), }, ) ``` **System:** - OS: Debian bullseye/sid - Architecture: x86_64 - rustc version: 1.49.0 **Version:** Crate: server Version: 0.20.0
kerem closed this issue 2026-03-15 23:43:22 +03:00
Author
Owner

@djc commented on GitHub (Feb 3, 2021):

The Forward variant for StoreConfig is only available when trust-dns-server is compiled with the resolver feature enabled (which pulls in trust-dns-resolver as a dependency). Is it possible you missed that? (What documentation might have solved this?)

<!-- gh-comment-id:772481750 --> @djc commented on GitHub (Feb 3, 2021): The `Forward` variant for `StoreConfig` is only available when `trust-dns-server` is compiled with the `resolver` feature enabled (which pulls in `trust-dns-resolver` as a dependency). Is it possible you missed that? (What documentation might have solved this?)
Author
Owner

@cole-miller commented on GitHub (Feb 3, 2021):

Oops, sorry for the noise!

<!-- gh-comment-id:772495832 --> @cole-miller commented on GitHub (Feb 3, 2021): Oops, sorry for the noise!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#658
No description provided.