IrineSistiana / mosdns

一个 DNS 转发器

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

为什么我的运行就报错 has invalid keys

CareyQ opened this issue · comments

Discussed in #814

Originally posted by CareyQ May 26, 2024
V5 版本,启动命令:mosdns -c config_custom.yaml start

一直报错 args 下的第一个参数无效 key。

例子一(upstreams):

plugins:
  - tag: forward_google # 先定义一个转发器
    type: forward
    args:
      upstreams:
        - addr: https://8.8.8.8/dns-query

报错

2024-05-26T02:10:00.265+0800    info    loading plugin  {"tag": "forward_google", "type": "forward"}
Error: mosdns exited, failed to init plugin #0, unable to decode plugin args: 1 error(s) decoding:

* '' has invalid keys: upstreams
2024-05-26T02:10:00.265+0800    fatal   mosdns exited, failed to init plugin #0, unable to decode plugin args: 1 error(s) decoding:

* '' has invalid keys: upstreams

例子二(files):

plugins:
  - tag: "hosts"
    type: "hosts"
    args:
      files:
        - "/etc/mosdns/rule/hosts.txt"

报错

2024-05-26T02:10:00.265+0800    info    loading plugin  {"tag": "hosts", "type": "hosts"}
Error: mosdns exited, failed to init plugin #0, unable to decode plugin args: 1 error(s) decoding:

* '' has invalid keys: files
2024-05-26T02:10:00.265+0800    fatal   mosdns exited, failed to init plugin #0, unable to decode plugin args: 1 error(s) decoding:

* '' has invalid keys: files

只要遇到 args 下的参数就有问题,麻了,有大佬知道原因吗