rapiz1 / rathole

A lightweight and high-performance reverse proxy for NAT traversal, written in Rust. An alternative to frp and ngrok.
Apache License 2.0
8.8k stars 440 forks source link

ERROR: rathole::config_watcher: The changed configuration is invalid. Ignored: Configuration is invalid. Please refer to the configuration specification.: Failed to parse the config: redefinition of table `server.services.mcbedrock` for key #375

Closed AlexPewMaster closed 1 week ago

AlexPewMaster commented 1 week ago

Describe the bug

Whenever I try adding the UDP port 19132 to the rathole server configuration, rathole throws up errors about this: Jun 21 13:20:12 fedora-vps rathole[4622]: 2024-06-21T13:20:12.804641Z ERROR config_watcher{path="/etc/rathole/server.toml"}: rathole::config_watcher: The changed configuration is invalid. Ignored: Configuration is invalid. Please refer to the configuration specification.: Failed to parse the config: redefinition of table server.services.blueberry_mcbedrock for key server.services.blueberry_mcbedrock at line 138 column 1

To Reproduce Steps to reproduce the behavior:

  1. Create a server config file with the content below and save as server.toml
  2. Run rathole with rathole -s server.toml
  3. See error

Configuration Configuration used to reproduce the behavior:

[server]
bind_addr = "0.0.0.0:2333"
default_token = "REDACTED"

[server.transport]
type = "noise"

[server.transport.noise]
local_private_key = "REDACTED"

# There are a lot of other things here, I left them out because they're unrelated to the issue

[server.services.blueberry_mcbedrock]
type = "udp"
bind_addr = "0.0.0.0:19132"

Logs

Jun 21 13:20:12 fedora-vps rathole[4622]: 2024-06-21T13:20:12.784133Z  INFO config_watcher{path="/etc/rathole/server.toml"}: rathole::config_watcher: Rescan the configuration
Jun 21 13:20:12 fedora-vps rathole[4622]: 2024-06-21T13:20:12.804641Z ERROR config_watcher{path="/etc/rathole/server.toml"}: rathole::config_watcher: The changed configuration is invalid. Ignored: Configuration is invalid. Please refer to the configuration specification.: Failed to parse the config: redefinition of table `server.services.blueberry_mcbedrock` for key `server.services.blueberry_mcbedrock` at line 138 column 1

Environment:

AlexPewMaster commented 1 week ago

Never mind, this was a duplicate entry of an existing one. I had this entry two times in the same config. I've removed the duplicate one and it worked like a charm!